server: Don't touch the users count when a system process switches desktops.

This commit is contained in:
Alexandre Julliard 2008-05-05 21:02:34 +02:00
parent 6b007698d2
commit a789375f8b
1 changed files with 10 additions and 9 deletions

View File

@ -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 */