xserver: Branch 'master' - 8 commits
Jeremy Huddleston
jeremyhu at kemper.freedesktop.org
Fri Oct 31 15:50:25 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 ++++++------------
miext/rootless/rootlessWindow.c | 9 +--------
7 files changed, 37 insertions(+), 49 deletions(-)
New commits:
commit ecd55bc859eb5d7c639d5a6d531d9df524124247
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 2e4aad5..077c87c 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 4e762b8aa37b588e6cffcdd4a0152090190005e2
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 a2d0313..9f74718 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 9f49f5172d10070ebd4a9e72ac3c5227c6f35853
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 3303825..6a2a259 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -186,7 +186,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:
@@ -390,8 +390,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,
@@ -401,7 +401,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 93298c7f8f73bdb9892da0e41d2c2a67719dc736
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 6ec8c0f..3303825 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -376,7 +376,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;
@@ -384,7 +390,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 31907986a6d4dc726d8ce0071f5884ce6cfea33b
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 b882b55..cd77b63 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 227d782a1bddfa1393cddd0c73c0288e18645c47
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 5287602a4161cd036e3125cda09ba750190a0b47
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 5da1ffc..b882b55 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 93d7cd31c527afbf26f4e039afb6adbb6a60fab7
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 89e73c4..6ec8c0f 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -266,16 +266,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;
@@ -284,7 +277,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