Re: server: fixup input windows on thread_detach
Aric Stewart <aric(a)codeweavers.com> writes:
@@ -1075,6 +1075,27 @@ int attach_thread_input( struct thread *thread_from, struct thread *thread_to ) return ret; }
+/* ensure the input data is correct for the thread after detach */ +void correct_thread_input( struct thread *thread_from ) +{ + if (thread_from->queue) + { + struct thread *thread; + if (thread_from->queue->input->focus) + { + thread = get_window_thread( thread_from->queue->input->focus ); + if (thread != thread_from) thread_from->queue->input->focus = 0; + release_object( thread ); + } + if (thread_from->queue->input->active) + { + thread = get_window_thread( thread_from->queue->input->active ); + if (thread != thread_from) thread_from->queue->input->active = 0; + release_object( thread ); + } + } +}
This needs to be done inside detach_thread_input so that it happens for all callers. -- Alexandre Julliard julliard(a)winehq.org
On 5/4/15 2:34 AM, Alexandre Julliard wrote:
Aric Stewart <aric(a)codeweavers.com> writes:
@@ -1075,6 +1075,27 @@ int attach_thread_input( struct thread *thread_from, struct thread *thread_to ) return ret; }
+/* ensure the input data is correct for the thread after detach */ +void correct_thread_input( struct thread *thread_from ) +{ + if (thread_from->queue) + { + struct thread *thread; + if (thread_from->queue->input->focus) + { + thread = get_window_thread( thread_from->queue->input->focus ); + if (thread != thread_from) thread_from->queue->input->focus = 0; + release_object( thread ); + } + if (thread_from->queue->input->active) + { + thread = get_window_thread( thread_from->queue->input->active ); + if (thread != thread_from) thread_from->queue->input->active = 0; + release_object( thread ); + } + } +}
This needs to be done inside detach_thread_input so that it happens for all callers.
Ok thanks! resent! -aric
participants (2)
-
Alexandre Julliard -
Aric Stewart