summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremy@tifa.local>2008-03-21 18:07:38 -0700
committerJeremy Huddleston <jeremy@tifa.local>2008-03-21 19:37:42 -0700
commitc49e11268322712c211f29d51d664d3f8a59b00b (patch)
tree590be8c3166d73b6fc73843aabfe68ccce604c6d /hw
parent4c76607b699431183ee7e88fa7818cb7644a5a02 (diff)
XQuartz: Initial framework for dealing with spaces on OS-X
(cherry picked from commit 9831324998f9d1f05ff944c58c5bf60dcae17355)
Diffstat (limited to 'hw')
-rw-r--r--hw/xquartz/darwin.h3
-rw-r--r--hw/xquartz/quartz.c14
-rw-r--r--hw/xquartz/xpr/xprScreen.c11
3 files changed, 25 insertions, 3 deletions
diff --git a/hw/xquartz/darwin.h b/hw/xquartz/darwin.h
index c5e2ed80d..325122dfd 100644
--- a/hw/xquartz/darwin.h
+++ b/hw/xquartz/darwin.h
@@ -106,6 +106,7 @@ enum {
kXDarwinBringAllToFront, // bring all X windows to front
kXDarwinToggleFullscreen, // Enable/Disable fullscreen mode
kXDarwinSetRootless, // Set rootless mode
+ kXDarwinSpaceChanged, // Spaces changed
/*
* AppleWM events
*/
@@ -116,7 +117,7 @@ enum {
*/
kXDarwinDisplayChanged, // display configuration has changed
kXDarwinWindowState, // window visibility state has changed
- kXDarwinWindowMoved // window has moved on screen
+ kXDarwinWindowMoved, // window has moved on screen
};
#define ENABLE_DEBUG_LOG 1
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 6f42c538f..a034c9fac 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -266,7 +266,7 @@ static void QuartzUpdateScreens(void)
#ifndef FAKE_RANDR
if(!QuartzRandRInit(pScreen))
- FatalError("Failed to init RandR extension.\n");
+ FatalError("Failed to init RandR extension.\n");
#endif
DarwinAdjustScreenOrigins(&screenInfo);
@@ -364,6 +364,14 @@ static void QuartzSetRootClip(
}
}
+/*
+ * QuartzSpaceChanged
+ * Unmap offscreen windows, map onscreen windows
+ */
+static void QuartzSpaceChanged(uint32_t space_id) {
+ /* Do something special here, so we don't depend on quartz-wm for spaces to work... */
+ DEBUG_LOG("Space Changed (%u) ... do something interesting...\n", space_id);
+}
/*
* QuartzMessageServerThread
@@ -494,6 +502,10 @@ void QuartzProcessEvent(xEvent *xe) {
RootlessOrderAllWindows();
break;
+ case kXDarwinSpaceChanged:
+ DEBUG_LOG("kXDarwinSpaceChanged\n");
+ QuartzSpaceChanged(xe->u.clientMessage.u.l.longs0);
+ break;
default:
ErrorF("Unknown application defined event type %d.\n", xe->u.u.type);
}
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index db36403df..4dc5846d5 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -63,6 +63,7 @@ static const char *xprOpenGLBundle = "glxCGL.bundle";
*/
static void eventHandler(unsigned int type, const void *arg,
unsigned int arg_size, void *data) {
+
switch (type) {
case XP_EVENT_DISPLAY_CHANGED:
DEBUG_LOG("XP_EVENT_DISPLAY_CHANGED\n");
@@ -105,6 +106,13 @@ static void eventHandler(unsigned int type, const void *arg,
DRISurfaceNotify(*(xp_surface_id *) arg, kind);
}
break;
+ case XP_EVENT_SPACE_CHANGED:
+ ErrorF("XP_EVENT_SPACE_CHANGED\n");
+ if(arg_size == sizeof(uint32_t)) {
+ uint32_t space_id = *(uint32_t *)arg;
+ QuartzMessageServerThread(kXDarwinSpaceChanged, 1, space_id);
+ }
+ break;
default:
ErrorF("Unknown XP_EVENT type (%d) in xprScreen:eventHandler\n", type);
}
@@ -233,7 +241,8 @@ xprDisplayInit(void)
| XP_EVENT_WINDOW_STATE_CHANGED
| XP_EVENT_WINDOW_MOVED
| XP_EVENT_SURFACE_CHANGED
- | XP_EVENT_SURFACE_DESTROYED,
+ | XP_EVENT_SURFACE_DESTROYED
+ | XP_EVENT_SPACE_CHANGED,
eventHandler, NULL);
AppleDRIExtensionInit();