aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmultiwindowwm.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-11-29 09:05:13 +0100
committermarha <marha@users.sourceforge.net>2012-11-29 09:05:49 +0100
commit0831039c0d449a3b5874c12ee365a8d5d2be7b8c (patch)
tree4edb707b79145f619fefc18c2359659ca660612f /xorg-server/hw/xwin/winmultiwindowwm.c
parent6bc629065956c81d836bbdb12f5f580d8a3db8e5 (diff)
parentd2d73da59e64acdc4718e4e6790a69d967bee875 (diff)
downloadvcxsrv-0831039c0d449a3b5874c12ee365a8d5d2be7b8c.tar.gz
vcxsrv-0831039c0d449a3b5874c12ee365a8d5d2be7b8c.tar.bz2
vcxsrv-0831039c0d449a3b5874c12ee365a8d5d2be7b8c.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig xserver mesa git update 29 nov 2012 Conflicts: xorg-server/dix/dispatch.c xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/ddraw.h xorg-server/hw/xwin/glx/indirect.c xorg-server/hw/xwin/winclipboardthread.c xorg-server/hw/xwin/winclipboardxevents.c xorg-server/hw/xwin/winengine.c xorg-server/hw/xwin/winerror.c xorg-server/hw/xwin/winglobals.c xorg-server/hw/xwin/winkeybd.c xorg-server/hw/xwin/winmultiwindowwm.c xorg-server/hw/xwin/winmultiwindowwndproc.c xorg-server/hw/xwin/winprocarg.c xorg-server/hw/xwin/winwin32rootless.c xorg-server/hw/xwin/winwindow.h xorg-server/os/osinit.c xorg-server/os/utils.c
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowwm.c')
-rwxr-xr-x[-rw-r--r--]xorg-server/hw/xwin/winmultiwindowwm.c62
1 files changed, 49 insertions, 13 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c
index 961f2fd8d..424da2bfa 100644..100755
--- a/xorg-server/hw/xwin/winmultiwindowwm.c
+++ b/xorg-server/hw/xwin/winmultiwindowwm.c
@@ -1473,6 +1473,7 @@ winDeinitMultiWindowWM(void)
#define HINT_NOMAXIMIZE (1L<<4)
#define HINT_NOMINIMIZE (1L<<5)
#define HINT_NOSYSMENU (1L<<6)
+#define HINT_SKIPTASKBAR (1L<<7)
/* These two are used on their own */
#define HINT_MAX (1L<<0)
#define HINT_MIN (1L<<1)
@@ -1481,12 +1482,14 @@ static void
winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
{
static Atom windowState, motif_wm_hints, windowType;
- static Atom hiddenState, fullscreenState, belowState, aboveState;
+ static Atom hiddenState, fullscreenState, belowState, aboveState,
+ skiptaskbarState;
static Atom dockWindow;
static int generation;
Atom type, *pAtom = NULL;
int format;
- unsigned long hint = 0, maxmin = 0, style, nitems = 0, left = 0;
+ unsigned long hint = 0, maxmin = 0, nitems = 0, left = 0;
+ unsigned long style, exStyle;
WindowPtr pWin = GetProp (hWnd, WIN_WINDOW_PROP);
MwmHints *mwm_hint = NULL;
WinXSizeHints SizeHints;
@@ -1507,6 +1510,8 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False);
aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False);
dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False);
+ skiptaskbarState =
+ XInternAtom(pDisplay, "_NET_WM_STATE_SKIP_TASKBAR", False);
}
if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L,
@@ -1514,6 +1519,8 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
&nitems, &left,
(unsigned char **) &pAtom) == Success) {
if (pAtom && nitems == 1) {
+ if (*pAtom == skiptaskbarState)
+ hint |= HINT_SKIPTASKBAR;
if (*pAtom == hiddenState)
maxmin |= HINT_MIN;
else if (*pAtom == fullscreenState)
@@ -1602,9 +1609,13 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
XFree(normal_hint);
}
- /* Override hint settings from above with settings from config file */
+ /*
+ Override hint settings from above with settings from config file and set
+ application id for grouping.
+ */
{
XClassHint class_hint = { 0, 0 };
+ char *application_id = 0;
if (XGetClassHint(pDisplay, iWindow, &class_hint)) {
char *window_name = 0;
@@ -1618,17 +1629,23 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
#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);
+ asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME,
+ class_hint.res_class);
}
else {
- asprintf (&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, APPLICATION_ID_UNKNOWN);
+ asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME,
+ APPLICATION_ID_UNKNOWN);
}
- winSetAppID (hWnd, application_id);
+ winSetAppUserModelID(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);
+ 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 {
style = STYLE_NONE;
@@ -1661,10 +1678,15 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
(hint & ~HINT_BORDER & ~HINT_CAPTION) | HINT_NOFRAME;
/* Now apply styles to window */
- style = GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */
- if (!hint) /* All on, but no resize of children is allowed */
+ style = GetWindowLongPtr(hWnd, GWL_STYLE);
+ if (!style)
+ return; /* GetWindowLongPointer returns 0 on failure, we hope this isn't a valid style */
+
+ style &= ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */
+
+ if (!(hint & ~HINT_SKIPTASKBAR)) /* No hints, default */
style = style | WS_CAPTION;
- else if (hint & HINT_NOFRAME) /* All off */
+ else if (hint & HINT_NOFRAME) /* No frame, no decorations */
style = style & ~WS_CAPTION & ~WS_SIZEBOX;
else
style = style | ((hint & HINT_BORDER) ? WS_BORDER : 0) |
@@ -1680,6 +1702,9 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
if (hint & HINT_NOSYSMENU)
style = style & ~WS_SYSMENU;
+ if (hint & HINT_SKIPTASKBAR)
+ style = style & ~WS_MINIMIZEBOX; /* window will become lost if minimized */
+
if (!IsWindow (hWnd))
{
ErrorF("Windows window 0x%x has become invalid, so returning without applying hints\n",hWnd);
@@ -1694,6 +1719,17 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle)
else
style|=WS_SIZEBOX;
SetWindowLongPtr(hWnd, GWL_STYLE, style);
+
+ exStyle = GetWindowLongPtr(hWnd, GWL_EXSTYLE);
+ if (hint & HINT_SKIPTASKBAR)
+ exStyle = (exStyle & ~WS_EX_APPWINDOW) | WS_EX_TOOLWINDOW;
+ else
+ exStyle = (exStyle & ~WS_EX_TOOLWINDOW) | WS_EX_APPWINDOW;
+ SetWindowLongPtr(hWnd, GWL_EXSTYLE, exStyle);
+
+ winDebug
+ ("winApplyHints: iWindow 0x%08x hints 0x%08x style 0x%08x exstyle 0x%08x\n",
+ iWindow, hint, style, exStyle);
}
void