From a789375f8bffca8a92777d2b41f605b22f719872 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 5 May 2008 21:02:34 +0200 Subject: [PATCH] server: Don't touch the users count when a system process switches desktops. --- server/winstation.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/server/winstation.c b/server/winstation.c index 817fe7785b4..2ad41465df7 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -309,17 +309,18 @@ void set_process_default_desktop( struct process *process, struct desktop *deskt LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry ) if (!thread->desktop) thread->desktop = handle; - desktop->users++; - if (desktop->close_timeout) + if (!process->is_system) { - remove_timeout_user( desktop->close_timeout ); - desktop->close_timeout = NULL; - } - if (old_desktop) - { - old_desktop->users--; - release_object( old_desktop ); + desktop->users++; + if (desktop->close_timeout) + { + remove_timeout_user( desktop->close_timeout ); + desktop->close_timeout = NULL; + } + if (old_desktop) old_desktop->users--; } + + if (old_desktop) release_object( old_desktop ); } /* connect a process to its window station */