[Xorg-commit] xc/programs/Xserver/hw/xwin InitOutput.c,1.1.4.1.2.4,1.1.4.1.2.5 win.h,1.1.4.1.2.5,1.1.4.1.2.6 wincreatewnd.c,1.1.4.1.2.2,1.1.4.1.2.3 winscrinit.c,1.1.4.1.2.4,1.1.4.1.2.5 winwndproc.c,1.1.4.1.2.3,1.1.4.1.2.4

Kensuke Matsuzaki xorg-commit at pdx.freedesktop.org
Sat Dec 27 02:15:03 EET 2003


Committed by: zakki

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

Modified Files:
      Tag: CYGWIN
	InitOutput.c win.h wincreatewnd.c winscrinit.c winwndproc.c 
Log Message:
Add -pseudorootless option.

Index: InitOutput.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/InitOutput.c,v
retrieving revision 1.1.4.1.2.4
retrieving revision 1.1.4.1.2.5
diff -u -d -r1.1.4.1.2.4 -r1.1.4.1.2.5
--- InitOutput.c	23 Dec 2003 06:32:43 -0000	1.1.4.1.2.4
+++ InitOutput.c	27 Dec 2003 00:15:01 -0000	1.1.4.1.2.5
@@ -154,6 +154,7 @@
       g_ScreenInfo[i].fFullScreen = FALSE;
       g_ScreenInfo[i].fDecoration = TRUE;
       g_ScreenInfo[i].fRootless = FALSE;
+      g_ScreenInfo[i].fPseudoRootless = FALSE;
       g_ScreenInfo[i].fMultiWindow = FALSE;
       g_ScreenInfo[i].fMultipleMonitors = FALSE;
       g_ScreenInfo[i].fClipboard = FALSE;
@@ -323,6 +324,9 @@
 	  "\tmode only.\n");
 
   ErrorF ("-rootless\n"
+	  "\tEXPERIMENTAL: Run the server in rootless mode.\n");
+
+  ErrorF ("-pseudorootless\n"
 	  "\tEXPERIMENTAL: Run the server in pseudo-rootless mode.\n");
 
   ErrorF ("-multiwindow\n"
@@ -696,6 +700,32 @@
     }
 
   /*
+   * Look for the '-pseudorootless' argument
+   */
+  if (IS_OPTION ("-pseudorootless"))
+    {
+      /* Is this parameter attached to a screen or is it global? */
+      if (-1 == g_iLastScreen)
+	{
+	  int			j;
+
+	  /* Parameter is for all screens */
+	  for (j = 0; j < MAXSCREENS; j++)
+	    {
+	      g_ScreenInfo[j].fPseudoRootless = TRUE;
+	    }
+	}
+      else
+	{
+	  /* Parameter is for a single screen */
+	  g_ScreenInfo[g_iLastScreen].fPseudoRootless = TRUE;
+	}
+
+      /* Indicate that we have processed this argument */
+      return 1;
+    }
+
+  /*
    * Look for the '-multiwindow' argument
    */
   if (IS_OPTION ("-multiwindow"))

Index: win.h
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/win.h,v
retrieving revision 1.1.4.1.2.5
retrieving revision 1.1.4.1.2.6
diff -u -d -r1.1.4.1.2.5 -r1.1.4.1.2.6
--- win.h	24 Dec 2003 21:17:27 -0000	1.1.4.1.2.5
+++ win.h	27 Dec 2003 00:15:01 -0000	1.1.4.1.2.6
@@ -394,6 +394,7 @@
   Bool			fFullScreen;
   Bool			fDecoration;
   Bool			fRootless;
+  Bool			fPseudoRootless;
   Bool			fMultiWindow;
   Bool                  fMultipleMonitors;
   Bool			fClipboard;

Index: wincreatewnd.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/wincreatewnd.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
--- wincreatewnd.c	5 Dec 2003 03:37:26 -0000	1.1.4.1.2.2
+++ wincreatewnd.c	27 Dec 2003 00:15:01 -0000	1.1.4.1.2.3
@@ -148,13 +148,14 @@
 	  (int) pScreenInfo->dwUserWidth, (int) pScreenInfo->dwUserHeight);
   ErrorF ("winCreateBoundingWindowWindowed - Current w: %d h: %d\n",
 	  (int) pScreenInfo->dwWidth, (int) pScreenInfo->dwHeight);
-  
+
   /* Set the common window style flags */
   dwWindowStyle = WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX;
   
   /* Decorated or undecorated window */
   if (pScreenInfo->fDecoration
       && !pScreenInfo->fRootless
+      && !pScreenInfo->fPseudoRootless
       && !pScreenInfo->fMultiWindow)
     {
       dwWindowStyle |= WS_CAPTION;
@@ -195,6 +196,7 @@
       /* Adjust the window width and height for borders and title bar */
       if (pScreenInfo->fDecoration
 	  && !pScreenInfo->fRootless
+	  && !pScreenInfo->fPseudoRootless
 	  && !pScreenInfo->fMultiWindow)
 	{
 #if CYGDEBUG
@@ -261,6 +263,7 @@
   /* Clean up the scrollbars flag, if necessary */
   if ((!pScreenInfo->fDecoration
        || pScreenInfo->fRootless
+       || pScreenInfo->fPseudoRootless
        || pScreenInfo->fMultiWindow)
       && pScreenInfo->fScrollbars)
     {
@@ -410,11 +413,16 @@
     }
   
   /* Attempt to bring our window to the top of the display */
-  if (!BringWindowToTop (*phwnd))
+  if (!pScreenInfo->fMultiWindow
+      && !pScreenInfo->fRootless
+      && !pScreenInfo->fPseudoRootless)
     {
-      ErrorF ("winCreateBoundingWindowWindowed - BringWindowToTop () "
-	      "failed\n");
-      return FALSE;
+      if (!BringWindowToTop (*phwnd))
+	{
+	  ErrorF ("winCreateBoundingWindowWindowed - BringWindowToTop () "
+		  "failed\n");
+	  return FALSE;
+	}
     }
 
   /* Paint window background blue */

Index: winscrinit.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winscrinit.c,v
retrieving revision 1.1.4.1.2.4
retrieving revision 1.1.4.1.2.5
diff -u -d -r1.1.4.1.2.4 -r1.1.4.1.2.5
--- winscrinit.c	9 Dec 2003 17:45:46 -0000	1.1.4.1.2.4
+++ winscrinit.c	27 Dec 2003 00:15:01 -0000	1.1.4.1.2.5
@@ -449,7 +449,7 @@
 #endif
 
 
-  /* Handle pseudo-rootless mode */
+  /* Handle rootless mode */
   if (pScreenInfo->fRootless)
     {
       ErrorF ("winScreenInit - RootlessInit\n");
@@ -469,6 +469,43 @@
 	}
       winWindowsWMExtensionInit ();
     }
+  /* Handle pseudo-rootless mode */
+  else if (pScreenInfo->fPseudoRootless)
+    {
+      /* Define the WRAP macro temporarily for local use */
+#define WRAP(a) \
+    if (pScreen->a) { \
+        pScreenPriv->a = pScreen->a; \
+    } else { \
+        ErrorF("null screen fn " #a "\n"); \
+        pScreenPriv->a = NULL; \
+    }
+
+      /* Save a pointer to each lower-level window procedure */
+      WRAP(CreateWindow);
+      WRAP(DestroyWindow);
+      WRAP(RealizeWindow);
+      WRAP(UnrealizeWindow);
+      WRAP(PositionWindow);
+      WRAP(ChangeWindowAttributes);
+#ifdef SHAPE
+      WRAP(SetShape);
+#endif
+
+      /* Assign pseudo-rootless window procedures to be top level procedures */
+      pScreen->CreateWindow = winCreateWindowPRootless;
+      pScreen->DestroyWindow = winDestroyWindowPRootless;
+      pScreen->PositionWindow = winPositionWindowPRootless;
+      pScreen->ChangeWindowAttributes = winChangeWindowAttributesPRootless;
+      pScreen->RealizeWindow = winMapWindowPRootless;
+      pScreen->UnrealizeWindow = winUnmapWindowPRootless;
+#ifdef SHAPE
+      pScreen->SetShape = winSetShapePRootless;
+#endif
+
+      /* Undefine the WRAP macro, as it is not needed elsewhere */
+#undef WRAP
+    }
   /* Handle multi window mode */
   else if (pScreenInfo->fMultiWindow)
     {

Index: winwndproc.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winwndproc.c,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
--- winwndproc.c	24 Dec 2003 21:17:27 -0000	1.1.4.1.2.3
+++ winwndproc.c	27 Dec 2003 00:15:01 -0000	1.1.4.1.2.4
@@ -291,6 +291,7 @@
 	if (!s_pScreenInfo->fScrollbars
 	    || !s_pScreenInfo->fDecoration
 	    || s_pScreenInfo->fRootless
+	    || s_pScreenInfo->fPseudoRootless
 	    || s_pScreenInfo->fMultiWindow
 	    || s_pScreenInfo->fFullScreen)
 	  break;
@@ -562,6 +563,7 @@
 	    || s_pScreenInfo->fFullScreen
 	    || !s_pScreenInfo->fDecoration
 	    || s_pScreenInfo->fRootless
+	    || s_pScreenInfo->fPseudoRootless
 	    || s_pScreenInfo->fMultiWindow)
 	  break;
 
@@ -744,39 +746,45 @@
     case WM_LBUTTONDOWN:
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
-      if (s_pScreenInfo->fRootless) SetCapture (hwnd);
+      if (s_pScreenInfo->fRootless || s_pScreenInfo->fPseudoRootless)
+	SetCapture (hwnd);
       return winMouseButtonsHandle (s_pScreen, ButtonPress, Button1, wParam);
       
     case WM_LBUTTONUP:
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
-      if (s_pScreenInfo->fRootless) ReleaseCapture ();
+      if (s_pScreenInfo->fRootless || s_pScreenInfo->fPseudoRootless)
+	ReleaseCapture ();
       return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button1, wParam);
 
     case WM_MBUTTONDBLCLK:
     case WM_MBUTTONDOWN:
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
-      if (s_pScreenInfo->fRootless) SetCapture (hwnd);
+      if (s_pScreenInfo->fRootless || s_pScreenInfo->fPseudoRootless)
+	SetCapture (hwnd);
       return winMouseButtonsHandle (s_pScreen, ButtonPress, Button2, wParam);
       
     case WM_MBUTTONUP:
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
-      if (s_pScreenInfo->fRootless) ReleaseCapture ();
+      if (s_pScreenInfo->fRootless || s_pScreenInfo->fPseudoRootless)
+	ReleaseCapture ();
       return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button2, wParam);
       
     case WM_RBUTTONDBLCLK:
     case WM_RBUTTONDOWN:
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
-      if (s_pScreenInfo->fRootless) SetCapture (hwnd);
+      if (s_pScreenInfo->fRootless || s_pScreenInfo->fPseudoRootless)
+	SetCapture (hwnd);
       return winMouseButtonsHandle (s_pScreen, ButtonPress, Button3, wParam);
       
     case WM_RBUTTONUP:
       if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
 	break;
-      if (s_pScreenInfo->fRootless) ReleaseCapture ();
+      if (s_pScreenInfo->fRootless || s_pScreenInfo->fPseudoRootless)
+	ReleaseCapture ();
       return winMouseButtonsHandle (s_pScreen, ButtonRelease, Button3, wParam);
 
     case WM_TIMER:





More information about the xorg-commit mailing list