xserver: Branch 'xorg-server-1.2-apple'

Ben Byer bbyer at kemper.freedesktop.org
Sat Nov 3 05:34:25 PDT 2007


 hw/darwin/quartz/quartz.c        |   13 ++++++++++---
 hw/darwin/quartz/xpr/xprFrame.c  |    5 +++--
 hw/darwin/quartz/xpr/xprScreen.c |   14 ++++++++++++--
 3 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit 4393d10c2268a245288f2ae1c532b9a0b97f2021
Author: Ben Byer <bbyer at bbyer.local>
Date:   Sat Nov 3 05:34:19 2007 -0700

    Initial support for Spaces -- if you use Expose to drag an X11
    window to another Space, it will work correctly (as opposed
    to just leaving a ghost window).  We accomplish this by listening
    for the notification from Xplugin that our window has been moved,
    and then we ask X11 to move the window to the new location.

diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
index 8670e57..a24aeb1 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/darwin/quartz/quartz.c
@@ -400,9 +400,16 @@ void DarwinModeProcessEvent(
             break;
 
         case kXDarwinWindowState:
-        case kXDarwinWindowMoved:
-            // FIXME: Not implemented yet
-            break;
+	  ErrorF("kXDarwinWindowState\n");
+	  break;
+    case kXDarwinWindowMoved: {
+	  WindowPtr pWin = (WindowPtr)xe->u.clientMessage.u.l.longs0;
+	  short x = xe->u.clientMessage.u.l.longs1,
+	        y = xe->u.clientMessage.u.l.longs2;
+	  ErrorF("kXDarwinWindowMoved(%p, %hd, %hd)\n", pWin, x, y);
+	  RootlessMoveWindow(pWin, x, y, pWin->nextSib, VTMove);
+    }
+	  break;
 
         default:
             ErrorF("Unknown application defined event type %d.\n",
diff --git a/hw/darwin/quartz/xpr/xprFrame.c b/hw/darwin/quartz/xpr/xprFrame.c
index 0e3b200..53fbb31 100644
--- a/hw/darwin/quartz/xpr/xprFrame.c
+++ b/hw/darwin/quartz/xpr/xprFrame.c
@@ -68,6 +68,7 @@ static inline xp_error
 xprConfigureWindow(xp_window_id id, unsigned int mask,
                    const xp_window_changes *values)
 {
+  //  ErrorF("xprConfigureWindow()\n");
     if (!no_configure_window)
         return xp_configure_window(id, mask, values);
     else
@@ -185,7 +186,7 @@ xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
 
     wc.x = newX;
     wc.y = newY;
-
+    //    ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen, newX, newY);
     xprConfigureWindow((xp_window_id) wid, XP_ORIGIN, &wc);
 }
 
@@ -411,7 +412,7 @@ xprInit(ScreenPtr pScreen)
  * Given the id of a physical window, try to find the top-level (or root)
  * X window that it represents.
  */
-static WindowPtr
+WindowPtr
 xprGetXWindow(xp_window_id wid)
 {
     RootlessWindowRec *winRec;
diff --git a/hw/darwin/quartz/xpr/xprScreen.c b/hw/darwin/quartz/xpr/xprScreen.c
index 92886fc..9284d5d 100644
--- a/hw/darwin/quartz/xpr/xprScreen.c
+++ b/hw/darwin/quartz/xpr/xprScreen.c
@@ -61,10 +61,12 @@ eventHandler(unsigned int type, const void *arg,
     switch (type)
     {
     case XP_EVENT_DISPLAY_CHANGED:
+      //      ErrorF("XP_EVENT_DISPLAY_MOVED\n");
         QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
         break;
 
     case XP_EVENT_WINDOW_STATE_CHANGED:
+      //      ErrorF("XP_EVENT_WINDOW_STATE_CHANGED\n");
         if (arg_size >= sizeof(xp_window_state_event))
         {
             const xp_window_state_event *ws_arg = arg;
@@ -75,16 +77,24 @@ eventHandler(unsigned int type, const void *arg,
         break;
 
     case XP_EVENT_WINDOW_MOVED:
+      //      ErrorF("XP_EVENT_WINDOW_MOVED\n");
         if (arg_size == sizeof(xp_window_id))
         {
             xp_window_id id = * (xp_window_id *) arg;
-
-            QuartzMessageServerThread(kXDarwinWindowMoved, 1, id);
+	    WindowPtr pWin = xprGetXWindow(id);
+	    BoxRec box;
+	    xp_error retval  = xp_get_window_bounds(id, &box);
+	    if (retval != Success) {
+	      ErrorF("Unable to find new bounds for window\n");
+	      break;
+	    }
+            QuartzMessageServerThread(kXDarwinWindowMoved, 3, pWin, box.x1, box.y1);
         }
         break;
 
     case XP_EVENT_SURFACE_DESTROYED:
     case XP_EVENT_SURFACE_CHANGED:
+      //      ErrorF("XP_EVENT_SURFACE_MOVED\n");
         if (arg_size == sizeof(xp_surface_id))
         {
             int kind;


More information about the xorg-commit mailing list