[Xorg-commit] xc/programs/Xserver/hw/xwin X.ico,1.1,1.1.6.1 win.h,1.1.4.1.2.3,1.1.4.1.2.4 winmultiwindowclass.c,1.1,1.1.6.1 winwin32rootless.c,1.1.2.2,1.1.2.3 winwin32rootlesswndproc.c,1.1.2.2,1.1.2.3

Kensuke Matsuzaki xorg-commit at pdx.freedesktop.org
Sun Dec 21 09:26:12 EET 2003


Committed by: zakki

Update of /cvs/xorg/xc/programs/Xserver/hw/xwin
In directory pdx:/tmp/cvs-serv22750

Modified Files:
      Tag: CYGWIN
	X.ico win.h winmultiwindowclass.c winwin32rootless.c 
	winwin32rootlesswndproc.c 
Log Message:
Remake atom for each server generation.


Index: X.ico
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/X.ico,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -d -r1.1 -r1.1.6.1
Binary files /tmp/cvsq6ZAjD and /tmp/cvsakhfp6 differ

Index: win.h
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/win.h,v
retrieving revision 1.1.4.1.2.3
retrieving revision 1.1.4.1.2.4
diff -u -d -r1.1.4.1.2.3 -r1.1.4.1.2.4
--- win.h	18 Dec 2003 01:32:03 -0000	1.1.4.1.2.3
+++ win.h	21 Dec 2003 07:26:10 -0000	1.1.4.1.2.4
@@ -257,6 +257,16 @@
 /* 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

Index: winmultiwindowclass.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winmultiwindowclass.c,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -d -r1.1 -r1.1.6.1
--- winmultiwindowclass.c	25 Nov 2003 19:28:56 -0000	1.1
+++ winmultiwindowclass.c	21 Dec 2003 07:26:10 -0000	1.1.6.1
@@ -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 @@
   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 @@
   *res_role = NULL;
   while (prop)
     {
-      if (prop->propertyName == atmWmWindowRole
+      if (prop->propertyName == AtmWmWindowRole ()
 	  && prop->type == XA_STRING
 	  && prop->format == 8
 	  && prop->data)

Index: winwin32rootless.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootless.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- winwin32rootless.c	18 Dec 2003 01:32:03 -0000	1.1.2.2
+++ winwin32rootless.c	21 Dec 2003 07:26:10 -0000	1.1.2.3
@@ -686,14 +686,19 @@
 	  
 	  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 @@
   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 @@
       
       InvalidateRect (pRLWinPriv->hWnd, &rcDmg, FALSE);
     }
-#if CYGMULTIWINDOW_DEBUG || TRUE
+#if CYGMULTIWINDOW_DEBUG
   ErrorF ("winWin32RootlessCopyWindow - done\n");
 #endif
 }

Index: winwin32rootlesswndproc.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootlesswndproc.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- winwin32rootlesswndproc.c	18 Dec 2003 01:32:03 -0000	1.1.2.2
+++ winwin32rootlesswndproc.c	21 Dec 2003 07:26:10 -0000	1.1.2.3
@@ -63,6 +63,14 @@
 
 
 /*
+ * 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 @@
 
   struct _Window	*pwin;
   struct _Property	*prop;  
-  static Atom		atmWindowsWmRaiseOnClick = 0;
   WindowPtr		pRoot = GetCurrentRootWindow ();
 
   if (!pWin)
@@ -295,11 +302,6 @@
       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 @@
 
   while (prop)
     {
-      if (prop->propertyName == atmWindowsWmRaiseOnClick
+      if (prop->propertyName == AtmWindowsWmRaiseOnClick ()
 	  && prop->type == XA_INTEGER
 	  && prop->format == 32)
 	{
@@ -340,7 +342,6 @@
 
   struct _Window	*pwin;
   struct _Property	*prop;
-  static Atom		atmWindowsWMMouseActivate = 0;
   WindowPtr		pRoot = GetCurrentRootWindow ();
 
   if (!pWin)
@@ -349,11 +350,6 @@
       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 @@
 
   while (prop)
     {
-      if (prop->propertyName == atmWindowsWMMouseActivate
+      if (prop->propertyName == AtmWindowsWMMouseActivate ()
 	  && prop->type == XA_INTEGER
 	  && prop->format == 32)
 	{
@@ -395,8 +391,7 @@
 {
 
   struct _Window	*pwin;
-  struct _Property	*prop;  
-  static Atom		atmWindowsWMClientWindow = 0;
+  struct _Property	*prop;
 
   if (!pWin)
     {
@@ -404,11 +399,6 @@
       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 @@
 
   while (prop)
     {
-      if (prop->propertyName == atmWindowsWMClientWindow
+      if (prop->propertyName == AtmWindowsWMClientWindow ()
 	  && prop->type == XA_INTEGER
 	  && prop->format == 32)
 	{





More information about the xorg-commit mailing list