[Xorg-commit] xc/programs/Xserver/hw/xwin winwin32rootless.c,1.1.2.4,1.1.2.5 winwin32rootlesswindow.c,1.1.2.3,1.1.2.4 winwindow.h,1.1.4.1.2.2,1.1.4.1.2.3

Kensuke Matsuzaki xorg-commit at pdx.freedesktop.org
Thu Jan 15 23:20:41 EET 2004


Committed by: zakki

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

Modified Files:
      Tag: CYGWIN
	winwin32rootless.c winwin32rootlesswindow.c winwindow.h 
Log Message:
Convert winwin32rootlesswindow.c's \r\n to \n.
Top level X window has own frame's HWND.


Index: winwin32rootless.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootless.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- winwin32rootless.c	6 Jan 2004 00:40:30 -0000	1.1.2.4
+++ winwin32rootless.c	15 Jan 2004 21:20:30 -0000	1.1.2.5
@@ -39,6 +39,7 @@
 #include "dixevents.h"
 #include "winmultiwindowclass.h"
 #include "winprefs.h"
+#include "Xatom.h"
 
 
 /*
@@ -52,6 +53,15 @@
 #define ULW_OPAQUE	0x00000004
 #define AC_SRC_ALPHA	0x01
 
+
+/*
+ * Local function
+ */
+
+DEFINE_ATOM_HELPER(AtmWindowsWmNativeHwnd, WINDOWSWM_NATIVE_HWND)
+static void
+winWin32RootlessSetNativeProperty (RootlessWindowPtr pFrame);
+
 /*
  * Global variables
  */
@@ -215,8 +225,8 @@
   Bool				fResult = TRUE;
   win32RootlessWindowPtr	pRLWinPriv;
   WNDCLASS			wc;
-  char                  	pszClass[CLASS_NAME_LENGTH], pszWindowID[12];
-  HICON                	 	hIcon;
+  char				pszClass[CLASS_NAME_LENGTH], pszWindowID[12];
+  HICON				hIcon;
   char				*res_name, *res_class, *res_role;
   static int			s_iWindowID = 0;
  
@@ -269,7 +279,7 @@
        * if not use the WM_CLASS information.
        * For further information see:
        * http://tronche.com/gui/x/icccm/sec-5.html
-       */ 
+       */
       if (winMultiWindowGetWindowRole (pFrame->win, &res_role) )
 	{
 	  strcat (pszClass, "-");
@@ -357,6 +367,9 @@
  }
 #endif
 #endif
+
+  winWin32RootlessSetNativeProperty (pFrame);
+
   return fResult;
 }
 
@@ -834,6 +847,8 @@
   pRLWinPriv->pFrame = pFrame;
   pRLWinPriv->fResized = TRUE;
 
+  DeleteProperty (oldWin, AtmWindowsWmNativeHwnd ());
+  winWin32RootlessSetNativeProperty (pFrame);
 #if CYGMULTIWINDOW_DEBUG
 #if 0
  {
@@ -933,3 +948,21 @@
   ErrorF ("winWin32RootlessCopyWindow - done\n");
 #endif
 }
+
+
+/*
+ * winWin32RootlessSetNativeProperty
+ */
+
+static void
+winWin32RootlessSetNativeProperty (RootlessWindowPtr pFrame)
+{
+  win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) pFrame->wid;
+  long lData;
+
+  /* FIXME: move this to WindowsWM extension */
+
+  lData = pRLWinPriv->hWnd;
+  ChangeWindowProperty (pFrame->win, AtmWindowsWmNativeHwnd (),
+			XA_INTEGER, 32, PropModeReplace, 1, &lData, TRUE);
+}

Index: winwin32rootlesswindow.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winwin32rootlesswindow.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
--- winwin32rootlesswindow.c	29 Dec 2003 05:56:44 -0000	1.1.2.3
+++ winwin32rootlesswindow.c	15 Jan 2004 21:20:30 -0000	1.1.2.4
@@ -1,196 +1,196 @@
-/*
- *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.
- *
- * Authors:	Kensuke Matsuzaki
- *		Earle F. Philhower, III
- *		Harold L Hunt II
- */
-
-#include "win.h"
-#include "winprefs.h"
-
-
-/*
- * External global variables
- */
-
-extern HICON		g_hiconX;
-
-
-/*
- * winWin32RootlessReorderWindows
- */
-
-void
-winWin32RootlessReorderWindows (ScreenPtr pScreen)
-{
-  winScreenPriv(pScreen);
-  HWND hwnd = NULL;
-  win32RootlessWindowPtr pRLWin = NULL;
-  win32RootlessWindowPtr pRLWinSib = NULL;
-  DWORD dwCurrentProcessID = GetCurrentProcessId ();
-  DWORD dwWindowProcessID = 0;
-
-#if CYGMULTIWINDOW_DEBUG && FALSE
-  ErrorF ("winWin32RootlessReorderWindows\n");
-#endif
-
-  pScreenPriv->fRestacking = TRUE;
-
-  if (pScreenPriv->fWindowOrderChanged)
-    {
-#if CYGMULTIWINDOW_DEBUG
-      ErrorF ("winWin32RootlessReorderWindows - Need to restack\n");
-#endif
-      hwnd = GetTopWindow (NULL);
-
-      while (hwnd)
-	{
-	  GetWindowThreadProcessId (hwnd, &dwWindowProcessID);
-
-	  if ((dwWindowProcessID == dwCurrentProcessID)
-	      && GetProp (hwnd, WIN_WINDOW_PROP))
-	    {
-	      pRLWinSib = pRLWin;
-	      pRLWin = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP);
-	      
-	      if (pRLWinSib)
-		{
-		  XID *vlist = malloc (sizeof(long) * 2);
-		  
-		  if (vlist == NULL)
-		    {
-		      ErrorF ("winWin32RootlessReorderWindows - malloc () "
-			      "failed\n");
-		      return;
-		    }
-		  
-		  ((long*)vlist)[0] = pRLWinSib->pFrame->win->drawable.id;
-		  ((long*)vlist)[1] = Below;
-
-		  ConfigureWindow (pRLWin->pFrame->win, CWSibling | CWStackMode,
-				   vlist, wClient(pRLWin->pFrame->win));
-		  
-		  free (vlist);
-		}
-	    }
-	  hwnd = GetNextWindow (hwnd, GW_HWNDNEXT);
-	}
-    }
-
-  pScreenPriv->fRestacking = FALSE;
-  pScreenPriv->fWindowOrderChanged = FALSE;
-
-}
-
-
-/*
- * winWin32RootlessMoveXWindow
- */
-
-void
-winWin32RootlessMoveXWindow (WindowPtr pWin, int x, int y)
-{
-  XID *vlist = malloc(sizeof(long)*2);
-
-  (CARD32*)vlist[0] = x;
-  (CARD32*)vlist[1] = y;
-  ConfigureWindow (pWin, CWX | CWY, vlist, wClient(pWin));
-  free(vlist);
-}
-
-
-/*
- * winWin32RootlessResizeXWindow
- */
-
-void
-winWin32RootlessResizeXWindow (WindowPtr pWin, int w, int h)
-{
-  XID *vlist = malloc(sizeof(long)*2);
-
-  (CARD32*)vlist[0] = w;
-  (CARD32*)vlist[1] = h;
-  ConfigureWindow (pWin, CWWidth | CWHeight, vlist, wClient(pWin));
-  free(vlist);
-}
-
-
-/*
- * winWin32RootlessMoveResizeXWindow
- */
-
-void
-winWin32RootlessMoveResizeXWindow (WindowPtr pWin, int x, int y, int w, int h)
-{
-  XID *vlist = malloc(sizeof(long)*4);
-
-  (CARD32*)vlist[0] = x;
-  (CARD32*)vlist[1] = y;
-  (CARD32*)vlist[2] = w;
-  (CARD32*)vlist[3] = h;
-
-  ConfigureWindow (pWin, CWX | CWY | CWWidth | CWHeight, vlist, wClient(pWin));
-  free(vlist);
-}
-
-
-/*
- * winWin32RootlessUpdateIcon
- * Change the Windows window icon 
- */
-
-void
-winWin32RootlessUpdateIcon (Window id)
-{
-  WindowPtr		pWin;
-  HICON			hIcon, hiconOld;
-
-  pWin = LookupIDByType (id, RT_WINDOW);
-  hIcon = (HICON)winOverrideIcon ((unsigned long)pWin);
-
-  if (!hIcon)
-    hIcon = winXIconToHICON (pWin);
-
-  if (hIcon)
-    {
-      win32RootlessWindowPtr pRLWinPriv
-	= (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, FALSE);
-
-      if (pRLWinPriv->hWnd)
-	{
-	  hiconOld = (HICON) SetClassLong (pRLWinPriv->hWnd,
-					   GCL_HICON,
-					   (int) hIcon);
-	  
-	  /* Delete the icon if its not the default */
-	  if (hiconOld != g_hiconX &&
-	      !winIconIsOverride((unsigned long)hiconOld))
-	    DeleteObject (hiconOld);
-	}
-    }
-}
+/*
+ *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.
+ *
+ * Authors:	Kensuke Matsuzaki
+ *		Earle F. Philhower, III
+ *		Harold L Hunt II
+ */
+
+#include "win.h"
+#include "winprefs.h"
+
+
+/*
+ * External global variables
+ */
+
+extern HICON		g_hiconX;
+
+
+/*
+ * winWin32RootlessReorderWindows
+ */
+
+void
+winWin32RootlessReorderWindows (ScreenPtr pScreen)
+{
+  winScreenPriv(pScreen);
+  HWND hwnd = NULL;
+  win32RootlessWindowPtr pRLWin = NULL;
+  win32RootlessWindowPtr pRLWinSib = NULL;
+  DWORD dwCurrentProcessID = GetCurrentProcessId ();
+  DWORD dwWindowProcessID = 0;
+
+#if CYGMULTIWINDOW_DEBUG && FALSE
+  ErrorF ("winWin32RootlessReorderWindows\n");
+#endif
+
+  pScreenPriv->fRestacking = TRUE;
+
+  if (pScreenPriv->fWindowOrderChanged)
+    {
+#if CYGMULTIWINDOW_DEBUG
+      ErrorF ("winWin32RootlessReorderWindows - Need to restack\n");
+#endif
+      hwnd = GetTopWindow (NULL);
+
+      while (hwnd)
+	{
+	  GetWindowThreadProcessId (hwnd, &dwWindowProcessID);
+
+	  if ((dwWindowProcessID == dwCurrentProcessID)
+	      && GetProp (hwnd, WIN_WINDOW_PROP))
+	    {
+	      pRLWinSib = pRLWin;
+	      pRLWin = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP);
+	      
+	      if (pRLWinSib)
+		{
+		  XID *vlist = malloc (sizeof(long) * 2);
+		  
+		  if (vlist == NULL)
+		    {
+		      ErrorF ("winWin32RootlessReorderWindows - malloc () "
+			      "failed\n");
+		      return;
+		    }
+		  
+		  ((long*)vlist)[0] = pRLWinSib->pFrame->win->drawable.id;
+		  ((long*)vlist)[1] = Below;
+
+		  ConfigureWindow (pRLWin->pFrame->win, CWSibling | CWStackMode,
+				   vlist, wClient(pRLWin->pFrame->win));
+		  
+		  free (vlist);
+		}
+	    }
+	  hwnd = GetNextWindow (hwnd, GW_HWNDNEXT);
+	}
+    }
+
+  pScreenPriv->fRestacking = FALSE;
+  pScreenPriv->fWindowOrderChanged = FALSE;
+
+}
+
+
+/*
+ * winWin32RootlessMoveXWindow
+ */
+
+void
+winWin32RootlessMoveXWindow (WindowPtr pWin, int x, int y)
+{
+  XID *vlist = malloc(sizeof(long)*2);
+
+  (CARD32*)vlist[0] = x;
+  (CARD32*)vlist[1] = y;
+  ConfigureWindow (pWin, CWX | CWY, vlist, wClient(pWin));
+  free(vlist);
+}
+
+
+/*
+ * winWin32RootlessResizeXWindow
+ */
+
+void
+winWin32RootlessResizeXWindow (WindowPtr pWin, int w, int h)
+{
+  XID *vlist = malloc(sizeof(long)*2);
+
+  (CARD32*)vlist[0] = w;
+  (CARD32*)vlist[1] = h;
+  ConfigureWindow (pWin, CWWidth | CWHeight, vlist, wClient(pWin));
+  free(vlist);
+}
+
+
+/*
+ * winWin32RootlessMoveResizeXWindow
+ */
+
+void
+winWin32RootlessMoveResizeXWindow (WindowPtr pWin, int x, int y, int w, int h)
+{
+  XID *vlist = malloc(sizeof(long)*4);
+
+  (CARD32*)vlist[0] = x;
+  (CARD32*)vlist[1] = y;
+  (CARD32*)vlist[2] = w;
+  (CARD32*)vlist[3] = h;
+
+  ConfigureWindow (pWin, CWX | CWY | CWWidth | CWHeight, vlist, wClient(pWin));
+  free(vlist);
+}
+
+
+/*
+ * winWin32RootlessUpdateIcon
+ * Change the Windows window icon
+ */
+
+void
+winWin32RootlessUpdateIcon (Window id)
+{
+  WindowPtr		pWin;
+  HICON			hIcon, hiconOld;
+
+  pWin = LookupIDByType (id, RT_WINDOW);
+  hIcon = (HICON)winOverrideIcon ((unsigned long)pWin);
+
+  if (!hIcon)
+    hIcon = winXIconToHICON (pWin);
+
+  if (hIcon)
+    {
+      win32RootlessWindowPtr pRLWinPriv
+	= (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, FALSE);
+
+      if (pRLWinPriv->hWnd)
+	{
+	  hiconOld = (HICON) SetClassLong (pRLWinPriv->hWnd,
+					   GCL_HICON,
+					   (int) hIcon);
+	  
+	  /* Delete the icon if its not the default */
+	  if (hiconOld != g_hiconX &&
+	      !winIconIsOverride((unsigned long)hiconOld))
+	    DeleteObject (hiconOld);
+	}
+    }
+}

Index: winwindow.h
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winwindow.h,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
--- winwindow.h	23 Dec 2003 06:32:43 -0000	1.1.4.1.2.2
+++ winwindow.h	15 Jan 2004 21:20:30 -0000	1.1.4.1.2.3
@@ -52,7 +52,7 @@
 #define WIN_LOG_FNAME		"/tmp/XWin.log"
 #define WIN_WID_PROP		"cyg_wid_prop_rl"
 #define WIN_NEEDMANAGE_PROP	"cyg_override_redirect_prop_rl"
-#define WIN_HWND_CACHE          "cyg_privmap_rl"
+#define WIN_HWND_CACHE		"cyg_privmap_rl"
 #define CYGMULTIWINDOW_DEBUG    NO
 
 typedef struct _winPrivScreenRec *winPrivScreenPtr;





More information about the xorg-commit mailing list