From 652479dba38470273313dc46f17e3bcb1bc5e383 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Thu, 17 Apr 2008 15:49:13 -0700 Subject: [PATCH] XQuartz: Moved some rootless-specific cruft into xpr (cherry picked from commit 31625cc03b58317120c2ac7877e227e2322e1de8) --- hw/xquartz/darwinEvents.c | 32 +++++++------------------------- hw/xquartz/darwinEvents.h | 3 --- hw/xquartz/xpr/Makefile.am | 4 +++- hw/xquartz/xpr/xpr.h | 2 ++ hw/xquartz/xpr/xprScreen.c | 4 +--- 5 files changed, 13 insertions(+), 32 deletions(-) diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index c59359625..589ca79f5 100644 --- a/hw/xquartz/darwinEvents.c +++ b/hw/xquartz/darwinEvents.c @@ -69,10 +69,8 @@ in this Software without prior written authorization from The Open Group. #include "applewmExt.h" #include -/* FIXME: Abstract this away into xpr */ -#include -#include "rootlessWindow.h" -WindowPtr xprGetXWindow(xp_window_id wid); +/* FIXME: Abstract this better */ +void QuartzModeEQInit(void); int input_check_zero, input_check_flag; @@ -218,7 +216,7 @@ static void DarwinSimulateMouseClick( be moved into their own individual functions and set as handlers using mieqSetHandler. */ -void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) { +static void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int nevents) { int i; TA_SERVER(); @@ -259,18 +257,7 @@ void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int neven AppleWMIsInactive, 0); QuartzHide(); break; - - case kXquartzWindowState: - DEBUG_LOG("kXquartzWindowState\n"); - RootlessNativeWindowStateChanged(xprGetXWindow(xe[i].u.clientMessage.u.l.longs0), - xe[i].u.clientMessage.u.l.longs1); - break; - - case kXquartzWindowMoved: - DEBUG_LOG("kXquartzWindowMoved\n"); - RootlessNativeWindowMoved ((WindowPtr)xe[i].u.clientMessage.u.l.longs0); - break; - + case kXquartzToggleFullscreen: DEBUG_LOG("kXquartzToggleFullscreen\n"); #ifdef DARWIN_DDX_MISSING @@ -304,11 +291,6 @@ void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int neven GiveUp(0); break; - case kXquartzBringAllToFront: - DEBUG_LOG("kXquartzBringAllToFront\n"); - RootlessOrderAllWindows(); - break; - case kXquartzSpaceChanged: DEBUG_LOG("kXquartzSpaceChanged\n"); QuartzSpaceChanged(xe[i].u.clientMessage.u.l.longs0); @@ -329,7 +311,7 @@ Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) { FatalError("Couldn't allocate event buffer\n"); if((err = pthread_mutex_init(&mieqEnqueue_mutex, NULL))) { - FatalError("Couldn't allocate miEnqueue mutex: %d.\n", err); + FatalError("Couldn't allocate mieqEnqueue mutex: %d.\n", err); } mieqInit(); @@ -346,9 +328,9 @@ Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr) { mieqSetHandler(kXquartzControllerNotify, DarwinEventHandler); mieqSetHandler(kXquartzPasteboardNotify, DarwinEventHandler); mieqSetHandler(kXquartzDisplayChanged, QuartzDisplayChangedHandler); - mieqSetHandler(kXquartzWindowState, DarwinEventHandler); - mieqSetHandler(kXquartzWindowMoved, DarwinEventHandler); + QuartzModeEQInit(); + return TRUE; } diff --git a/hw/xquartz/darwinEvents.h b/hw/xquartz/darwinEvents.h index c87d667f9..dd3f81c30 100644 --- a/hw/xquartz/darwinEvents.h +++ b/hw/xquartz/darwinEvents.h @@ -41,7 +41,4 @@ void DarwinSendScrollEvents(float count_x, float count_y, int pointer_x, int poi float pressure, float tilt_x, float tilt_y); void DarwinUpdateModKeys(int flags); -void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, - int nevents); - #endif /* _DARWIN_EVENTS_H */ diff --git a/hw/xquartz/xpr/Makefile.am b/hw/xquartz/xpr/Makefile.am index f6ede8b18..3e2e6058c 100644 --- a/hw/xquartz/xpr/Makefile.am +++ b/hw/xquartz/xpr/Makefile.am @@ -11,6 +11,7 @@ Xquartz_SOURCES = \ dri.c \ xprAppleWM.c \ xprCursor.c \ + xprEvent.c \ xprFrame.c \ xprScreen.c \ x-hash.c \ @@ -71,4 +72,5 @@ EXTRA_DIST = \ x-hash.h \ x-hook.h \ x-list.h \ - xpr.h + xpr.h \ + xprEvent.h diff --git a/hw/xquartz/xpr/xpr.h b/hw/xquartz/xpr/xpr.h index b8c69df0d..7b7923ca2 100644 --- a/hw/xquartz/xpr/xpr.h +++ b/hw/xquartz/xpr/xpr.h @@ -30,6 +30,7 @@ #define XPR_H #include "screenint.h" +#include Bool QuartzModeBundleInit(void); @@ -37,6 +38,7 @@ void AppleDRIExtensionInit(void); void xprAppleWMInit(void); Bool xprInit(ScreenPtr pScreen); Bool xprIsX11Window(void *nsWindow, int windowNumber); +WindowPtr xprGetXWindow(xp_window_id wid); void xprHideWindows(Bool hide); diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c index fccaff035..82190463c 100644 --- a/hw/xquartz/xpr/xprScreen.c +++ b/hw/xquartz/xpr/xprScreen.c @@ -35,6 +35,7 @@ #include "inputstr.h" #include "quartz.h" #include "xpr.h" +#include "xprEvent.h" #include "pseudoramiX.h" #include "darwin.h" #include "rootless.h" @@ -44,9 +45,6 @@ #include "applewmExt.h" #include "micmap.h" -// From xprFrame.c -WindowPtr xprGetXWindow(xp_window_id wid); - #ifdef DAMAGE # include "damage.h" #endif