I don't think it's useful anymore. Since fba938fa965a6ffd39d1a5e229c7f75b093a1a59 we don't try to move the embedded windows anymore, so they are always positioned where the host wants them to be. Then winex11 only has to deal with toplevel windows everywhere, and it makes the code simpler.
-- v2: winex11: Get rid of the foreign parent window.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/Makefile.in | 1 - dlls/winex11.drv/dllmain.c | 1 - dlls/winex11.drv/event.c | 201 ++++++++++++++++++--------------- dlls/winex11.drv/systray.c | 55 --------- dlls/winex11.drv/unixlib.h | 1 - dlls/winex11.drv/window.c | 123 +------------------- dlls/winex11.drv/x11drv.h | 5 +- dlls/winex11.drv/x11drv_dll.h | 3 - dlls/winex11.drv/x11drv_main.c | 3 +- 9 files changed, 114 insertions(+), 279 deletions(-) delete mode 100644 dlls/winex11.drv/systray.c
diff --git a/dlls/winex11.drv/Makefile.in b/dlls/winex11.drv/Makefile.in index 6439c78e2e9..98180b46d0c 100644 --- a/dlls/winex11.drv/Makefile.in +++ b/dlls/winex11.drv/Makefile.in @@ -20,7 +20,6 @@ SOURCES = \ opengl.c \ palette.c \ pen.c \ - systray.c \ version.rc \ vulkan.c \ window.c \ diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c index 14336adf583..01e5d417800 100644 --- a/dlls/winex11.drv/dllmain.c +++ b/dlls/winex11.drv/dllmain.c @@ -34,7 +34,6 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) .dnd_post_drop_callback = (UINT_PTR)x11drv_dnd_post_drop, .dnd_drop_event_callback = (UINT_PTR)x11drv_dnd_drop_event, .dnd_leave_event_callback = (UINT_PTR)x11drv_dnd_leave_event, - .foreign_window_proc = (UINT_PTR)foreign_window_proc, };
if (reason != DLL_PROCESS_ATTACH) return TRUE; diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index b8f10a73b6f..64d2597b077 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -84,6 +84,7 @@ static BOOL X11DRV_FocusIn( HWND hwnd, XEvent *event ); static BOOL X11DRV_FocusOut( HWND hwnd, XEvent *event ); static BOOL X11DRV_Expose( HWND hwnd, XEvent *event ); static BOOL X11DRV_MapNotify( HWND hwnd, XEvent *event ); +static BOOL X11DRV_DestroyNotify( HWND hwnd, XEvent *event ); static BOOL X11DRV_UnmapNotify( HWND hwnd, XEvent *event ); static BOOL X11DRV_ReparentNotify( HWND hwnd, XEvent *event ); static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *event ); @@ -149,6 +150,80 @@ BOOL keyboard_grabbed = FALSE;
int xinput2_opcode = 0;
+struct embed_entry +{ + struct list entry; + Window embedder; + HWND hwnd; +}; + +static BOOL sync_embedded_windows(void) +{ + struct x11drv_thread_data *thread_data = x11drv_thread_data(); + XConfigureEvent event = {.type = ConfigureNotify, .display = thread_data->display}; + struct x11drv_win_data *data; + struct embed_entry *entry; + BOOL ret = FALSE; + + LIST_FOR_EACH_ENTRY( entry, &thread_data->embedded_windows, struct embed_entry, entry ) + { + if (!(data = get_win_data( entry->hwnd ))) continue; + event.width = data->rects.visible.right - data->rects.visible.left; + event.height = data->rects.visible.bottom - data->rects.visible.top; + event.window = event.event = data->whole_window; + release_win_data( data ); + + if (X11DRV_ConfigureNotify( entry->hwnd, (XEvent *)&event )) ret = TRUE; + } + + return ret; +} + +static void select_embedder_input( Display *display, Window window, long mask ) +{ + Window xroot, xparent, *xchildren; + unsigned int nchildren; + + XSelectInput( display, window, mask ); + + if (!XQueryTree( display, window, &xroot, &xparent, &xchildren, &nchildren )) return; + XFree( xchildren ); + + if (xparent != xroot) select_embedder_input( display, xparent, mask ); +} + +static BOOL set_window_embedder( struct x11drv_win_data *data, Window embedder ) +{ + struct x11drv_thread_data *thread_data = x11drv_thread_data(); + struct embed_entry *entry, *next; + BOOL updated = FALSE; + + LIST_FOR_EACH_ENTRY_SAFE( entry, next, &thread_data->embedded_windows, struct embed_entry, entry ) + { + select_embedder_input( thread_data->display, entry->embedder, 0 ); + if (!data || entry->hwnd != data->hwnd) continue; + if ((entry->embedder = embedder)) updated = TRUE; + else + { + list_remove( &entry->entry ); + free( entry ); + } + } + + /* update the window data, and add a new entry if we haven't previously found and updated one */ + if (data && (data->embedder = embedder) && !updated && (entry = calloc( 1, sizeof(*entry) ))) + { + entry->hwnd = data->hwnd; + entry->embedder = embedder; + list_add_tail( &thread_data->embedded_windows, &entry->entry ); + } + + LIST_FOR_EACH_ENTRY( entry, &thread_data->embedded_windows, struct embed_entry, entry ) + select_embedder_input( thread_data->display, entry->embedder, StructureNotifyMask ); + + return sync_embedded_windows(); +} + /* return the name of an X event */ static const char *dbgstr_event( int type ) { @@ -944,44 +1019,32 @@ static BOOL X11DRV_MapNotify( HWND hwnd, XEvent *event ) }
-/********************************************************************** - * X11DRV_UnmapNotify +/*********************************************************************** + * X11DRV_DestroyNotify */ -static BOOL X11DRV_UnmapNotify( HWND hwnd, XEvent *event ) +static BOOL X11DRV_DestroyNotify( HWND hwnd, XEvent *event ) { + struct x11drv_win_data *data; + BOOL embedded; + + if (!(data = get_win_data( hwnd ))) return FALSE; + embedded = data->embedded; + if (!embedded) FIXME( "window %p/%lx destroyed from the outside\n", hwnd, data->whole_window ); + if (data->embedder) set_window_embedder( data, 0 ); + + destroy_whole_window( data, TRUE ); + release_win_data( data ); + if (embedded) send_message( hwnd, WM_CLOSE, 0, 0 ); return TRUE; }
-/*********************************************************************** - * reparent_notify +/********************************************************************** + * X11DRV_UnmapNotify */ -static void reparent_notify( Display *display, HWND hwnd, Window xparent, int x, int y ) +static BOOL X11DRV_UnmapNotify( HWND hwnd, XEvent *event ) { - HWND parent, old_parent; - DWORD style, flags = 0; - - style = NtUserGetWindowLongW( hwnd, GWL_STYLE ); - if (xparent == root_window) - { - parent = NtUserGetDesktopWindow(); - style = (style & ~WS_CHILD) | WS_POPUP; - } - else - { - if (!(parent = create_foreign_window( display, xparent ))) return; - style = (style & ~WS_POPUP) | WS_CHILD; - } - - NtUserShowWindow( hwnd, SW_HIDE ); - old_parent = NtUserSetParent( hwnd, parent ); - NtUserSetWindowLong( hwnd, GWL_STYLE, style, FALSE ); - - if (style & WS_VISIBLE) flags = SWP_SHOWWINDOW; - set_window_pos( hwnd, HWND_TOP, x, y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOCOPYBITS | flags ); - - /* make old parent destroy itself if it no longer has children */ - if (old_parent != NtUserGetDesktopWindow()) NtUserPostMessage( old_parent, WM_CLOSE, 0, 0 ); + return TRUE; }
@@ -993,6 +1056,8 @@ static BOOL X11DRV_ReparentNotify( HWND hwnd, XEvent *xev ) XReparentEvent *event = &xev->xreparent; struct x11drv_win_data *data;
+ if (!hwnd) return set_window_embedder( NULL, 0 ); /* refresh the embedder window tree */ + if (!(data = get_win_data( hwnd ))) return FALSE;
if (!data->embedded) @@ -1001,27 +1066,23 @@ static BOOL X11DRV_ReparentNotify( HWND hwnd, XEvent *xev ) return FALSE; }
- if (data->whole_window) + if (event->parent == root_window) { - if (event->parent == root_window) - { - TRACE( "%p/%lx reparented to root\n", hwnd, data->whole_window ); - data->embedder = 0; - release_win_data( data ); - send_message( hwnd, WM_CLOSE, 0, 0 ); - return TRUE; - } - data->embedder = event->parent; + set_window_embedder( data, 0 ); + TRACE( "%p/%lx reparented to root\n", hwnd, data->whole_window ); + release_win_data( data ); + + send_message( hwnd, WM_CLOSE, 0, 0 ); + return TRUE; }
+ set_window_embedder( data, event->parent ); TRACE( "%p/%lx reparented to %lx\n", hwnd, data->whole_window, event->parent ); release_win_data( data );
- reparent_notify( event->display, hwnd, event->parent, event->x, event->y ); return TRUE; }
- /*********************************************************************** * X11DRV_ConfigureNotify */ @@ -1032,17 +1093,12 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) RECT rect; POINT pos; UINT flags, dpi; - HWND parent; - BOOL root_coords; int cx, cy, x = event->x, y = event->y; DWORD style;
- if (!hwnd) return FALSE; + if (!hwnd) return sync_embedded_windows(); if (!(data = get_win_data( hwnd ))) return FALSE; - if (!data->mapped || data->iconic) goto done; - if (data->whole_window && !data->managed) goto done; - /* ignore synthetic events on foreign windows */ - if (event->send_event && !data->whole_window) goto done; + if (!data->mapped || data->iconic || !data->managed) goto done; if (data->configure_serial && (long)(data->configure_serial - event->serial) > 0) { TRACE( "win %p/%lx event %d,%d,%dx%d ignoring old serial %lu/%lu\n", @@ -1054,27 +1110,16 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) /* Get geometry */
dpi = get_win_monitor_dpi( data->hwnd ); - parent = NtUserGetAncestor( hwnd, GA_PARENT ); - root_coords = event->send_event; /* synthetic events are always in root coords */ - - if (!root_coords && parent == NtUserGetDesktopWindow()) /* normal event, map coordinates to the root */ + if (data->embedded || !event->send_event /* synthetic events are always in root coords */) { Window child; XTranslateCoordinates( event->display, event->window, root_window, 0, 0, &x, &y, &child ); - root_coords = TRUE; - } - - if (!root_coords) - { - pos.x = x; - pos.y = y; } - else pos = root_to_virtual_screen( x, y );
+ pos = root_to_virtual_screen( x, y ); SetRect( &rect, pos.x, pos.y, pos.x + event->width, pos.y + event->height ); rect = window_rect_from_visible( &data->rects, rect ); - if (root_coords) NtUserMapWindowPoints( 0, parent, (POINT *)&rect, 2, 0 /* per-monitor DPI */ );
TRACE( "win %p/%lx new X rect %d,%d,%dx%d (event %d,%d,%dx%d)\n", hwnd, data->whole_window, (int)rect.left, (int)rect.top, @@ -1089,8 +1134,6 @@ static BOOL X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) cy = rect.bottom - rect.top; flags = SWP_NOACTIVATE | SWP_NOZORDER;
- if (!data->whole_window) flags |= SWP_NOCOPYBITS; /* we can't copy bits of foreign windows */ - if (data->rects.window.left == x && data->rects.window.top == y) flags |= SWP_NOMOVE; else TRACE( "%p moving from (%d,%d) to (%d,%d)\n", @@ -1146,32 +1189,7 @@ done: */ static BOOL X11DRV_GravityNotify( HWND hwnd, XEvent *xev ) { - XGravityEvent *event = &xev->xgravity; - struct x11drv_win_data *data = get_win_data( hwnd ); - RECT window_rect; - int x, y; - - if (!data) return FALSE; - - if (data->whole_window) /* only handle this for foreign windows */ - { - release_win_data( data ); - return FALSE; - } - - x = event->x + data->rects.window.left - data->rects.visible.left; - y = event->y + data->rects.window.top - data->rects.visible.top; - - TRACE( "win %p/%lx new X pos %d,%d (event %d,%d)\n", - hwnd, data->whole_window, x, y, event->x, event->y ); - - window_rect = data->rects.window; - release_win_data( data ); - - if (window_rect.left != x || window_rect.top != y) - set_window_pos( hwnd, 0, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS ); - - return TRUE; + return sync_embedded_windows(); }
@@ -1572,7 +1590,7 @@ static void handle_xembed_protocol( HWND hwnd, XClientMessageEvent *event ) if (!data) break;
TRACE( "win %p/%lx XEMBED_EMBEDDED_NOTIFY owner %lx\n", hwnd, event->window, event->data.l[3] ); - data->embedder = event->data.l[3]; + set_window_embedder( data, event->data.l[3] );
/* window has been marked as embedded before (e.g. systray) */ if (data->embedded || !data->embedder /* broken QX11EmbedContainer implementation */) @@ -1583,7 +1601,6 @@ static void handle_xembed_protocol( HWND hwnd, XClientMessageEvent *event )
make_window_embedded( data ); release_win_data( data ); - reparent_notify( event->display, hwnd, event->data.l[3], 0, 0 ); } break;
diff --git a/dlls/winex11.drv/systray.c b/dlls/winex11.drv/systray.c deleted file mode 100644 index e21ce481f9b..00000000000 --- a/dlls/winex11.drv/systray.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * X11 system tray management - * - * Copyright (C) 2004 Mike Hearn, for CodeWeavers - * Copyright (C) 2005 Robert Shearman - * Copyright (C) 2008 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "x11drv_dll.h" -#include "commctrl.h" -#include "shellapi.h" - -#include "wine/list.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(systray); - -/* window procedure for foreign windows */ -LRESULT WINAPI foreign_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) -{ - switch(msg) - { - case WM_WINDOWPOSCHANGED: - { - HWND hwnd = FindWindowW( L"Shell_TrayWnd", NULL ); - PostMessageW( hwnd, WM_USER + 0, 0, 0 ); - break; - } - case WM_PARENTNOTIFY: - if (LOWORD(wparam) == WM_DESTROY) - { - TRACE( "%p: got parent notify destroy for win %Ix\n", hwnd, lparam ); - PostMessageW( hwnd, WM_CLOSE, 0, 0 ); /* so that we come back here once the child is gone */ - } - return 0; - case WM_CLOSE: - if (GetWindow( hwnd, GW_CHILD )) return 0; /* refuse to die if we still have children */ - break; - } - return DefWindowProcW( hwnd, msg, wparam, lparam ); -} diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h index 522411f8e55..f23d7204bcd 100644 --- a/dlls/winex11.drv/unixlib.h +++ b/dlls/winex11.drv/unixlib.h @@ -40,7 +40,6 @@ struct init_params UINT64 dnd_post_drop_callback; UINT64 dnd_drop_event_callback; UINT64 dnd_leave_event_callback; - UINT64 foreign_window_proc; };
/* x11drv_tablet_info params */ diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 8d795581f83..200a918e19d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -103,8 +103,6 @@ static XContext win_data_context = 0; static Time last_user_time; static Window user_time_window;
-static const WCHAR foreign_window_prop[] = - {'_','_','w','i','n','e','_','x','1','1','_','f','o','r','e','i','g','n','_','w','i','n','d','o','w',0}; static const WCHAR whole_window_prop[] = {'_','_','w','i','n','e','_','x','1','1','_','w','h','o','l','e','_','w','i','n','d','o','w',0}; static const WCHAR clip_window_prop[] = @@ -1728,23 +1726,13 @@ done: * * Destroy the whole X window for a given window. */ -static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_destroyed ) +void destroy_whole_window( struct x11drv_win_data *data, BOOL already_destroyed ) { TRACE( "win %p xwin %lx/%lx\n", data->hwnd, data->whole_window, data->client_window );
if (!data->whole_window) { - if (data->embedded) - { - Window xwin = (Window)NtUserGetProp( data->hwnd, foreign_window_prop ); - if (xwin) - { - if (!already_destroyed) XSelectInput( data->display, xwin, 0 ); - XDeleteContext( data->display, xwin, winContext ); - NtUserRemoveProp( data->hwnd, foreign_window_prop ); - } - return; - } + if (data->embedded) return; } else { @@ -1865,25 +1853,6 @@ void X11DRV_DestroyWindow( HWND hwnd ) }
-/*********************************************************************** - * X11DRV_DestroyNotify - */ -BOOL X11DRV_DestroyNotify( HWND hwnd, XEvent *event ) -{ - struct x11drv_win_data *data; - BOOL embedded; - - if (!(data = get_win_data( hwnd ))) return FALSE; - embedded = data->embedded; - if (!embedded) FIXME( "window %p/%lx destroyed from the outside\n", hwnd, data->whole_window ); - - destroy_whole_window( data, TRUE ); - release_win_data( data ); - if (embedded) send_message( hwnd, WM_CLOSE, 0, 0 ); - return TRUE; -} - - /* initialize the desktop window id in the desktop manager process */ static BOOL create_desktop_win_data( Window win, HWND hwnd ) { @@ -2083,93 +2052,6 @@ static struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd, const struct w }
-/*********************************************************************** - * create_foreign_window - * - * Create a foreign window for the specified X window and its ancestors - */ -HWND create_foreign_window( Display *display, Window xwin ) -{ - static BOOL class_registered; - struct x11drv_win_data *data; - HWND hwnd, parent; - POINT pos; - Window xparent, xroot; - Window *xchildren; - unsigned int nchildren; - XWindowAttributes attr; - UINT style = WS_CLIPCHILDREN; - UNICODE_STRING class_name = RTL_CONSTANT_STRING( foreign_window_prop ); - - if (!class_registered) - { - UNICODE_STRING version = { 0 }; - WNDCLASSEXW class; - - memset( &class, 0, sizeof(class) ); - class.cbSize = sizeof(class); - class.lpfnWndProc = (WNDPROC)(UINT_PTR)client_foreign_window_proc; - class.lpszClassName = foreign_window_prop; - if (!NtUserRegisterClassExWOW( &class, &class_name, &version, NULL, 0, 0, NULL ) && - RtlGetLastWin32Error() != ERROR_CLASS_ALREADY_EXISTS) - { - ERR( "Could not register foreign window class\n" ); - return FALSE; - } - class_registered = TRUE; - } - - if (XFindContext( display, xwin, winContext, (char **)&hwnd )) hwnd = 0; - if (hwnd) return hwnd; /* already created */ - - XSelectInput( display, xwin, StructureNotifyMask ); - if (!XGetWindowAttributes( display, xwin, &attr ) || - !XQueryTree( display, xwin, &xroot, &xparent, &xchildren, &nchildren )) - { - XSelectInput( display, xwin, 0 ); - return 0; - } - XFree( xchildren ); - - if (xparent == xroot) - { - parent = NtUserGetDesktopWindow(); - style |= WS_POPUP; - pos = root_to_virtual_screen( attr.x, attr.y ); - } - else - { - parent = create_foreign_window( display, xparent ); - style |= WS_CHILD; - pos.x = attr.x; - pos.y = attr.y; - } - - hwnd = NtUserCreateWindowEx( 0, &class_name, &class_name, NULL, style, pos.x, pos.y, - attr.width, attr.height, parent, 0, NULL, NULL, 0, NULL, - 0, FALSE ); - if (!(data = get_win_data( hwnd ))) - { - NtUserDestroyWindow( hwnd ); - return 0; - } - destroy_whole_window( data, FALSE ); - data->embedded = TRUE; - data->mapped = TRUE; - - NtUserSetProp( hwnd, foreign_window_prop, (HANDLE)xwin ); - XSaveContext( display, xwin, winContext, (char *)data->hwnd ); - - TRACE( "win %lx parent %p style %08x %s -> hwnd %p\n", - xwin, parent, style, wine_dbgstr_rect(&data->rects.window), hwnd ); - - release_win_data( data ); - - NtUserShowWindow( hwnd, SW_SHOW ); - return hwnd; -} - - /*********************************************************************** * SystrayDockInit (X11DRV.@) */ @@ -2365,7 +2247,6 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, else escape.drawable = X11DRV_get_whole_window( top ); }
- if (!escape.drawable) return; /* don't create a GC for foreign windows */ NtGdiExtEscape( hdc, NULL, 0, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); }
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index bffcd196d04..4b94bb76972 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -371,6 +371,7 @@ struct x11drv_thread_data unsigned long warp_serial; /* serial number of last pointer warp request */ Window clip_window; /* window used for cursor clipping */ BOOL clipping_cursor; /* whether thread is currently clipping the cursor */ + struct list embedded_windows; /* list of embed_entry for embedder tracking */ #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H XIValuatorClassInfo x_valuator; XIValuatorClassInfo y_valuator; @@ -429,7 +430,6 @@ extern int alloc_system_colors; extern int xrender_error_base; extern char *process_name; extern Display *clipboard_display; -extern UINT64 client_foreign_window_proc; extern UINT64 dnd_enter_event_callback; extern UINT64 dnd_position_event_callback; extern UINT64 dnd_post_drop_callback; @@ -548,7 +548,6 @@ extern BOOL X11DRV_MotionNotify( HWND hwnd, XEvent *event ); extern BOOL X11DRV_EnterNotify( HWND hwnd, XEvent *event ); extern BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *event ); extern BOOL X11DRV_KeymapNotify( HWND hwnd, XEvent *event ); -extern BOOL X11DRV_DestroyNotify( HWND hwnd, XEvent *event ); extern BOOL X11DRV_SelectionRequest( HWND hWnd, XEvent *event ); extern BOOL X11DRV_SelectionClear( HWND hWnd, XEvent *event ); extern BOOL X11DRV_MappingNotify( HWND hWnd, XEvent *event ); @@ -636,9 +635,9 @@ extern void make_window_embedded( struct x11drv_win_data *data ); extern Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colormap ); extern void detach_client_window( struct x11drv_win_data *data, Window client_window ); extern void destroy_client_window( HWND hwnd, Window client_window ); +extern void destroy_whole_window( struct x11drv_win_data *data, BOOL already_destroyed ); extern void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BOOL use_alpha ); extern void change_systray_owner( Display *display, Window systray_window ); -extern HWND create_foreign_window( Display *display, Window window ); extern BOOL update_clipboard( HWND hwnd ); extern void init_win_context(void); extern DROPFILES *file_list_to_drop_files( const void *data, size_t size, size_t *ret_size ); diff --git a/dlls/winex11.drv/x11drv_dll.h b/dlls/winex11.drv/x11drv_dll.h index bc68c3996c3..6113f01344a 100644 --- a/dlls/winex11.drv/x11drv_dll.h +++ b/dlls/winex11.drv/x11drv_dll.h @@ -33,9 +33,6 @@ extern NTSTATUS WINAPI x11drv_dnd_post_drop( void *data, ULONG size ); extern NTSTATUS WINAPI x11drv_dnd_drop_event( void *params, ULONG size ); extern NTSTATUS WINAPI x11drv_dnd_leave_event( void *params, ULONG size );
-extern LRESULT WINAPI foreign_window_proc( HWND hwnd, UINT msg, WPARAM wparam, - LPARAM lparam ); - extern HMODULE x11drv_module;
#endif /* __WINE_X11DRV_DLL_H */ diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 3f8e48a7a8d..32cf048aace 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -85,7 +85,6 @@ int copy_default_colors = 128; int alloc_system_colors = 256; int xrender_error_base = 0; char *process_name = NULL; -UINT64 client_foreign_window_proc = 0; UINT64 dnd_enter_event_callback = 0; UINT64 dnd_position_event_callback = 0; UINT64 dnd_post_drop_callback = 0; @@ -653,7 +652,6 @@ static NTSTATUS x11drv_init( void *arg ) dnd_post_drop_callback = params->dnd_post_drop_callback; dnd_drop_event_callback = params->dnd_drop_event_callback; dnd_leave_event_callback = params->dnd_leave_event_callback; - client_foreign_window_proc = params->foreign_window_proc;
fcntl( ConnectionNumber(display), F_SETFD, 1 ); /* set close on exec flag */ root_window = DefaultRootWindow( display ); @@ -758,6 +756,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) ERR_(winediag)( "x11drv: Can't open display: %s. Please ensure that your X server is running and that $DISPLAY is set correctly.\n", XDisplayName(NULL)); NtTerminateProcess( 0, 1 ); } + list_init( &data->embedded_windows );
fcntl( ConnectionNumber(data->display), F_SETFD, 1 ); /* set close on exec flag */
Maybe something like that? It's a bit more ad-hoc, but I think it also better separates the embedded window feature which is really only useful for systray icon docking.
Foreign windows are a bit annoying for per-monitor DPI mapping, especially as I'm planning on adding arbitrary monitor rect mappings, having all the driver surfaces absolutely positioned would make things much easier to work with.
This merge request was closed by Rémi Bernon.