aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-23 12:35:44 +0100
committermarha <marha@users.sourceforge.net>2012-02-23 12:36:22 +0100
commit769a37773769b08829f68e7f5ce0fc3bf66f6445 (patch)
tree8f38c4a5164626cd50e5f09ab3cec0663fd833e8 /xorg-server/hw
parent50cb30a8b13f3218a1dc933a4584466f4d616438 (diff)
downloadvcxsrv-769a37773769b08829f68e7f5ce0fc3bf66f6445.tar.gz
vcxsrv-769a37773769b08829f68e7f5ce0fc3bf66f6445.tar.bz2
vcxsrv-769a37773769b08829f68e7f5ce0fc3bf66f6445.zip
Added taskbar grouping for windows 7
Diffstat (limited to 'xorg-server/hw')
-rw-r--r--xorg-server/hw/xwin/InitOutput.c10
-rw-r--r--xorg-server/hw/xwin/glx/indirect.c11
-rw-r--r--xorg-server/hw/xwin/taskbar.h39
-rw-r--r--xorg-server/hw/xwin/win.h2
-rw-r--r--xorg-server/hw/xwin/wincreatewnd.c90
-rw-r--r--xorg-server/hw/xwin/winkeybd.c23
-rw-r--r--xorg-server/hw/xwin/winmonitors.c1
-rw-r--r--xorg-server/hw/xwin/winmonitors.h1
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwm.c118
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwndproc.c47
-rw-r--r--xorg-server/hw/xwin/winprocarg.c6
-rw-r--r--xorg-server/hw/xwin/winwindow.h8
12 files changed, 315 insertions, 41 deletions
diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c
index a40446d98..2a1635c92 100644
--- a/xorg-server/hw/xwin/InitOutput.c
+++ b/xorg-server/hw/xwin/InitOutput.c
@@ -186,6 +186,9 @@ ddxGiveUp (enum ExitCode error)
}
#ifdef XWIN_MULTIWINDOW
+ /* Unload libraries for taskbar grouping */
+ winTaskbarDestroy ();
+
/* Notify the worker threads we're exiting */
winDeinitMultiWindowWM ();
#endif
@@ -833,7 +836,7 @@ winUseMsg (void)
ErrorF ("-resize=none|scrollbars|randr"
"\tIn windowed mode, [don't] allow resizing of the window. 'scrollbars'\n"
"\tmode gives the window scrollbars as needed, 'randr' mode uses the RANR\n"
- "\textension to resize the X screen.\n");
+ "\textension to resize the X screen. 'randr' is the default.\n");
ErrorF ("-rootless\n"
"\tRun the server in rootless mode.\n");
@@ -979,6 +982,11 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
/* Detect supported engines */
winDetectSupportedEngines ();
+#ifdef XWIN_MULTIWINDOW
+ /* Load libraries for taskbar grouping */
+ winTaskbarInit ();
+#endif
+
/* Store the instance handle */
g_hInstance = GetModuleHandle (NULL);
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c
index 6b1265d70..b60f0c87c 100644
--- a/xorg-server/hw/xwin/glx/indirect.c
+++ b/xorg-server/hw/xwin/glx/indirect.c
@@ -530,8 +530,15 @@ glxLogExtensions(const char *prefix, const char *extensions)
}
strl = strtok(str, " ");
- winDebug("%s%s", prefix, strl);
- length = strlen(prefix) + strlen(strl);
+ if (!strl)
+ {
+ winDebug("%s", prefix);
+ }
+ else
+ {
+ winDebug("%s%s", prefix, strl);
+ length = strlen(prefix) + strlen(strl);
+ }
while (1)
{
diff --git a/xorg-server/hw/xwin/taskbar.h b/xorg-server/hw/xwin/taskbar.h
new file mode 100644
index 000000000..94f3f9efb
--- /dev/null
+++ b/xorg-server/hw/xwin/taskbar.h
@@ -0,0 +1,39 @@
+/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ *"Software"), to deal in the Software without restriction, including
+ *without limitation the rights to use, copy, modify, merge, publish,
+ *distribute, sublicense, and/or sell copies of the Software, and to
+ *permit persons to whom the Software is furnished to do so, subject to
+ *the following conditions:
+ *
+ *The above copyright notice and this permission notice shall be
+ *included in all copies or substantial portions of the Software.
+ *
+ *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
+ *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ */
+
+#ifndef _TASKBAR_H
+#define _TASKBAR_H
+
+#include <windows.h>
+#include <propsys.h>
+#include <propkey.h>
+
+typedef HRESULT (__stdcall *SHGETPROPERTYSTOREFORWINDOWPROC)(HWND,REFIID,void**);
+typedef HRESULT (__stdcall *PROPVARIANTCLEARPROC)(PROPVARIANT*);
+
+#endif
diff --git a/xorg-server/hw/xwin/win.h b/xorg-server/hw/xwin/win.h
index 2766bb119..aa01d6ed1 100644
--- a/xorg-server/hw/xwin/win.h
+++ b/xorg-server/hw/xwin/win.h
@@ -360,6 +360,8 @@ typedef struct
DWORD dwScreen;
int iMonitor;
+ HMONITOR hMonitor;
+
DWORD dwUserWidth;
DWORD dwUserHeight;
DWORD dwWidth;
diff --git a/xorg-server/hw/xwin/wincreatewnd.c b/xorg-server/hw/xwin/wincreatewnd.c
index 9931abe75..9b5b2f78f 100644
--- a/xorg-server/hw/xwin/wincreatewnd.c
+++ b/xorg-server/hw/xwin/wincreatewnd.c
@@ -34,10 +34,6 @@
#include "win.h"
#include "shellapi.h"
-#ifndef ABS_AUTOHIDE
-#define ABS_AUTOHIDE 1
-#endif
-
/*
* Local function prototypes
*/
@@ -46,7 +42,7 @@ static Bool
winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo);
static Bool
-winAdjustForAutoHide (RECT *prcWorkArea);
+winAdjustForAutoHide (RECT *prcWorkArea, winScreenInfo *pScreenInfo);
/*
@@ -225,7 +221,7 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
winGetWorkArea (&rcWorkArea, pScreenInfo);
/* Adjust for auto-hide taskbars */
- winAdjustForAutoHide (&rcWorkArea);
+ winAdjustForAutoHide (&rcWorkArea, pScreenInfo);
/* Did the user specify a position? */
if (pScreenInfo->fUserGavePosition)
@@ -519,14 +515,33 @@ winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo)
int iLeft, iTop;
int iPrimaryNonWorkAreaWidth, iPrimaryNonWorkAreaHeight;
- /* SPI_GETWORKAREA only gets the work area of the primary screen. */
- SystemParametersInfo (SPI_GETWORKAREA, 0, prcWorkArea, 0);
+ /* Use GetMonitorInfo to get work area for monitor */
+ if (!pScreenInfo->fMultipleMonitors)
+ {
+ MONITORINFO mi;
+ mi.cbSize = sizeof(MONITORINFO);
+ if (GetMonitorInfo(pScreenInfo->hMonitor, &mi))
+ {
+ *prcWorkArea = mi.rcWork;
+
+ winDebug ("winGetWorkArea - Monitor %d WorkArea: %d %d %d %d\n",
+ pScreenInfo->iMonitor,
+ (int) prcWorkArea->top, (int) prcWorkArea->left,
+ (int) prcWorkArea->bottom, (int) prcWorkArea->right);
+ }
+ else
+ {
+ ErrorF ("winGetWorkArea - GetMonitorInfo() failed for monitor %d\n", pScreenInfo->iMonitor);
+ }
/* Bail out here if we aren't using multiple monitors */
- if (!pScreenInfo->fMultipleMonitors)
return TRUE;
+ }
+
+ /* SPI_GETWORKAREA only gets the work area of the primary screen. */
+ SystemParametersInfo (SPI_GETWORKAREA, 0, prcWorkArea, 0);
- winDebug ("winGetWorkArea - Original WorkArea: %d %d %d %d\n",
+ winDebug ("winGetWorkArea - Primary Monitor WorkArea: %d %d %d %d\n",
(int) prcWorkArea->top, (int) prcWorkArea->left,
(int) prcWorkArea->bottom, (int) prcWorkArea->right);
@@ -577,6 +592,28 @@ winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo)
return TRUE;
}
+static Bool
+winTaskbarOnScreenEdge(unsigned int uEdge, winScreenInfo *pScreenInfo)
+{
+ APPBARDATA abd;
+ HWND hwndAutoHide;
+
+ ZeroMemory (&abd, sizeof (abd));
+ abd.cbSize = sizeof (abd);
+ abd.uEdge = uEdge;
+
+ hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
+ if (hwndAutoHide != NULL)
+ {
+ /*
+ Found an autohide taskbar on that edge, but is it on the
+ same monitor as the screen window?
+ */
+ if (pScreenInfo->fMultipleMonitors || (MonitorFromWindow(hwndAutoHide, MONITOR_DEFAULTTONULL) == pScreenInfo->hMonitor))
+ return TRUE;
+ }
+ return FALSE;
+}
/*
* Adjust the client area so that any auto-hide toolbars
@@ -584,10 +621,9 @@ winGetWorkArea (RECT *prcWorkArea, winScreenInfo *pScreenInfo)
*/
static Bool
-winAdjustForAutoHide (RECT *prcWorkArea)
+winAdjustForAutoHide (RECT *prcWorkArea, winScreenInfo *pScreenInfo)
{
APPBARDATA abd;
- HWND hwndAutoHide;
winDebug ("winAdjustForAutoHide - Original WorkArea: %d %d %d %d\n",
(int) prcWorkArea->top, (int) prcWorkArea->left,
@@ -599,37 +635,34 @@ winAdjustForAutoHide (RECT *prcWorkArea)
if (SHAppBarMessage (ABM_GETSTATE, &abd) & ABS_AUTOHIDE)
winDebug ("winAdjustForAutoHide - Taskbar is auto hide\n");
+ /*
+ Despite the forgoing, we are checking for any AppBar
+ hiding along a monitor edge, not just the Windows TaskBar.
+ */
+
/* Look for a TOP auto-hide taskbar */
- abd.uEdge = ABE_TOP;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
- if (hwndAutoHide != NULL)
+ if (winTaskbarOnScreenEdge(ABE_TOP, pScreenInfo))
{
winDebug ("winAdjustForAutoHide - Found TOP auto-hide taskbar\n");
prcWorkArea->top += 1;
}
/* Look for a LEFT auto-hide taskbar */
- abd.uEdge = ABE_LEFT;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
- if (hwndAutoHide != NULL)
+ if (winTaskbarOnScreenEdge(ABE_LEFT, pScreenInfo))
{
winDebug ("winAdjustForAutoHide - Found LEFT auto-hide taskbar\n");
prcWorkArea->left += 1;
}
/* Look for a BOTTOM auto-hide taskbar */
- abd.uEdge = ABE_BOTTOM;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
- if (hwndAutoHide != NULL)
+ if (winTaskbarOnScreenEdge(ABE_BOTTOM, pScreenInfo))
{
winDebug ("winAdjustForAutoHide - Found BOTTOM auto-hide taskbar\n");
prcWorkArea->bottom -= 1;
}
/* Look for a RIGHT auto-hide taskbar */
- abd.uEdge = ABE_RIGHT;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
- if (hwndAutoHide != NULL)
+ if (winTaskbarOnScreenEdge(ABE_RIGHT, pScreenInfo))
{
winDebug ("winAdjustForAutoHide - Found RIGHT auto-hide taskbar\n");
prcWorkArea->right -= 1;
@@ -638,15 +671,6 @@ winAdjustForAutoHide (RECT *prcWorkArea)
winDebug ("winAdjustForAutoHide - Adjusted WorkArea: %d %d %d %d\n",
(int) prcWorkArea->top, (int) prcWorkArea->left,
(int) prcWorkArea->bottom, (int) prcWorkArea->right);
-
-#if 0
- /* Obtain the task bar window dimensions */
- abd.hWnd = hwndAutoHide;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETTASKBARPOS, &abd);
- winDebug ("hwndAutoHide %08x abd.hWnd %08x %d %d %d %d\n",
- hwndAutoHide, abd.hWnd,
- abd.rc.top, abd.rc.left, abd.rc.bottom, abd.rc.right);
-#endif
return TRUE;
}
diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c
index f5187571d..e11a71248 100644
--- a/xorg-server/hw/xwin/winkeybd.c
+++ b/xorg-server/hw/xwin/winkeybd.c
@@ -297,6 +297,29 @@ winRestoreModeKeyStates (void)
* have a logical XOR operator, so we use a macro instead.
*/
+ {
+ /* consider modifer keys */
+
+ BOOL ctrl = (GetAsyncKeyState (VK_CONTROL) < 0);
+ BOOL shift = (GetAsyncKeyState (VK_SHIFT) < 0);
+ BOOL alt = (GetAsyncKeyState (VK_LMENU) < 0);
+ BOOL altgr = (GetAsyncKeyState (VK_RMENU) < 0);
+
+ if (ctrl && altgr) ctrl = FALSE;
+
+ if (WIN_XOR (internalKeyStates & ControlMask, ctrl))
+ winSendKeyEvent (KEY_LCtrl, ctrl);
+
+ if (WIN_XOR (internalKeyStates & ShiftMask, shift))
+ winSendKeyEvent (KEY_ShiftL, shift);
+
+ if (WIN_XOR (internalKeyStates & Mod1Mask, alt))
+ winSendKeyEvent (KEY_Alt, alt);
+
+ if (WIN_XOR (internalKeyStates & Mod5Mask, altgr))
+ winSendKeyEvent (KEY_AltLang, altgr);
+ }
+
/* Has the key state changed? */
dwKeyState = GetKeyState (VK_NUMLOCK) & 0x0001;
if (WIN_XOR (internalKeyStates & NumLockMask, dwKeyState))
diff --git a/xorg-server/hw/xwin/winmonitors.c b/xorg-server/hw/xwin/winmonitors.c
index 1a7c35990..a253afc61 100644
--- a/xorg-server/hw/xwin/winmonitors.c
+++ b/xorg-server/hw/xwin/winmonitors.c
@@ -53,6 +53,7 @@ wBOOL CALLBACK getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _d
data->monitorOffsetY = rect->top;
data->monitorHeight = rect->bottom - rect->top;
data->monitorWidth = rect->right - rect->left;
+ data->monitorHandle = hMonitor;
return FALSE;
}
return TRUE;
diff --git a/xorg-server/hw/xwin/winmonitors.h b/xorg-server/hw/xwin/winmonitors.h
index 180566b00..5f255b0ce 100644
--- a/xorg-server/hw/xwin/winmonitors.h
+++ b/xorg-server/hw/xwin/winmonitors.h
@@ -9,6 +9,7 @@ struct GetMonitorInfoData {
int monitorOffsetY;
int monitorHeight;
int monitorWidth;
+ HMONITOR monitorHandle;
};
Bool QueryMonitor(int index, struct GetMonitorInfoData *data);
diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c
index be777664d..5a8a38ac4 100644
--- a/xorg-server/hw/xwin/winmultiwindowwm.c
+++ b/xorg-server/hw/xwin/winmultiwindowwm.c
@@ -67,6 +67,9 @@ typedef int pid_t;
#include "windowstr.h"
#include "winmultiwindowclass.h"
+#include <shlwapi.h>
+#include "taskbar.h"
+
#ifdef XWIN_MULTIWINDOWEXTWM
#define _WINDOWSWM_SERVER_
#include <X11/extensions/windowswmstr.h>
@@ -215,6 +218,10 @@ static pthread_t g_winMultiWindowXMsgProcThread;
static Bool g_shutdown = FALSE;
static Bool redirectError = FALSE;
static Bool g_fAnotherWMRunning = FALSE;
+static HMODULE g_hmodShell32Dll = NULL;
+static HMODULE g_hmodOle32Dll = NULL;
+static SHGETPROPERTYSTOREFORWINDOWPROC g_pSHGetPropertyStoreForWindow = NULL;
+static PROPVARIANTCLEARPROC g_pPropVariantClear = NULL;
/*
* PushMessage - Push a message onto the queue
@@ -1657,12 +1664,26 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle)
if (XGetClassHint(pDisplay, iWindow, &class_hint))
{
char *window_name = 0;
+ char *application_id = 0;
XFetchName(pDisplay, iWindow, &window_name);
style = winOverrideStyle(class_hint.res_name, class_hint.res_class, window_name);
+#define APPLICATION_ID_FORMAT "%s.vcxsrv.%s"
+#define APPLICATION_ID_UNKNOWN "unknown"
+ if (class_hint.res_class)
+ {
+ asprintf (&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, class_hint.res_class);
+ }
+ else
+ {
+ asprintf (&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, APPLICATION_ID_UNKNOWN);
+ }
+ winSetAppID (hWnd, application_id);
+
if (class_hint.res_name) XFree(class_hint.res_name);
if (class_hint.res_class) XFree(class_hint.res_class);
+ if (application_id) free(application_id);
if (window_name) XFree(window_name);
}
else
@@ -1773,3 +1794,100 @@ winUpdateWindowPosition (HWND hWnd, Bool reshape, HWND *zstyle)
winUpdateRgnMultiWindow(pWin);
}
}
+
+void
+winTaskbarInit (void)
+{
+ /*
+ Load libraries and get function pointers to SHGetPropertyStoreForWindow
+ and PropVariantClear for winSetAppID()
+ */
+
+ /*
+ SHGetPropertyStoreForWindow is only supported since Windows 7. On previous
+ versions the pointer will be NULL and taskbar grouping is not supported.
+ winSetAppID() will do nothing in this case.
+ */
+ g_hmodShell32Dll = LoadLibrary ("shell32.dll");
+ if (g_hmodShell32Dll == NULL)
+ {
+ ErrorF ("winTaskbarInit - Could not load shell32.dll\n");
+ return;
+ }
+
+ g_pSHGetPropertyStoreForWindow = (SHGETPROPERTYSTOREFORWINDOWPROC) GetProcAddress (g_hmodShell32Dll, "SHGetPropertyStoreForWindow");
+ if (g_pSHGetPropertyStoreForWindow == NULL)
+ {
+ ErrorF ("winTaskbarInit - Could not get SHGetPropertyStoreForWindow address\n");
+ return;
+ }
+
+ /*
+ PropVariantClear is supported since NT4, but we have no propidl.h to
+ provide a prototype for it
+ */
+ g_hmodOle32Dll = LoadLibrary ("ole32.dll");
+ if (g_hmodOle32Dll == NULL)
+ {
+ ErrorF ("winTaskbarInit - Could not load ole32.dll\n");
+ return;
+ }
+
+ g_pPropVariantClear = (PROPVARIANTCLEARPROC) GetProcAddress (g_hmodOle32Dll, "PropVariantClear");
+ if (g_pPropVariantClear == NULL)
+ {
+ ErrorF ("winTaskbarInit - Could not get g_pPropVariantClear address\n");
+ return;
+ }
+}
+
+void
+winTaskbarDestroy (void)
+{
+ if (g_hmodOle32Dll != NULL)
+ {
+ FreeLibrary (g_hmodOle32Dll);
+ g_hmodOle32Dll = NULL;
+ g_pPropVariantClear = NULL;
+ }
+ if (g_hmodShell32Dll != NULL)
+ {
+ FreeLibrary (g_hmodShell32Dll);
+ g_hmodShell32Dll = NULL;
+ g_pSHGetPropertyStoreForWindow = NULL;
+ }
+}
+
+void
+winSetAppID (HWND hWnd, const char* AppID)
+{
+ PROPVARIANT pv;
+ IPropertyStore *pps = NULL;
+ HRESULT hr;
+
+ if (g_pSHGetPropertyStoreForWindow == NULL ||
+ g_pPropVariantClear == NULL)
+ {
+ return;
+ }
+
+ winDebug ("winSetAppID - hwnd 0x%08x appid '%s'\n", hWnd, AppID);
+
+ hr = g_pSHGetPropertyStoreForWindow (hWnd, &IID_IPropertyStore, (void**)&pps);
+ if(SUCCEEDED(hr) && pps)
+ {
+ memset(&pv, 0, sizeof(PROPVARIANT));
+ if(AppID)
+ {
+ pv.vt = VT_LPWSTR;
+ hr = SHStrDupA(AppID, &pv.pwszVal);
+ }
+
+ if(SUCCEEDED(hr))
+ {
+ hr = pps->lpVtbl->SetValue(pps, &PKEY_AppUserModel_ID, &pv);
+ g_pPropVariantClear(&pv);
+ }
+ pps->lpVtbl->Release(pps);
+ }
+}
diff --git a/xorg-server/hw/xwin/winmultiwindowwndproc.c b/xorg-server/hw/xwin/winmultiwindowwndproc.c
index b5c7786b0..ff66b602f 100644
--- a/xorg-server/hw/xwin/winmultiwindowwndproc.c
+++ b/xorg-server/hw/xwin/winmultiwindowwndproc.c
@@ -332,6 +332,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
static Bool s_fTracking = FALSE;
Bool needRestack = FALSE;
LRESULT ret;
+ static Bool hasEnteredSizeMove = FALSE;
winDebugWin32Message("winTopLevelWindowProc", hwnd, message, wParam, lParam);
@@ -825,6 +826,9 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
break;
case WM_CLOSE:
+ /* Remove property AppUserModelID */
+ winSetAppID (hwnd, NULL);
+
/* Branch on if the window was killed in X already */
if (pWinPriv->fXKilled)
{
@@ -861,7 +865,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
case WM_MOVE:
/* Adjust the X Window to the moved Windows window */
- winAdjustXWindow (pWin, hwnd);
+ if (!hasEnteredSizeMove) winAdjustXWindow (pWin, hwnd);
+ /* else: Wait for WM_EXITSIZEMOVE */
return 0;
case WM_SHOWWINDOW:
@@ -940,6 +945,26 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
/* for applications like xterm */
return ValidateSizing (hwnd, pWin, wParam, lParam);
+ case WM_WINDOWPOSCHANGING:
+ {
+ /*
+ When window is moved or resized, force it to be redrawn, so that
+ any OpenGL content is re-drawn correctly, rather than copying bits
+ (which seem to be wrong, either because we are copying the wrong
+ window in the window heirarchy, or because we don't have the bits
+ drawn by OpenGL at all)
+
+ XXX: really this should check if any child has fWglUsed set, but
+ that might be expensive to check....
+ */
+ if (g_fNativeGl)
+ {
+ LPWINDOWPOS pWinPos = (LPWINDOWPOS)lParam;
+ pWinPos->flags |= SWP_NOCOPYBITS;
+ }
+ }
+ break;
+
case WM_WINDOWPOSCHANGED:
{
LPWINDOWPOS pWinPos = (LPWINDOWPOS) lParam;
@@ -1000,6 +1025,16 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
*/
break;
+ case WM_ENTERSIZEMOVE:
+ hasEnteredSizeMove = TRUE;
+ return 0;
+
+ case WM_EXITSIZEMOVE:
+ /* Adjust the X Window to the moved Windows window */
+ hasEnteredSizeMove = FALSE;
+ winAdjustXWindow (pWin, hwnd);
+ return 0;
+
case WM_SIZE:
/* see dix/window.c */
#ifdef WINDBG
@@ -1024,9 +1059,13 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
(int)(GetTickCount ()));
}
#endif
- /* Adjust the X Window to the moved Windows window */
- winAdjustXWindow (pWin, hwnd);
- if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow();
+ if (!hasEnteredSizeMove)
+ {
+ /* Adjust the X Window to the moved Windows window */
+ winAdjustXWindow (pWin, hwnd);
+ if (wParam == SIZE_MINIMIZED) winReorderWindowsMultiWindow();
+ }
+ /* else: wait for WM_EXITSIZEMOVE */
return 0; /* end of WM_SIZE handler */
case WM_STYLECHANGED:
diff --git a/xorg-server/hw/xwin/winprocarg.c b/xorg-server/hw/xwin/winprocarg.c
index c83e1873c..1418f78bc 100644
--- a/xorg-server/hw/xwin/winprocarg.c
+++ b/xorg-server/hw/xwin/winprocarg.c
@@ -112,6 +112,7 @@ winInitializeScreenDefaults(void)
}
defaultScreenInfo.iMonitor = 1;
+ defaultScreenInfo.hMonitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY);
defaultScreenInfo.dwWidth = dwWidth;
defaultScreenInfo.dwHeight = dwHeight;
defaultScreenInfo.dwUserWidth = dwWidth;
@@ -142,7 +143,7 @@ winInitializeScreenDefaults(void)
#endif
defaultScreenInfo.fMultipleMonitors = FALSE;
defaultScreenInfo.fLessPointer = FALSE;
- defaultScreenInfo.iResizeMode = notAllowed;
+ defaultScreenInfo.iResizeMode = resizeWithRandr;
defaultScreenInfo.fNoTrayIcon = FALSE;
defaultScreenInfo.iE3BTimeout = WIN_E3B_DEFAULT;
defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL;
@@ -333,6 +334,7 @@ ddxProcessArgument (int argc, char *argv[], int i)
g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE;
g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE;
g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
+ g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle;
g_ScreenInfo[nScreenNum].dwWidth = data.monitorWidth;
g_ScreenInfo[nScreenNum].dwHeight = data.monitorHeight;
g_ScreenInfo[nScreenNum].dwUserWidth = data.monitorWidth;
@@ -385,6 +387,7 @@ ddxProcessArgument (int argc, char *argv[], int i)
} else if (data.bMonitorSpecifiedExists == TRUE)
{
g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
+ g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle;
g_ScreenInfo[nScreenNum].dwInitialX += data.monitorOffsetX;
g_ScreenInfo[nScreenNum].dwInitialY += data.monitorOffsetY;
}
@@ -414,6 +417,7 @@ ddxProcessArgument (int argc, char *argv[], int i)
winDebug ("ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor);
g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE;
g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
+ g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle;
g_ScreenInfo[nScreenNum].dwInitialX = data.monitorOffsetX;
g_ScreenInfo[nScreenNum].dwInitialY = data.monitorOffsetY;
}
diff --git a/xorg-server/hw/xwin/winwindow.h b/xorg-server/hw/xwin/winwindow.h
index e33319867..7721f1411 100644
--- a/xorg-server/hw/xwin/winwindow.h
+++ b/xorg-server/hw/xwin/winwindow.h
@@ -157,6 +157,14 @@ winDeinitMultiWindowWM (void);
void
winMinimizeWindow (Window id);
+void
+winTaskbarInit (void);
+
+void
+winTaskbarDestroy (void);
+
+void
+winSetAppID (HWND hWnd, const char* AppID);
/*
* winmultiwindowicons.c