diff options
Diffstat (limited to 'xorg-server')
-rw-r--r-- | xorg-server/Xext/xres.c | 3 | ||||
-rw-r--r-- | xorg-server/glx/glapi_gentable.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/modes/xf86Rotate.c | 11 | ||||
-rw-r--r-- | xorg-server/hw/xfree86/sdksyms.sh | 3 | ||||
-rw-r--r-- | xorg-server/hw/xquartz/X11Application.m | 154 | ||||
-rw-r--r-- | xorg-server/hw/xquartz/console_redirect.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/xquartz/darwin.c | 57 | ||||
-rw-r--r-- | xorg-server/hw/xquartz/darwinEvents.c | 210 | ||||
-rw-r--r-- | xorg-server/hw/xquartz/darwinEvents.h | 13 | ||||
-rw-r--r-- | xorg-server/hw/xquartz/mach-startup/bundle-main.c | 2 | ||||
-rw-r--r-- | xorg-server/hw/xquartz/xpr/xprFrame.c | 2 | ||||
-rw-r--r-- | xorg-server/include/os.h | 3 | ||||
-rw-r--r-- | xorg-server/test/Makefile.am | 5 |
13 files changed, 283 insertions, 184 deletions
diff --git a/xorg-server/Xext/xres.c b/xorg-server/Xext/xres.c index 7b2e609bd..a390227b0 100644 --- a/xorg-server/Xext/xres.c +++ b/xorg-server/Xext/xres.c @@ -29,7 +29,10 @@ #include <string.h> #include "hashtable.h" #include "picturestr.h" + +#ifdef COMPOSITE #include "compint.h" +#endif /** @brief Holds fragments of responses for ConstructClientIds. * diff --git a/xorg-server/glx/glapi_gentable.c b/xorg-server/glx/glapi_gentable.c index 9c108c03e..b8466aa65 100644 --- a/xorg-server/glx/glapi_gentable.c +++ b/xorg-server/glx/glapi_gentable.c @@ -105,7 +105,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) { struct _glapi_table *
_glapi_create_table_from_handle(void *handle, const char *symbol_prefix) {
- struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table));
+ struct _glapi_table *disp = calloc(_glapi_get_dispatch_table_size(), sizeof(void*));
char symboln[512];
if(!disp)
diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c index 85d75573d..cbc868735 100644 --- a/xorg-server/hw/xfree86/modes/xf86Rotate.c +++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c @@ -290,14 +290,19 @@ xf86RotateDestroy(xf86CrtcPtr crtc) * Clean up damage structures when no crtcs are rotated */ if (xf86_config->rotation_damage) { + DrawablePtr screenDrawable = NULL; + if (pScreen && pScreen->root) + screenDrawable = &pScreen->root->drawable; /* Free damage structure */ if (xf86_config->rotation_damage_registered) { - DamageUnregister(&pScreen->root->drawable, - xf86_config->rotation_damage); + if (screenDrawable) + DamageUnregister(screenDrawable, + xf86_config->rotation_damage); xf86_config->rotation_damage_registered = FALSE; DisableLimitedSchedulingLatency(); } - DamageDestroy(xf86_config->rotation_damage); + if (screenDrawable) + DamageDestroy(xf86_config->rotation_damage); xf86_config->rotation_damage = NULL; } } diff --git a/xorg-server/hw/xfree86/sdksyms.sh b/xorg-server/hw/xfree86/sdksyms.sh index 3815525fa..f6c3f2244 100644 --- a/xorg-server/hw/xfree86/sdksyms.sh +++ b/xorg-server/hw/xfree86/sdksyms.sh @@ -251,8 +251,9 @@ cat > sdksyms.c << EOF #include "exa.h" */ - +#ifdef COMPOSITE #include "compositeext.h" +#endif /* xfixes/Makefile.am */ #include "xfixes.h" diff --git a/xorg-server/hw/xquartz/X11Application.m b/xorg-server/hw/xquartz/X11Application.m index a203f7807..0c3283ed0 100644 --- a/xorg-server/hw/xquartz/X11Application.m +++ b/xorg-server/hw/xquartz/X11Application.m @@ -215,9 +215,8 @@ message_kit_thread(SEL selector, NSObject *arg) if (state) { if (bgMouseLocationUpdated) { DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, - bgMouseLocation.x, bgMouseLocation.y, 0.0, - 0.0, - 0.0); + bgMouseLocation.x, bgMouseLocation.y, + 0.0, 0.0); bgMouseLocationUpdated = FALSE; } DarwinSendDDXEvent(kXquartzActivate, 0); @@ -1549,9 +1548,9 @@ handle_mouse: if ([e isEnteringProximity]) needsProximityIn = YES; else - DarwinSendProximityEvents(darwinTabletCurrent, ProximityOut, - location.x, location.y, pressure, - tilt.x, tilt.y); + DarwinSendTabletEvents(darwinTabletCurrent, ProximityOut, 0, + location.x, location.y, pressure, + tilt.x, tilt.y); return; } @@ -1563,9 +1562,9 @@ handle_mouse: pDev = darwinTabletCurrent; if (needsProximityIn) { - DarwinSendProximityEvents(darwinTabletCurrent, ProximityIn, - location.x, location.y, pressure, - tilt.x, tilt.y); + DarwinSendTabletEvents(darwinTabletCurrent, ProximityIn, 0, + location.x, location.y, pressure, + tilt.x, tilt.y); needsProximityIn = NO; } @@ -1596,14 +1595,22 @@ handle_mouse: if (bgMouseLocationUpdated) { if (!(ev_type == MotionNotify && ev_button == 0)) { - DarwinSendPointerEvents(pDev, MotionNotify, 0, location.x, - location.y, pressure, tilt.x, tilt.y); + DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, + location.x, location.y, + 0.0, 0.0); } bgMouseLocationUpdated = FALSE; } - DarwinSendPointerEvents(pDev, ev_type, ev_button, location.x, - location.y, pressure, tilt.x, tilt.y); + if (pDev == darwinPointer) { + DarwinSendPointerEvents(pDev, ev_type, ev_button, + location.x, location.y, + [e deltaX], [e deltaY]); + } else { + DarwinSendTabletEvents(pDev, ev_type, ev_button, + location.x, location.y, pressure, + tilt.x, tilt.y); + } break; @@ -1627,15 +1634,35 @@ handle_mouse: if ([e isEnteringProximity]) needsProximityIn = YES; else - DarwinSendProximityEvents(darwinTabletCurrent, ProximityOut, - location.x, location.y, pressure, - tilt.x, tilt.y); + DarwinSendTabletEvents(darwinTabletCurrent, ProximityOut, 0, + location.x, location.y, pressure, + tilt.x, tilt.y); break; case NSScrollWheel: { - float deltaX = [e deltaX]; - float deltaY = [e deltaY]; + CGFloat deltaX = [e deltaX]; + CGFloat deltaY = [e deltaY]; + CGEventRef cge = [e CGEvent]; + BOOL isContinuous = + CGEventGetIntegerValueField(cge, kCGScrollWheelEventIsContinuous); + +#if 0 + /* Scale the scroll value by line height */ + CGEventSourceRef source = CGEventCreateSourceFromEvent(cge); + if (source) { + double lineHeight = CGEventSourceGetPixelsPerLine(source); + CFRelease(source); + + /* There's no real reason for the 1/5 ratio here other than that + * it feels like a good ratio after some testing. + */ + + deltaX *= lineHeight / 5.0; + deltaY *= lineHeight / 5.0; + } +#endif + #if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION == 0 /* If we're in the background, we need to send a MotionNotify event * first, since we aren't getting them on background mouse motion @@ -1643,8 +1670,8 @@ handle_mouse: if (!XQuartzServerVisible && noTestExtensions) { bgMouseLocationUpdated = FALSE; DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, - location.x, location.y, pressure, - tilt.x, tilt.y); + location.x, location.y, + 0.0, 0.0); } #endif #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 @@ -1656,6 +1683,93 @@ handle_mouse: deltaY *= -1; } #endif + /* This hack is in place to better deal with "clicky" scroll wheels: + * http://xquartz.macosforge.org/trac/ticket/562 + */ + if (!isContinuous) { + static NSTimeInterval lastScrollTime = 0.0; + + /* These store how much extra we have already scrolled. + * ie, this is how much we ignore on the next event. + */ + static double deficit_x = 0.0; + static double deficit_y = 0.0; + + /* If we have past a second since the last scroll, wipe the slate + * clean + */ + if ([e timestamp] - lastScrollTime > 1.0) { + deficit_x = deficit_y = 0.0; + } + lastScrollTime = [e timestamp]; + + if (deltaX != 0.0) { + /* If we changed directions, wipe the slate clean */ + if ((deficit_x < 0.0 && deltaX > 0.0) || + (deficit_x > 0.0 && deltaX < 0.0)) { + deficit_x = 0.0; + } + + /* Eat up the deficit, but ensure that something is + * always sent + */ + if (fabs(deltaX) > fabs(deficit_x)) { + deltaX -= deficit_x; + + if (deltaX > 0.0) { + deficit_x = ceil(deltaX) - deltaX; + deltaX = ceil(deltaX); + } else { + deficit_x = floor(deltaX) - deltaX; + deltaX = floor(deltaX); + } + } else { + deficit_x -= deltaX; + + if (deltaX > 0.0) { + deltaX = 1.0; + } else { + deltaX = -1.0; + } + + deficit_x += deltaX; + } + } + + if (deltaY != 0.0) { + /* If we changed directions, wipe the slate clean */ + if ((deficit_y < 0.0 && deltaY > 0.0) || + (deficit_y > 0.0 && deltaY < 0.0)) { + deficit_y = 0.0; + } + + /* Eat up the deficit, but ensure that something is + * always sent + */ + if (fabs(deltaY) > fabs(deficit_y)) { + deltaY -= deficit_y; + + if (deltaY > 0.0) { + deficit_y = ceil(deltaY) - deltaY; + deltaY = ceil(deltaY); + } else { + deficit_y = floor(deltaY) - deltaY; + deltaY = floor(deltaY); + } + } else { + deficit_y -= deltaY; + + if (deltaY > 0.0) { + deltaY = 1.0; + } else { + deltaY = -1.0; + } + + deficit_y += deltaY; + } + } + } + DarwinSendScrollEvents(deltaX, deltaY); break; } diff --git a/xorg-server/hw/xquartz/console_redirect.c b/xorg-server/hw/xquartz/console_redirect.c index 7b92eca39..1e0e56bad 100644 --- a/xorg-server/hw/xquartz/console_redirect.c +++ b/xorg-server/hw/xquartz/console_redirect.c @@ -336,7 +336,7 @@ xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd) { /* Reallocate if we need more space */ if (fd >= n_redirect_fds) { - size_t new_n = 1 << (ffs(fd) + 1); + size_t new_n = 1 << (fls(fd) + 1); asl_redirect *new_array = realloc(redirect_fds, new_n * sizeof(*redirect_fds)); diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c index 03030ad22..41db72af8 100644 --- a/xorg-server/hw/xquartz/darwin.c +++ b/xorg-server/hw/xquartz/darwin.c @@ -309,7 +309,7 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) { #define NBUTTONS 3 -#define NAXES 4 +#define NAXES 6 // 3 buttons: left, middle, right CARD8 map[NBUTTONS + 1] = { 0, 1, 2, 3}; Atom btn_labels[NBUTTONS] = { 0 }; @@ -323,10 +323,12 @@ DarwinMouseProc(DeviceIntPtr pPointer, int what) btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE); btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT); - axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); - axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); - axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_WHEEL); - axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HWHEEL); + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); + axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); + axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); + axes_labels[4] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_WHEEL); + axes_labels[5] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HWHEEL); // Set button map. InitPointerDeviceStruct((DevicePtr)pPointer, map, NBUTTONS, @@ -334,21 +336,27 @@ DarwinMouseProc(DeviceIntPtr pPointer, int what) (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), NAXES, axes_labels); - InitValuatorAxisStruct(pPointer, 0, axes_labels[0], + InitValuatorAxisStruct(pPointer, 0, axes_labels[0], NO_AXIS_LIMITS, NO_AXIS_LIMITS, - 1, 0, 1, Relative); - InitValuatorAxisStruct(pPointer, 1, axes_labels[1], + 0, 0, 0, Absolute); + InitValuatorAxisStruct(pPointer, 1, axes_labels[1], NO_AXIS_LIMITS, NO_AXIS_LIMITS, - 1, 0, 1, Relative); + 0, 0, 0, Absolute); InitValuatorAxisStruct(pPointer, 2, axes_labels[2], NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); InitValuatorAxisStruct(pPointer, 3, axes_labels[3], NO_AXIS_LIMITS, NO_AXIS_LIMITS, 1, 0, 1, Relative); + InitValuatorAxisStruct(pPointer, 4, axes_labels[4], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, + 1, 0, 1, Relative); + InitValuatorAxisStruct(pPointer, 5, axes_labels[5], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, + 1, 0, 1, Relative); - SetScrollValuator(pPointer, 2, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_PREFERRED); - SetScrollValuator(pPointer, 3, SCROLL_TYPE_HORIZONTAL, -1.0, SCROLL_FLAG_NONE); + SetScrollValuator(pPointer, 4, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_PREFERRED); + SetScrollValuator(pPointer, 5, SCROLL_TYPE_HORIZONTAL, -1.0, SCROLL_FLAG_NONE); break; case DEVICE_ON: @@ -399,23 +407,24 @@ DarwinTabletProc(DeviceIntPtr pPointer, int what) axes_labels); InitProximityClassDeviceStruct(pPointer); - InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, - XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, - Absolute); - InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, - XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, - Absolute); - InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, - XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, - Absolute); + InitValuatorAxisStruct(pPointer, 0, axes_labels[0], + 0, XQUARTZ_VALUATOR_LIMIT, + 1, 0, 1, Absolute); + InitValuatorAxisStruct(pPointer, 1, axes_labels[1], + 0, XQUARTZ_VALUATOR_LIMIT, + 1, 0, 1, Absolute); + InitValuatorAxisStruct(pPointer, 2, axes_labels[2], + 0, XQUARTZ_VALUATOR_LIMIT, + 1, 0, 1, Absolute); InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, - XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, - Absolute); + XQUARTZ_VALUATOR_LIMIT, + 1, 0, 1, Absolute); InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, - XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, - Absolute); + XQUARTZ_VALUATOR_LIMIT, + 1, 0, 1, Absolute); + // pPointer->use = IsXExtensionDevice; break; diff --git a/xorg-server/hw/xquartz/darwinEvents.c b/xorg-server/hw/xquartz/darwinEvents.c index c62dd4484..b41c6fdac 100644 --- a/xorg-server/hw/xquartz/darwinEvents.c +++ b/xorg-server/hw/xquartz/darwinEvents.c @@ -44,19 +44,20 @@ #include <dix-config.h> #endif -#include <X11/X.h> -#include <X11/Xmd.h> -#include <X11/Xproto.h> -#include "misc.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "inputstr.h" -#include "inpututils.h" -#include "eventstr.h" -#include "mi.h" -#include "scrnintstr.h" -#include "mipointer.h" -#include "os.h" +#include <X11/X.h> +#include <X11/Xmd.h> +#include <X11/Xproto.h> +#include "misc.h" +#include "windowstr.h" +#include "pixmapstr.h" +#include "inputstr.h" +#include "inpututils.h" +#include "eventstr.h" +#include "mi.h" +#include "scrnintstr.h" +#include "mipointer.h" +#include "os.h" +#include "exglobals.h" #include "darwin.h" #include "quartz.h" @@ -73,12 +74,6 @@ #include <IOKit/hidsystem/IOLLEvent.h> -/* Fake button press/release for scroll wheel move. */ -#define SCROLLWHEELUPFAKE 4 -#define SCROLLWHEELDOWNFAKE 5 -#define SCROLLWHEELLEFTFAKE 6 -#define SCROLLWHEELRIGHTFAKE 7 - #include <X11/extensions/applewmconst.h> #include "applewmExt.h" @@ -442,56 +437,6 @@ DarwinPokeEQ(void) write(darwinEventWriteFD, &nullbyte, sizeof(nullbyte)); } -/* Convert from Appkit pointer input values to X input values: - * Note: pointer_x and pointer_y are relative to the upper-left of primary - * display. - */ -static void -DarwinPrepareValuators(DeviceIntPtr pDev, ValuatorMask *pmask, - ScreenPtr screen, - double pointer_x, double pointer_y, - double pressure, double tilt_x, - double tilt_y) -{ - - valuator_mask_zero(pmask); - - /* Fix offset between darwin and X screens */ - pointer_x -= darwinMainScreenX + screen->x; - pointer_y -= darwinMainScreenY + screen->y; - - if (pointer_x < 0.0) - pointer_x = 0.0; - - if (pointer_y < 0.0) - pointer_y = 0.0; - - if (pDev == darwinPointer) { - valuator_mask_set_double(pmask, 0, pointer_x); - valuator_mask_set_double(pmask, 1, pointer_y); - } - else { - valuator_mask_set_double(pmask, 0, XQUARTZ_VALUATOR_LIMIT * - (pointer_x / - (double)screenInfo.screens[0]->width)); - valuator_mask_set_double(pmask, 1, XQUARTZ_VALUATOR_LIMIT * - (pointer_y / - (double)screenInfo.screens[0]->height)); - valuator_mask_set_double(pmask, 2, XQUARTZ_VALUATOR_LIMIT * pressure); - valuator_mask_set_double(pmask, 3, XQUARTZ_VALUATOR_LIMIT * tilt_x); - valuator_mask_set_double(pmask, 4, XQUARTZ_VALUATOR_LIMIT * tilt_y); - DEBUG_LOG("Pointer (%lf, %lf), Valuators: {%lf,%lf,%lf,%lf,%lf}\n", - pointer_x, pointer_y, - valuator_mask_get_double(pmask, - 0), - valuator_mask_get_double(pmask, 1), - valuator_mask_get_double(pmask, - 2), - valuator_mask_get_double(pmask, 3), - valuator_mask_get_double(pmask, 4)); - } -} - void DarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev) { @@ -521,27 +466,73 @@ DarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev) } void +DarwinSendTabletEvents(DeviceIntPtr pDev, int ev_type, int ev_button, + double pointer_x, double pointer_y, + double pressure, double tilt_x, + double tilt_y) +{ + ScreenPtr screen; + ValuatorMask valuators; + + if (!darwinEvents) { + DEBUG_LOG("%s called before darwinEvents was initialized\n", + __FUNCTION__); + return; + } + + screen = miPointerGetScreen(pDev); + if (!screen) { + DEBUG_LOG("%s called before screen was initialized\n", + __FUNCTION__); + return; + } + + /* Fix offset between darwin and X screens */ + pointer_x -= darwinMainScreenX + screen->x; + pointer_y -= darwinMainScreenY + screen->y; + + /* Adjust our pointer location to the [0,1] range */ + pointer_x = pointer_x / (double)screenInfo.width; + pointer_y = pointer_y / (double)screenInfo.height; + + valuator_mask_zero(&valuators); + valuator_mask_set_double(&valuators, 0, XQUARTZ_VALUATOR_LIMIT * pointer_x); + valuator_mask_set_double(&valuators, 1, XQUARTZ_VALUATOR_LIMIT * pointer_y); + valuator_mask_set_double(&valuators, 2, XQUARTZ_VALUATOR_LIMIT * pressure); + valuator_mask_set_double(&valuators, 3, XQUARTZ_VALUATOR_LIMIT * tilt_x); + valuator_mask_set_double(&valuators, 4, XQUARTZ_VALUATOR_LIMIT * tilt_y); + + darwinEvents_lock(); + { + if (ev_type == ProximityIn || ev_type == ProximityOut) { + QueueProximityEvents(pDev, ev_type, &valuators); + } else { + QueuePointerEvents(pDev, ev_type, ev_button, POINTER_ABSOLUTE, + &valuators); + } + DarwinPokeEQ(); + } darwinEvents_unlock(); +} + +void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, double pointer_x, double pointer_y, - double pressure, double tilt_x, - double tilt_y) + double pointer_dx, double pointer_dy) { static int darwinFakeMouseButtonDown = 0; ScreenPtr screen; ValuatorMask valuators; - //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"); + DEBUG_LOG("%s called before darwinEvents was initialized\n", + __FUNCTION__); return; } screen = miPointerGetScreen(pDev); if (!screen) { - DEBUG_LOG( - "DarwinSendPointerEvents called before screen was initialized\n"); + DEBUG_LOG("%s called before screen was initialized\n", + __FUNCTION__); return; } @@ -550,9 +541,8 @@ DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, if (darwinFakeMouseButtonDown != 0) { /* We're currently "down" with another button, so release it first */ DarwinSendPointerEvents(pDev, ButtonRelease, - darwinFakeMouseButtonDown, pointer_x, - pointer_y, pressure, tilt_x, - tilt_y); + darwinFakeMouseButtonDown, + pointer_x, pointer_y, 0.0, 0.0); darwinFakeMouseButtonDown = 0; } if (darwin_all_modifier_flags & darwinFakeMouse2Mask) { @@ -586,15 +576,27 @@ DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, darwinFakeMouseButtonDown = 0; } - DarwinPrepareValuators(pDev, &valuators, screen, pointer_x, pointer_y, - pressure, tilt_x, - tilt_y); + /* Fix offset between darwin and X screens */ + pointer_x -= darwinMainScreenX + screen->x; + pointer_y -= darwinMainScreenY + screen->y; + + valuator_mask_zero(&valuators); + valuator_mask_set_double(&valuators, 0, pointer_x); + valuator_mask_set_double(&valuators, 1, pointer_y); + + if (ev_type == MotionNotify) { + if (pointer_dx != 0.0) + valuator_mask_set_double(&valuators, 2, pointer_dx); + if (pointer_dy != 0.0) + valuator_mask_set_double(&valuators, 3, pointer_dy); + } + darwinEvents_lock(); { QueuePointerEvents(pDev, ev_type, ev_button, POINTER_ABSOLUTE, &valuators); DarwinPokeEQ(); - } darwinEvents_unlock(); + } darwinEvents_unlock(); } void @@ -615,42 +617,6 @@ DarwinSendKeyboardEvents(int ev_type, int keycode) } darwinEvents_unlock(); } -void -DarwinSendProximityEvents(DeviceIntPtr pDev, int ev_type, double pointer_x, - double pointer_y, - double pressure, double tilt_x, - double tilt_y) -{ - ScreenPtr screen; - ValuatorMask valuators; - - DEBUG_LOG("DarwinSendProximityEvents: %d l:%f,%f p:%f t:%f,%f\n", ev_type, - pointer_x, pointer_y, pressure, tilt_x, - tilt_y); - - if (!darwinEvents) { - DEBUG_LOG( - "DarwinSendProximityEvents called before darwinEvents was initialized\n"); - return; - } - - screen = miPointerGetScreen(pDev); - if (!screen) { - DEBUG_LOG( - "DarwinSendPointerEvents called before screen was initialized\n"); - return; - } - - DarwinPrepareValuators(pDev, &valuators, screen, pointer_x, pointer_y, - pressure, tilt_x, - tilt_y); - darwinEvents_lock(); - { - QueueProximityEvents(pDev, ev_type, &valuators); - DarwinPokeEQ(); - } darwinEvents_unlock(); -} - /* Send the appropriate number of button clicks to emulate scroll wheel */ void DarwinSendScrollEvents(double scroll_x, double scroll_y) { @@ -671,8 +637,8 @@ DarwinSendScrollEvents(double scroll_x, double scroll_y) { } valuator_mask_zero(&valuators); - valuator_mask_set_double(&valuators, 2, scroll_y); - valuator_mask_set_double(&valuators, 3, scroll_x); + valuator_mask_set_double(&valuators, 4, scroll_y); + valuator_mask_set_double(&valuators, 5, scroll_x); darwinEvents_lock(); { diff --git a/xorg-server/hw/xquartz/darwinEvents.h b/xorg-server/hw/xquartz/darwinEvents.h index 61ace6ee3..448e730bc 100644 --- a/xorg-server/hw/xquartz/darwinEvents.h +++ b/xorg-server/hw/xquartz/darwinEvents.h @@ -44,14 +44,13 @@ DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX); void DarwinInputReleaseButtonsAndKeys(DeviceIntPtr pDev); void -DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, - double pointer_x, double pointer_y, double pressure, - double tilt_x, - double tilt_y); +DarwinSendTabletEvents(DeviceIntPtr pDev, int ev_type, int ev_button, + double pointer_x, double pointer_y, double pressure, + double tilt_x, double tilt_y); void -DarwinSendProximityEvents(DeviceIntPtr pDev, int ev_type, double pointer_x, - double pointer_y, double pressure, double tilt_x, - double tilt_y); +DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, + double pointer_x, double pointer_y, + double pointer_dx, double pointer_dy); void DarwinSendKeyboardEvents(int ev_type, int keycode); void diff --git a/xorg-server/hw/xquartz/mach-startup/bundle-main.c b/xorg-server/hw/xquartz/mach-startup/bundle-main.c index d1ad6f7e3..cabdf1eab 100644 --- a/xorg-server/hw/xquartz/mach-startup/bundle-main.c +++ b/xorg-server/hw/xquartz/mach-startup/bundle-main.c @@ -78,7 +78,7 @@ FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1, 2) _X_NORETURN; extern int noPanoramiXExtension; #define DEFAULT_CLIENT X11BINDIR "/xterm" -#define DEFAULT_STARTX X11BINDIR "/startx" +#define DEFAULT_STARTX X11BINDIR "/startx -- " X11BINDIR "/Xquartz" #define DEFAULT_SHELL "/bin/sh" #ifndef BUILD_DATE diff --git a/xorg-server/hw/xquartz/xpr/xprFrame.c b/xorg-server/hw/xquartz/xpr/xprFrame.c index 4c7aac42b..01f1def20 100644 --- a/xorg-server/hw/xquartz/xpr/xprFrame.c +++ b/xorg-server/hw/xquartz/xpr/xprFrame.c @@ -212,7 +212,7 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, #else pthread_rwlock_wrlock(&window_hash_rwlock); x_hash_table_insert(window_hash, pFrame->wid, pFrame); - pthread_rwlock_wrlock(&window_hash_rwlock); + pthread_rwlock_unlock(&window_hash_rwlock); #endif xprSetNativeProperty(pFrame); diff --git a/xorg-server/include/os.h b/xorg-server/include/os.h index b8a5f21b9..fdcd95d31 100644 --- a/xorg-server/include/os.h +++ b/xorg-server/include/os.h @@ -323,7 +323,8 @@ extern _X_EXPORT void OsCleanup(Bool); extern _X_EXPORT void -OsVendorFatalError(const char *f, va_list args); +OsVendorFatalError(const char *f, va_list args) +_X_ATTRIBUTE_PRINTF(1, 0); extern _X_EXPORT void OsVendorInit(void); diff --git a/xorg-server/test/Makefile.am b/xorg-server/test/Makefile.am index 8c7e412c3..85823977b 100644 --- a/xorg-server/test/Makefile.am +++ b/xorg-server/test/Makefile.am @@ -54,8 +54,6 @@ libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ @XORG_LIBS@ -EXTRA_DIST = ddxstubs.c - else nodist_libxservertest_la_SOURCES = \ ddxstubs.c \ @@ -111,3 +109,6 @@ endif libxservertest_la_DEPENDENCIES = $(libxservertest_la_LIBADD) endif + +EXTRA_DIST = ddxstubs.c + |