summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/xwin/X.icobin4710 -> 6966 bytes
-rw-r--r--hw/xwin/win.h10
-rwxr-xr-xhw/xwin/winmultiwindowclass.c15
-rwxr-xr-xhw/xwin/winwin32rootless.c13
-rwxr-xr-xhw/xwin/winwin32rootlesswndproc.c34
5 files changed, 40 insertions, 32 deletions
diff --git a/hw/xwin/X.ico b/hw/xwin/X.ico
index 26e2cf947..5d4070056 100644
--- a/hw/xwin/X.ico
+++ b/hw/xwin/X.ico
Binary files differ
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index aae6fa1cc..c5ca6549d 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -257,6 +257,16 @@ if (fDebugProcMsg) \
/* We use xor this macro for detecting toggle key state changes */
#define WIN_XOR(a,b) ((!(a) && (b)) || ((a) && !(b)))
+#define DEFINE_ATOM_HELPER(func,atom_name) \
+static Atom func (void) { \
+ static int generation; \
+ static Atom atom; \
+ if (generation != serverGeneration) { \
+ generation = serverGeneration; \
+ atom = MakeAtom (atom_name, strlen (atom_name), TRUE); \
+ } \
+ return atom; \
+}
/*
* Typedefs for engine dependent function pointers
diff --git a/hw/xwin/winmultiwindowclass.c b/hw/xwin/winmultiwindowclass.c
index 21be64977..d92d49d7e 100755
--- a/hw/xwin/winmultiwindowclass.c
+++ b/hw/xwin/winmultiwindowclass.c
@@ -33,6 +33,14 @@
#include "propertyst.h"
#include "windowstr.h"
#include "winmultiwindowclass.h"
+#include "win.h"
+
+/*
+ * Local function
+ */
+
+DEFINE_ATOM_HELPER(AtmWmWindowRole, "WM_WINDOW_ROLE")
+
int
winMultiWindowGetClassHint (WindowPtr pWin, char **res_name, char **res_class)
@@ -148,15 +156,10 @@ winMultiWindowGetWindowRole (WindowPtr pWin, char **res_role)
struct _Window *pwin;
struct _Property *prop;
int len_role;
- static Atom atmWmWindowRole = 0;
if (!pWin || !res_role)
return 0;
- /* Initialize the window role atom, not in XAtom.h */
- if (!atmWmWindowRole)
- atmWmWindowRole = MakeAtom ("WM_WINDOW_ROLE", 14, 1);
-
pwin = (struct _Window*) pWin;
if (pwin->optional)
@@ -167,7 +170,7 @@ winMultiWindowGetWindowRole (WindowPtr pWin, char **res_role)
*res_role = NULL;
while (prop)
{
- if (prop->propertyName == atmWmWindowRole
+ if (prop->propertyName == AtmWmWindowRole ()
&& prop->type == XA_STRING
&& prop->format == 8
&& prop->data)
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index 096b31584..d076c005c 100755
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -686,14 +686,19 @@ winWin32RootlessStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesP
pRLWinPriv->fResized = FALSE;
}
+#if CYGMULTIWINDOW_DEBUG
+ ErrorF ("winWin32RootlessStartDrawing - 0x%08x %d\n",
+ (unsigned int)pRLWinPriv->pfb, (unsigned int)dibsection.dsBm.bmWidthBytes);
+#endif
}
else
{
ErrorF ("winWin32RootlessStartDrawing - Already window was destoroyed \n");
}
#if CYGMULTIWINDOW_DEBUG
- ErrorF ("winWin32RootlessStartDrawing - 0x%08x %d\n",
- (unsigned int)pRLWinPriv->pfb, (unsigned int)dibsection.dsBm.bmWidthBytes);
+ ErrorF ("winWin32RootlessStartDrawing - done (0x08x) 0x%08x %d\n",
+ (int) pRLWinPriv,
+ (unsigned int)pRLWinPriv->pfb, (unsigned int)pRLWinPriv->dwWidthBytes);
#endif
*pixelData = pRLWinPriv->pfb;
*bytesPerRow = pRLWinPriv->dwWidthBytes;
@@ -870,7 +875,7 @@ winWin32RootlessCopyWindow (RootlessFrameID wid, int nDstRects, const BoxRec *pD
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
const BoxRec *pEnd;
RECT rcDmg;
-#if CYGMULTIWINDOW_DEBUG || TRUE
+#if CYGMULTIWINDOW_DEBUG
ErrorF ("winWin32RootlessCopyWindow (%08x, %d, %08x, %d, %d)\n",
(int) pRLWinPriv, nDstRects, (int) pDstRects, nDx, nDy);
#endif
@@ -904,7 +909,7 @@ winWin32RootlessCopyWindow (RootlessFrameID wid, int nDstRects, const BoxRec *pD
InvalidateRect (pRLWinPriv->hWnd, &rcDmg, FALSE);
}
-#if CYGMULTIWINDOW_DEBUG || TRUE
+#if CYGMULTIWINDOW_DEBUG
ErrorF ("winWin32RootlessCopyWindow - done\n");
#endif
}
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index b4a6e5c39..b67b14315 100755
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -63,6 +63,14 @@ static UINT_PTR g_uipMousePollingTimerID = 0;
/*
+ * Local function
+ */
+
+DEFINE_ATOM_HELPER(AtmWindowsWmRaiseOnClick, WINDOWSWM_RAISE_ON_CLICK)
+DEFINE_ATOM_HELPER(AtmWindowsWMMouseActivate, WINDOWSWM_MOUSE_ACTIVATE)
+DEFINE_ATOM_HELPER(AtmWindowsWMClientWindow, WINDOWSWM_CLIENT_WINDOW)
+
+/*
* ConstrainSize - Taken from TWM sources - Respects hints for sizing
*/
#define makemult(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) )
@@ -286,7 +294,6 @@ IsRaiseOnClick (WindowPtr pWin)
struct _Window *pwin;
struct _Property *prop;
- static Atom atmWindowsWmRaiseOnClick = 0;
WindowPtr pRoot = GetCurrentRootWindow ();
if (!pWin)
@@ -295,11 +302,6 @@ IsRaiseOnClick (WindowPtr pWin)
return 0;
}
- if (!atmWindowsWmRaiseOnClick)
- atmWindowsWmRaiseOnClick = MakeAtom (WINDOWSWM_RAISE_ON_CLICK,
- strlen(WINDOWSWM_RAISE_ON_CLICK),
- 1);
-
pwin = (struct _Window*) pWin;
if (pwin->optional)
@@ -309,7 +311,7 @@ IsRaiseOnClick (WindowPtr pWin)
while (prop)
{
- if (prop->propertyName == atmWindowsWmRaiseOnClick
+ if (prop->propertyName == AtmWindowsWmRaiseOnClick ()
&& prop->type == XA_INTEGER
&& prop->format == 32)
{
@@ -340,7 +342,6 @@ IsMouseActive (WindowPtr pWin)
struct _Window *pwin;
struct _Property *prop;
- static Atom atmWindowsWMMouseActivate = 0;
WindowPtr pRoot = GetCurrentRootWindow ();
if (!pWin)
@@ -349,11 +350,6 @@ IsMouseActive (WindowPtr pWin)
return 0;
}
- if (!atmWindowsWMMouseActivate)
- atmWindowsWMMouseActivate = MakeAtom (WINDOWSWM_MOUSE_ACTIVATE,
- strlen(WINDOWSWM_MOUSE_ACTIVATE),
- 1);
-
pwin = (struct _Window*) pWin;
if (pwin->optional)
@@ -363,7 +359,7 @@ IsMouseActive (WindowPtr pWin)
while (prop)
{
- if (prop->propertyName == atmWindowsWMMouseActivate
+ if (prop->propertyName == AtmWindowsWMMouseActivate ()
&& prop->type == XA_INTEGER
&& prop->format == 32)
{
@@ -395,8 +391,7 @@ WWMPropClientWindow (WindowPtr pWin)
{
struct _Window *pwin;
- struct _Property *prop;
- static Atom atmWindowsWMClientWindow = 0;
+ struct _Property *prop;
if (!pWin)
{
@@ -404,11 +399,6 @@ WWMPropClientWindow (WindowPtr pWin)
return 0;
}
- if (!atmWindowsWMClientWindow)
- atmWindowsWMClientWindow = MakeAtom (WINDOWSWM_CLIENT_WINDOW,
- strlen(WINDOWSWM_CLIENT_WINDOW),
- 1);
-
pwin = (struct _Window*) pWin;
if (pwin->optional)
@@ -418,7 +408,7 @@ WWMPropClientWindow (WindowPtr pWin)
while (prop)
{
- if (prop->propertyName == atmWindowsWMClientWindow
+ if (prop->propertyName == AtmWindowsWMClientWindow ()
&& prop->type == XA_INTEGER
&& prop->format == 32)
{