From 93298c7f8f73bdb9892da0e41d2c2a67719dc736 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Fri, 31 Oct 2008 12:55:46 -0700 Subject: [PATCH] XQuartz: Don't map the menu bar to the screen area. (cherry picked from commit 1115917ada127a1cd6a8b61efe7fd134e2ea85fd) --- hw/xquartz/darwinEvents.c | 10 ++++++++-- hw/xquartz/xpr/xprScreen.c | 10 ++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index 6ec8c0f22..3303825c4 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 7d5303bdb..6f8cc302a 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); }