From ed6a0e6fcd685c0e74d61ba5c7ab5b93f17e8836 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 10 Jun 2016 18:16:10 +0000 Subject: Turn on -compositewm by default --- hw/xwin/man/XWin.man | 4 ++-- hw/xwin/winprocarg.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man index b39ac39b1..6b6fbe7e3 100644 --- a/hw/xwin/man/XWin.man +++ b/hw/xwin/man/XWin.man @@ -171,11 +171,11 @@ Add the host name to the window title for X applications which are running on remote hosts, when that information is available and it's useful to do so. The default is enabled. .TP 8 -.B \-compositewm -Experimental. +.B \-[no]compositewm Use Composite extension redirection to maintain a bitmap image of each top-level X window, so window contents which are occluded show correctly in task bar and task switcher previews. +The default is enabled. .SH OPTIONS CONTROLLING WINDOWS INTEGRATION .TP 8 diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 4e8e28361..0f3a89610 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -134,7 +134,7 @@ winInitializeScreenDefaults(void) defaultScreenInfo.fRootless = FALSE; #ifdef XWIN_MULTIWINDOW defaultScreenInfo.fMultiWindow = FALSE; - defaultScreenInfo.fCompositeWM = FALSE; + defaultScreenInfo.fCompositeWM = TRUE; #endif #if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) defaultScreenInfo.fMultiMonitorOverride = FALSE; @@ -599,6 +599,15 @@ ddxProcessArgument(int argc, char *argv[], int i) if (IS_OPTION("-compositewm")) { screenInfoPtr->fCompositeWM = TRUE; + /* Indicate that we have processed this argument */ + return 1; + } + /* + * Look for the '-nocompositewm' argument + */ + if (IS_OPTION("-nocompositewm")) { + screenInfoPtr->fCompositeWM = FALSE; + /* Indicate that we have processed this argument */ return 1; } -- cgit v1.2.3 From 08d03eb689c1e0444fc4d7bb78c9e9842c52b299 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Wed, 20 Apr 2016 12:19:51 +0100 Subject: Fix custom sysmenu not used initially It seems we need to defer setting the custom sysmenu until after WS_SYSMENU style is applied? --- hw/xwin/winmultiwindowwindow.c | 6 ------ hw/xwin/winmultiwindowwm.c | 7 +++++++ hw/xwin/winprefs.c | 4 +++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 7ef792917..7ff598743 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -690,12 +690,6 @@ winCreateWindowsTopLevelWindow(WindowPtr pWin) /* Adjust the X window to match the window placement we actually got... */ winAdjustXWindow(pWin, hWnd); - /* Make sure it gets the proper system menu for a WS_POPUP, too */ - GetSystemMenu(hWnd, TRUE); - - /* Cause any .XWinrc menus to be added in main WNDPROC */ - PostMessage(hWnd, WM_INIT_SYS_MENU, 0, 0); - SetProp(hWnd, WIN_WID_PROP, (HANDLE) (INT_PTR) winGetWindowID(pWin)); /* Flag that this Windows window handles its own activation */ diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index ea7fc649e..be2caf8d9 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -991,6 +991,13 @@ winMultiWindowWMProc(void *pArg) /* Determine the Window style, which determines borders and clipping region... */ UpdateStyle(pWMInfo, pNode->msg.iWindow, &maxmin); + /* Make sure it gets the proper system menu for a WS_POPUP, too */ + GetSystemMenu(pNode->msg.hwndWindow, TRUE); + +#define WM_INIT_SYS_MENU (WM_USER + 1001) + /* Cause any .XWinrc menus to be added in main WNDPROC */ + PostMessage(pNode->msg.hwndWindow, WM_INIT_SYS_MENU, 0, 0); + /* Display the window without activating it */ { xcb_get_window_attributes_cookie_t cookie; diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c index c97c88dca..ed1154b90 100644 --- a/hw/xwin/winprefs.c +++ b/hw/xwin/winprefs.c @@ -526,8 +526,10 @@ SetupSysMenu(HWND hwnd) pWin = GetProp(hwnd, WIN_WINDOW_PROP); sys = GetSystemMenu(hwnd, FALSE); - if (!sys) + if (!sys) { + ErrorF("SetupSysMenu: GetSystemMenu() failed for HWND %p\n", hwnd); return; + } if (pWin) { /* First see if there's a class match... */ -- cgit v1.2.3