xserver: Branch 'xorg-server-1.5-apple' - 9 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri Oct 31 15:51:47 PDT 2008


 hw/xquartz/GL/visualConfigs.c         |    8 +++++++-
 hw/xquartz/X11Application.m           |   10 +++++-----
 hw/xquartz/darwinEvents.c             |   24 +++++++++++-------------
 hw/xquartz/mach-startup/bundle-main.c |    9 ---------
 hw/xquartz/quartz.c                   |    8 +++++++-
 hw/xquartz/xpr/xprScreen.c            |   18 ++++++------------
 include/dix-config.h.in               |    3 ---
 miext/rootless/rootlessWindow.c       |    9 +--------
 8 files changed, 37 insertions(+), 52 deletions(-)

New commits:
commit 75733791d312dd77c2892b0abc8ebfc9c9991a7b
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Oct 31 15:10:34 2008 -0700

    XQuartz: displayScreenBounds uses quartzEnableRootless rather than !quartzHasRoot
    (cherry picked from commit c883a78ef0c2e7e29437881db85d3815a89ab874)

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index e8ffb44..ab73dff 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -274,9 +274,12 @@ static void QuartzUpdateScreens(void) {
     pRoot = WindowTable[pScreen->myNum];
     AppleWMSetScreenOrigin(pRoot);
     pScreen->ResizeWindow(pRoot, x - sx, y - sy, width, height, NULL);
+    //pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip,  PW_BACKGROUND);
     miPaintWindow(pRoot, &pRoot->borderClip,  PW_BACKGROUND);
     DefineInitialRootWindow(pRoot);
-    
+
+    DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y);
+
     /* Send an event for the root reconfigure */
     e.u.u.type = ConfigureNotify;
     e.u.configureNotify.window = pRoot->drawable.id;
@@ -303,6 +306,9 @@ void QuartzDisplayChangedHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev,
 }
 
 void QuartzSetFullscreen(Bool state) {
+    
+    DEBUG_LOG("QuartzSetFullscreen: state=%d\n", state);
+    
     if(quartzHasRoot == state)
         return;
     
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 6f8cc30..b37a1d9 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -142,7 +142,7 @@ displayAtIndex(int index)
  *  Return the bounds of a particular display.
  */
 static CGRect
-displayScreenBounds(CGDirectDisplayID id, Bool remove_menubar)
+displayScreenBounds(CGDirectDisplayID id)
 {
     CGRect frame;
 
@@ -153,7 +153,7 @@ displayScreenBounds(CGDirectDisplayID id, Bool remove_menubar)
               (int)frame.origin.x, (int)frame.origin.y);
     
     /* Remove menubar to help standard X11 window managers. */
-    if (remove_menubar && !quartzHasRoot && 
+    if (quartzEnableRootless && 
         frame.origin.x == 0 && frame.origin.y == 0) {
         frame.origin.y += aquaMenuBarHeight;
         frame.size.height -= aquaMenuBarHeight;
@@ -186,7 +186,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
     /* Get the union of all screens */
     for (i = 0; i < displayCount; i++) {
         CGDirectDisplayID dpy = displayList[i];
-        frame = displayScreenBounds(dpy, TRUE);
+        frame = displayScreenBounds(dpy);
         unionRect = CGRectUnion(unionRect, frame);
     }
 
@@ -204,7 +204,7 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
     {
         CGDirectDisplayID dpy = displayList[i];
 
-        frame = displayScreenBounds(dpy, TRUE);
+        frame = displayScreenBounds(dpy);
         frame.origin.x -= unionRect.origin.x;
         frame.origin.y -= unionRect.origin.y;
 
@@ -328,7 +328,7 @@ xprAddScreen(int index, ScreenPtr pScreen)
 
         dpy = displayAtIndex(index);
 
-        frame = displayScreenBounds(dpy, TRUE);
+        frame = displayScreenBounds(dpy);
 
         dfb->x = frame.origin.x;
         dfb->y = frame.origin.y;
commit 9c6a7dff7e267075881b7f9318d9ab795f235bb2
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Oct 31 14:39:54 2008 -0700

    Rootless: Force initialization of static variable before use.
    (cherry picked from commit cece29317269385aa7a0d3047e6f90e6a17d01eb)

diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index 2a16dc8..ea47d63 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -65,7 +65,7 @@ extern int darwinMainScreenX, darwinMainScreenY;
 
 #define DEFINE_ATOM_HELPER(func,atom_name)                      \
   static Atom func (void) {                                       \
-    static unsigned int generation;                             \
+    static unsigned int generation = 0;                             \
     static Atom atom;                                           \
     if (generation != serverGeneration) {                       \
       generation = serverGeneration;                          \
@@ -82,13 +82,6 @@ static Bool no_configure_window;
 static Bool windows_hidden;
 // TODO - abstract xp functions
 
-static const int normal_window_levels[AppleWMNumWindowLevels+1] = {
-  0, 3, 4, 5, LONG_MIN + 30, LONG_MIN + 29,
-};
-static const int rooted_window_levels[AppleWMNumWindowLevels+1] = {
-  202, 203, 204, 205, 201, 200
-};
-
 static inline int
 configure_window (xp_window_id id, unsigned int mask,
                   const xp_window_changes *values)
commit 251ae8dbdc73a0f3f60e37c9b60bd00bf493a518
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Oct 31 13:00:01 2008 -0700

    XQuartz: Silence pointer debug spam
    (cherry picked from commit 9ca099e928653b5a0fb745186e17bfcc3d74ccc0)

diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index dcba77f..473ec22 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -187,7 +187,7 @@ static void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, in
     
     TA_SERVER();
 
-    DEBUG_LOG("DarwinEventHandler(%d, %p, %p, %d)\n", screenNum, xe, dev, nevents);
+//    DEBUG_LOG("DarwinEventHandler(%d, %p, %p, %d)\n", screenNum, xe, dev, nevents);
     for (i=0; i<nevents; i++) {
         switch(xe[i].u.u.type) {
             case kXquartzControllerNotify:
@@ -391,8 +391,8 @@ static void DarwinPrepareValuators(int *valuators, ScreenPtr screen,
     valuators[3] = tilt_x * XQUARTZ_VALUATOR_LIMIT;
     valuators[4] = tilt_y * XQUARTZ_VALUATOR_LIMIT;
     
-    DEBUG_LOG("Pointer (%f, %f), Valuators: {%d,%d,%d,%d,%d}\n", pointer_x, pointer_y,
-              valuators[0], valuators[1], valuators[2], valuators[3], valuators[4]);
+    //DEBUG_LOG("Pointer (%f, %f), Valuators: {%d,%d,%d,%d,%d}\n", pointer_x, pointer_y,
+    //          valuators[0], valuators[1], valuators[2], valuators[3], valuators[4]);
 }
 
 void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, float pointer_x, float pointer_y, 
@@ -402,7 +402,7 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa
     ScreenPtr screen;
     int valuators[5];
 	
-    DEBUG_LOG("x=%f, y=%f, p=%f, tx=%f, ty=%f\n", pointer_x, pointer_y, pressure, tilt_x, tilt_y);
+    //DEBUG_LOG("x=%f, y=%f, p=%f, tx=%f, ty=%f\n", pointer_x, pointer_y, pressure, tilt_x, tilt_y);
     
 	if(!darwinEvents) {
 		DEBUG_LOG("DarwinSendPointerEvents called before darwinEvents was initialized\n");
commit 16cf8cd2e372d559637eecc9480130c8a9c0ddf4
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Oct 31 12:55:46 2008 -0700

    XQuartz: Don't map the menu bar to the screen area.
    (cherry picked from commit 1115917ada127a1cd6a8b61efe7fd134e2ea85fd)

diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 1801f75..dcba77f 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -377,7 +377,13 @@ static void DarwinPrepareValuators(int *valuators, ScreenPtr screen,
     /* Fix offset between darwin and X screens */
     pointer_x -= darwinMainScreenX + dixScreenOrigins[screen->myNum].x;
     pointer_y -= darwinMainScreenY + dixScreenOrigins[screen->myNum].y;
-    
+
+    if(pointer_x < 0.0)
+        pointer_x = 0.0;
+
+    if(pointer_y < 0.0)
+        pointer_y = 0.0;
+
     /* Setup our array of values */
     valuators[0] = pointer_x * XQUARTZ_VALUATOR_LIMIT / (float)screenInfo.screens[0]->width;
     valuators[1] = pointer_y * XQUARTZ_VALUATOR_LIMIT / (float)screenInfo.screens[0]->height;
@@ -385,7 +391,7 @@ static void DarwinPrepareValuators(int *valuators, ScreenPtr screen,
     valuators[3] = tilt_x * XQUARTZ_VALUATOR_LIMIT;
     valuators[4] = tilt_y * XQUARTZ_VALUATOR_LIMIT;
     
-    DEBUG_LOG("Valuators: {%d,%d,%d,%d,%d}\n", 
+    DEBUG_LOG("Pointer (%f, %f), Valuators: {%d,%d,%d,%d,%d}\n", pointer_x, pointer_y,
               valuators[0], valuators[1], valuators[2], valuators[3], valuators[4]);
 }
 
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 7d5303b..6f8cc30 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -184,15 +184,9 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
     CGGetActiveDisplayList(displayCount, displayList, &displayCount);
 
     /* Get the union of all screens */
-    for (i = 0; i < displayCount; i++)
-    {
-
-        /* we can't remove the menubar from the screen - doing so
-         * would constrain the pointer to the screen, not allowing it
-         * to reach the menubar..
-         */
+    for (i = 0; i < displayCount; i++) {
         CGDirectDisplayID dpy = displayList[i];
-        frame = displayScreenBounds(dpy, FALSE);
+        frame = displayScreenBounds(dpy, TRUE);
         unionRect = CGRectUnion(unionRect, frame);
     }
 
commit f95df525b1ae35611536dd63b56e912ea364c27b
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Oct 31 12:37:32 2008 -0700

    XQuartz: Fixed Xplugin thread safety issues, so rea-enable background window check
    (cherry picked from commit 5fc73b1141eca8b678e54412ca33afa31a76d088)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 256e723..055ce2a 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -967,23 +967,21 @@ static void send_nsevent(NSEvent *e) {
                 pDev = darwinTabletCurrent;
             }
 
-#if 0 // XPlugin isn't thread safe ... sigh
             if(!quartzServerVisible) {
                 xp_window_id wid;
-                
+
                 /* Sigh. Need to check that we're really over one of
                  * our windows. (We need to receive pointer events while
-                 * not in the foreground, and the only way to do that
-                 * right now is to ask for _all_ pointer events..)
+                 * not in the foreground, but we don't want to receive them
+                 * when another window is over us or we might show a tooltip)
                  */
                 
                 wid = 0;
-                xp_find_window(pointer_x, pointer_y, 0, &wid);
                 
-                if (wid == 0)
+                if (xp_find_window(pointer_x, pointer_y, 0, &wid) == XP_Success &&
+                    wid == 0)
                     return;        
             }
-#endif
             
             DarwinSendPointerEvents(pDev, ev_type, ev_button, pointer_x, pointer_y,
                                     pressure, tilt_x, tilt_y);
commit 5378c3715afd0fea18d7218445fe895904c45230
Author: George Peter Staplin <gps at Georges-Workstation.local>
Date:   Thu Oct 30 13:44:55 2008 -0600

    XQuartz: GL: Mark visuals that are slower than others, due to lack of acceleration.
    
    This is used in libGL to determine a preferred visual.  glxinfo -v will also
    report "visualCaveat=Slow" for such visuals.
    (cherry picked from commit d5c17f585a240be9f9135975738e62951cde3353)

diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
index 196989a..12e9777 100644
--- a/hw/xquartz/GL/visualConfigs.c
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -177,7 +177,13 @@ void setVisualConfigs(void) {
 				    }
 				    visualConfigs[i].auxBuffers = aux ? conf->aux_buffers : 0;
 				    visualConfigs[i].level = 0;
-				    visualConfigs[i].visualRating = GLX_NONE;
+
+				    if(conf->accelerated) {
+					visualConfigs[i].visualRating = GLX_NONE;
+				    } else {
+					visualConfigs[i].visualRating = GLX_SLOW_VISUAL_EXT;
+				    }
+
 				    visualConfigs[i].transparentPixel = GLX_NONE;
 				    visualConfigs[i].transparentRed = GLX_NONE;
 				    visualConfigs[i].transparentGreen = GLX_NONE;
commit 446a75db6d7a9a470cb7f653cb7566e90bb2eed8
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Oct 29 17:20:51 2008 -0700

    Removed unused DARWIN_WITH_QUARTZ option from dix-config.h
    (cherry picked from commit 423f68cd529c7b53f5c02b57c6c091878fa97ae5)

diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 5b7bba8..aa5aaab 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -38,9 +38,6 @@
 /* Support Damage extension */
 #undef DAMAGE
 
-/* Build for darwin with Quartz support */
-#undef DARWIN_WITH_QUARTZ
-
 /* Use OsVendorInit */
 #undef DDXOSINIT
 
commit cfe04bc2266e164262d72860d59dbf497738fe16
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Oct 29 17:20:11 2008 -0700

    XQuartz: if 0 out a block to avoid thread-unsafe lockups
    (cherry picked from commit 60d7359a67900ad4601dbc73e07bcd8c803100a5)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 2acd742..256e723 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -967,6 +967,7 @@ static void send_nsevent(NSEvent *e) {
                 pDev = darwinTabletCurrent;
             }
 
+#if 0 // XPlugin isn't thread safe ... sigh
             if(!quartzServerVisible) {
                 xp_window_id wid;
                 
@@ -982,6 +983,7 @@ static void send_nsevent(NSEvent *e) {
                 if (wid == 0)
                     return;        
             }
+#endif
             
             DarwinSendPointerEvents(pDev, ev_type, ev_button, pointer_x, pointer_y,
                                     pressure, tilt_x, tilt_y);
commit 770ae89d98fe1e585db1e57f7260125e8d843a99
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Oct 29 17:18:05 2008 -0700

    XQuartz: Purge the old XQUARTZ_EXPORTS_LAUNCHD_FD option
    (cherry picked from commit 490756c7fbe0792c4bd6ae434e7a48e0beffa5c7)

diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 9acc0cc..1801f75 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -267,16 +267,9 @@ static void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, in
     }
 }
 
-#ifdef XQUARTZ_EXPORTS_LAUNCHD_FD
-int xquartz_launchd_fd = -1;
-#endif
-
 void DarwinListenOnOpenFD(int fd) {
     ErrorF("DarwinListenOnOpenFD: %d\n", fd);
     
-#ifdef XQUARTZ_EXPORTS_LAUNCHD_FD
-    xquartz_launchd_fd = fd;
-#else
     pthread_mutex_lock(&fd_add_lock);
     if(fd_add_count < FD_ADD_MAX)
         fd_add[fd_add_count++] = fd;
@@ -285,7 +278,6 @@ void DarwinListenOnOpenFD(int fd) {
 
     pthread_cond_broadcast(&fd_add_ready_cond);
     pthread_mutex_unlock(&fd_add_lock);
-#endif
 }
 
 static void DarwinProcessFDAdditionQueue_thread(void *args) {
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 9f03647..a49013e 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -213,7 +213,6 @@ static void socket_handoff_thread(void *arg) {
     unlink(handoff_data->filename);
     free(handoff_data);
     
-#ifndef XQUARTZ_EXPORTS_LAUNCHD_FD
     /* TODO: Clean up this race better... giving xinitrc time to run... need to wait for 1.5 branch:
      *
      * From ajax:
@@ -226,7 +225,6 @@ static void socket_handoff_thread(void *arg) {
     unsigned remain = 3000000;
     fprintf(stderr, "X11.app: Received new $DISPLAY fd: %d ... sleeping to allow xinitrc to catchup.\n", launchd_fd);
     while((remain = usleep(remain)) > 0);
-#endif
     
     fprintf(stderr, "X11.app Handing off fd to server thread via DarwinListenOnOpenFD(%d)\n", launchd_fd);
     DarwinListenOnOpenFD(launchd_fd);
@@ -398,13 +396,6 @@ int startup_trigger(int argc, char **argv, char **envp) {
             /* Could open the display, start the launcher */
             XCloseDisplay(display);
 
-#ifdef XQUARTZ_EXPORTS_LAUNCHD_FD
-            fprintf(stderr, "X11.app: Received new DISPLAY fd: %d ... sleeping to allow xinitrc to catchup.\n", launchd_fd);
-            
-            /* TODO: Clean up this race better... givint xinitrc time to run. */
-            sleep(2);
-#endif
-
             return execute(command_from_prefs("app_to_run", DEFAULT_CLIENT));
         }
     }


More information about the xorg-commit mailing list