Module: wine
Branch: refs/heads/master
Commit: 38e74b31117dea10211ee77668618974ab9c4d45
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=38e74b31117dea10211ee77…
Author: Robert Shearman <rob(a)codeweavers.com>
Date: Wed Jun 7 20:12:16 2006 +0100
server: Don't attach the thread input when changing parents if the new
parent is the desktop (i.e. it is becoming a top-level window).
---
server/window.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/server/window.c b/server/window.c
index a83ce09..f2017ec 100644
--- a/server/window.c
+++ b/server/window.c
@@ -114,6 +114,12 @@ inline static struct window *get_window(
return ret;
}
+/* check if window is the desktop */
+static inline int is_desktop_window( const struct window *win )
+{
+ return !win->parent; /* only desktop windows have no parent */
+}
+
/* change the parent of a window (or unlink the window if the new parent is NULL) */
static int set_parent_window( struct window *win, struct window *parent )
{
@@ -136,8 +142,9 @@ static int set_parent_window( struct win
win->parent = parent;
list_add_head( &parent->children, &win->entry );
- /* if parent belongs to a different thread, attach the two threads */
- if (parent->thread && parent->thread != win->thread)
+ /* if parent belongs to a different thread and the window isn't */
+ /* top-level, attach the two threads */
+ if (parent->thread && parent->thread != win->thread && !is_desktop_window(parent))
attach_thread_input( win->thread, parent->thread );
}
else /* move it to parent unlinked list */
@@ -177,12 +184,6 @@ static inline struct window *get_last_ch
return ptr ? LIST_ENTRY( ptr, struct window, entry ) : NULL;
}
-/* check if window is the desktop */
-static inline int is_desktop_window( const struct window *win )
-{
- return !win->parent; /* only desktop windows have no parent */
-}
-
/* append a user handle to a handle array */
static int add_handle_to_array( struct user_handle_array *array, user_handle_t handle )
{
@@ -425,7 +426,8 @@ static struct window *create_window( str
goto failed;
}
- /* if parent belongs to a different thread, attach the two threads */
+ /* if parent belongs to a different thread and the window isn't */
+ /* top-level, attach the two threads */
if (parent && parent->thread && parent->thread != current && !is_desktop_window(parent))
{
if (!attach_thread_input( current, parent->thread )) goto failed;