[Xorg-commit] xc/programs/Xserver/hw/xwin winmultiwindowwindow.c,1.1.4.1.2.2,1.1.4.1.2.3 winwin32rootlesswindow.c,1.1.2.2,1.1.2.3 winwin32rootlesswndproc.c,1.1.2.3,1.1.2.4

Kensuke Matsuzaki xorg-commit at pdx.freedesktop.org
Mon Dec 29 07:56:46 EET 2003


Committed by: zakki

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

Modified Files:
      Tag: CYGWIN
	winmultiwindowwindow.c winwin32rootlesswindow.c 
	winwin32rootlesswndproc.c 
Log Message:
Fix the problem that XWin crashes when multiple XWin processes exist.
Cleanup IsMouseActive and IsRaiseOnClick.


Index: winmultiwindowwindow.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winmultiwindowwindow.c,v
retrieving revision 1.1.4.1.2.2
retrieving revision 1.1.4.1.2.3
diff -u -d -r1.1.4.1.2.2 -r1.1.4.1.2.3
--- winmultiwindowwindow.c	9 Dec 2003 01:37:16 -0000	1.1.4.1.2.2
+++ winmultiwindowwindow.c	29 Dec 2003 05:56:44 -0000	1.1.4.1.2.3
@@ -798,6 +798,8 @@
   HWND hwnd = NULL;
   WindowPtr pWin = NULL;
   WindowPtr pWinSib = NULL;
+  DWORD dwCurrentProcessID = GetCurrentProcessId ();
+  DWORD dwWindowProcessID = 0;
 
 #if CYGMULTIWINDOW_DEBUG
   ErrorF ("winOrderWindowsMultiWindow\n");
@@ -814,7 +816,10 @@
 
       while (hwnd)
 	{
-	  if (GetProp (hwnd, WIN_WINDOW_PROP))
+	  GetWindowThreadProcessId (hwnd, &dwWindowProcessID);
+
+	  if ((dwWindowProcessID == dwCurrentProcessID)
+	      && GetProp (hwnd, WIN_WINDOW_PROP))
 	    {
 	      pWinSib = pWin;
 	      pWin = GetProp (hwnd, WIN_WINDOW_PROP);

Index: winwin32rootlesswindow.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootlesswindow.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
--- winwin32rootlesswindow.c	18 Dec 2003 01:32:03 -0000	1.1.2.2
+++ winwin32rootlesswindow.c	29 Dec 2003 05:56:44 -0000	1.1.2.3
@@ -52,6 +52,8 @@
   HWND hwnd = NULL;
   win32RootlessWindowPtr pRLWin = NULL;
   win32RootlessWindowPtr pRLWinSib = NULL;
+  DWORD dwCurrentProcessID = GetCurrentProcessId ();
+  DWORD dwWindowProcessID = 0;
 
 #if CYGMULTIWINDOW_DEBUG && FALSE
   ErrorF ("winWin32RootlessReorderWindows\n");
@@ -68,7 +70,10 @@
 
       while (hwnd)
 	{
-	  if (GetProp (hwnd, WIN_WINDOW_PROP))
+	  GetWindowThreadProcessId (hwnd, &dwWindowProcessID);
+
+	  if ((dwWindowProcessID == dwCurrentProcessID)
+	      && GetProp (hwnd, WIN_WINDOW_PROP))
 	    {
 	      pRLWinSib = pRLWin;
 	      pRLWin = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP);

Index: winwin32rootlesswndproc.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootlesswndproc.c,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- winwin32rootlesswndproc.c	21 Dec 2003 07:26:10 -0000	1.1.2.3
+++ winwin32rootlesswndproc.c	29 Dec 2003 05:56:44 -0000	1.1.2.4
@@ -44,6 +44,8 @@
  */
 
 #define MOUSE_POLLING_INTERVAL		500
+#define MOUSE_ACTIVATE_DEFAULT		TRUE
+#define RAISE_ON_CLICK_DEFAULT		FALSE
 
 
 
@@ -298,8 +300,9 @@
 
   if (!pWin)
     {
-      ErrorF ("IsRaiseOnClick - pWin was NULL\n");
-      return 0;
+      ErrorF ("IsRaiseOnClick - no prop use default value:%d\n",
+	      RAISE_ON_CLICK_DEFAULT);
+      return RAISE_ON_CLICK_DEFAULT;
     } 
 
   pwin = (struct _Window*) pWin;
@@ -323,11 +326,15 @@
 
   if (pWin != pRoot)
     {
-      IsRaiseOnClick (pRoot);
+      return IsRaiseOnClick (pRoot);
     }
   else
     {
-      return 0;
+#if CYGMULTIWINDOW_DEBUG
+      ErrorF ("IsRaiseOnClick - no prop use default value:%d\n",
+	      RAISE_ON_CLICK_DEFAULT);
+#endif
+      return RAISE_ON_CLICK_DEFAULT;
     }
 }
 
@@ -346,8 +353,9 @@
 
   if (!pWin)
     {
-      ErrorF ("IsMouseActive - pWin was NULL\n");
-      return 0;
+      ErrorF ("IsMouseActive - pWin was NULL use default value:%d\n",
+	      MOUSE_ACTIVATE_DEFAULT);
+      return MOUSE_ACTIVATE_DEFAULT;
     } 
 
   pwin = (struct _Window*) pWin;
@@ -371,14 +379,16 @@
 
   if (pWin != pRoot)
     {
-      IsMouseActive (pRoot);
+      return IsMouseActive (pRoot);
     }
   else
     {
-      return 0;
+#if CYGMULTIWINDOW_DEBUG
+      ErrorF ("IsMouseActive - no prop use default value:%d\n",
+	      MOUSE_ACTIVATE_DEFAULT);
+#endif
+      return MOUSE_ACTIVATE_DEFAULT;
     }
-  
-  return 0;
 }
 
 





More information about the xorg-commit mailing list