xserver: Branch 'master' - 13 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Nov 1 13:40:56 PDT 2012


 Xi/chgdctl.c                   |    3 ++-
 Xi/exevents.c                  |    5 +++++
 Xi/xiproperty.c                |    3 +++
 configure.ac                   |    4 ++--
 dix/getevents.c                |    5 +++--
 dix/touch.c                    |    4 ++--
 doc/c-extensions               |   19 +++++++++++++------
 hw/xfree86/common/xf86Events.c |    2 +-
 hw/xwin/winprefs.c             |    2 ++
 include/xserver-properties.h   |    3 +++
 os/utils.c                     |   20 ++++++++++++++++++++
 xkb/xkbAccessX.c               |    2 +-
 12 files changed, 57 insertions(+), 15 deletions(-)

New commits:
commit a194630f7f7b287cb4ea4a459df0745f4c0d4c1a
Merge: 74a3130... d511a30...
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Nov 1 13:38:54 2012 -0700

    Merge remote-tracking branch 'whot/for-keith'

commit d511a3016a79c50cb38e7504d4831a9ae128e422
Author: Benjamin Tissoires <benjamin.tissoires at gmail.com>
Date:   Fri Oct 26 16:27:34 2012 +0200

    Add missing labels for multitouch valuators
    
    ABS_MT_DISTANCE exists since kernel v2.6.38,
    ABS_MT_TOOL_X|Y appeared in v3.6.
    
    Signed-off-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index 43351bc..796ba09 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -105,6 +105,9 @@ static struct dev_properties {
     {0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID},
     {0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID},
     {0, AXIS_LABEL_PROP_ABS_MT_PRESSURE},
+    {0, AXIS_LABEL_PROP_ABS_MT_DISTANCE},
+    {0, AXIS_LABEL_PROP_ABS_MT_TOOL_X},
+    {0, AXIS_LABEL_PROP_ABS_MT_TOOL_Y},
     {0, AXIS_LABEL_PROP_ABS_MISC},
     {0, BTN_LABEL_PROP},
     {0, BTN_LABEL_PROP_BTN_UNKNOWN},
diff --git a/include/xserver-properties.h b/include/xserver-properties.h
index 85f2ce5..bf48fab 100644
--- a/include/xserver-properties.h
+++ b/include/xserver-properties.h
@@ -118,6 +118,9 @@
 #define AXIS_LABEL_PROP_ABS_MT_BLOB_ID     "Abs MT Blob ID"
 #define AXIS_LABEL_PROP_ABS_MT_TRACKING_ID "Abs MT Tracking ID"
 #define AXIS_LABEL_PROP_ABS_MT_PRESSURE    "Abs MT Pressure"
+#define AXIS_LABEL_PROP_ABS_MT_DISTANCE    "Abs MT Distance"
+#define AXIS_LABEL_PROP_ABS_MT_TOOL_X      "Abs MT Tool X"
+#define AXIS_LABEL_PROP_ABS_MT_TOOL_Y      "Abs MT Tool Y"
 #define AXIS_LABEL_PROP_ABS_MISC        "Abs Misc"
 
 /* Button names */
commit ced56f322ead10d1bc93fcd1f8e0ec3ae51292a3
Author: Carlos Garnacho <carlosg at gnome.org>
Date:   Thu Oct 25 15:03:50 2012 +0200

    Sync TouchListener memory allocation with population in TouchSetupListeners()
    
    The allocated TouchListener array may fall short by 1 if hitting the worst case
    situation where there's an active grab, passive grabs on each window in the
    sprite trace and event selection for touch in one of the windows. This may lead
    to memory corruptions as the array is overflown.
    
    Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/touch.c b/dix/touch.c
index e64a626..5f77be5 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -572,8 +572,8 @@ TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
         return FALSE;
 
     /* Mark which grabs/event selections we're delivering to: max one grab per
-     * window plus the bottom-most event selection. */
-    ti->listeners = calloc(sprite->spriteTraceGood + 1, sizeof(*ti->listeners));
+     * window plus the bottom-most event selection, plus any active grab. */
+    ti->listeners = calloc(sprite->spriteTraceGood + 2, sizeof(*ti->listeners));
     if (!ti->listeners) {
         sprite->spriteTraceGood = 0;
         return FALSE;
commit 74a3130426d7e1b456e45daa517769cd3e4b58c0
Merge: 1ca096d... f32ad6d...
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Oct 29 09:09:16 2012 -0700

    Merge remote-tracking branch 'jturney/master'

commit f32ad6dd314a587c301b7f1a6e4ee74e5d8cc06c
Author: Ryan Pavlik <rpavlik at iastate.edu>
Date:   Fri Oct 21 12:32:49 2011 -0500

    os/utils.c: Provide only stubs for Lock/UnlockServer on WIN32
    
    MinGW and MSVC lack the POSIX functions to compile the lock file code.
    
    Signed-off-by: Ryan Pavlik <rpavlik at iastate.edu>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>

diff --git a/os/utils.c b/os/utils.c
index 04bcbc6..3c520ad 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -235,6 +235,19 @@ OsSignal(int sig, OsSigHandlerPtr handler)
 #define LOCK_PREFIX "/.X"
 #define LOCK_SUFFIX "-lock"
 
+#if !defined(WIN32) || defined(__CYGWIN__)
+#define LOCK_SERVER
+#endif
+
+#ifndef LOCK_SERVER
+void
+LockServer(void)
+{}
+
+void
+UnlockServer(void)
+{}
+#else /* LOCK_SERVER */
 static Bool StillLocking = FALSE;
 static char LockFile[PATH_MAX];
 static Bool nolock = FALSE;
@@ -382,6 +395,7 @@ UnlockServer(void)
         (void) unlink(LockFile);
     }
 }
+#endif /* LOCK_SERVER */
 
 /* Force connections to close on SIGHUP from init */
 
@@ -503,7 +517,9 @@ UseMsg(void)
 #ifdef RLIMIT_STACK
     ErrorF("-ls int                limit stack space to N Kb\n");
 #endif
+#ifdef LOCK_SERVER
     ErrorF("-nolock                disable the locking mechanism\n");
+#endif
     ErrorF("-nolisten string       don't listen on protocol\n");
     ErrorF("-noreset               don't reset after last client exists\n");
     ErrorF("-background [none]     create root window with no background\n");
@@ -664,7 +680,9 @@ ProcessCommandLine(int argc, char *argv[])
             if (++i < argc) {
                 displayfd = atoi(argv[i]);
                 display = NULL;
+#ifdef LOCK_SERVER
                 nolock = TRUE;
+#endif
             }
             else
                 UseMsg();
@@ -744,6 +762,7 @@ ProcessCommandLine(int argc, char *argv[])
                 UseMsg();
         }
 #endif
+#ifdef LOCK_SERVER
         else if (strcmp(argv[i], "-nolock") == 0) {
 #if !defined(WIN32) && !defined(__CYGWIN__)
             if (getuid() != 0)
@@ -753,6 +772,7 @@ ProcessCommandLine(int argc, char *argv[])
 #endif
                 nolock = TRUE;
         }
+#endif
         else if (strcmp(argv[i], "-nolisten") == 0) {
             if (++i < argc) {
                 if (_XSERVTransNoListen(argv[i]))
commit 74735c5ebff15db8891808068fe8569d8ccde9e7
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Sat Feb 18 20:37:19 2012 +0000

    hw/xwin: fmemopen is available on cygwin but not MinGW
    
    This is a follow-up to commit 0659437f5ec0e3f646373394f5f9c5461e2170f3.
    
    Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>

diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index dbc5b52..6cbd7ad 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -645,6 +645,7 @@ winPrefsLoadPreferences(char *path)
 
     if (path)
         prefFile = fopen(path, "r");
+#ifdef __CYGWIN__
     else {
         char defaultPrefs[] =
             "MENU rmenu {\n"
@@ -656,6 +657,7 @@ winPrefsLoadPreferences(char *path)
         path = "built-in default";
         prefFile = fmemopen(defaultPrefs, strlen(defaultPrefs), "r");
     }
+#endif
 
     if (!prefFile) {
         ErrorF("LoadPreferences: %s not found\n", path);
commit 748be9da20a8bf3dd99701a95eac7ee3895a28de
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Tue May 1 20:08:41 2012 +0100

    doc: Update documentation about Windows platforms support a bit
    
    Update what c-extensions says about Windows platforms support a bit:
    - Document that MinGW Win32 gets let off being POSIX-compilant
    - Document the minimum Windows version supported
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/doc/c-extensions b/doc/c-extensions
index eb33e27..4a90061 100644
--- a/doc/c-extensions
+++ b/doc/c-extensions
@@ -35,7 +35,7 @@ The server will not build if your toolchain does not support these extensions.
     * interleaved code and declarations: { foo = TRUE; int bar; do_stuff(); }
 
 
-Use of OS and library facilities throughout the X server tree
+Use of library facilities throughout the X server tree
 -------------------------------------------------------------
 
 Non-OS-dependent code can assume facilities at least as good as
@@ -44,6 +44,17 @@ be C99, but even gcc+glibc doesn't implement that yet.
 
 Unix-like systems are assumed to be at least as good as UNIX03.
 
+Note that there are two Windows ports, Cygwin and MinGW:
+- Cygwin is more or less like Linux.
+- MinGW is more restrictive. Windows does not provide the required
+POSIX facilities, so some non-OS-dependent code is stubbed out or
+has an alternate implementation if WIN32 is defined.  Code that
+needs to be portable to Windows should be careful to, well, be portable.
+
+
+Required OS facilities
+-------------------------------------------------------------
+
 Linux systems must be at least 2.4 or later.  As a practical matter
 though, 2.4 kernels never receive any testing.  Use 2.6 already.
 
@@ -51,11 +62,7 @@ TODO: Solaris.
 
 TODO: *BSD.
 
-Code that needs to be portable to Windows should be careful to,
-well, be portable.  Note that there are two Windows ports, cygwin and
-mingw.  Cygwin is more or less like Linux, but mingw is a bit more
-restrictive.  TODO: document which versions of Windows we actually care
-about.
+Windows-dependent code assumes at least NT 5.1.
 
 OSX support is generally limited to the most recent version.  Currently
 that means 10.5.
commit 760be785eb49fed4652950fb55dc07b0a41d87de
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Oct 24 11:20:54 2012 +1000

    xfree86: remove unused variable sigstate
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 3ad34b5..9dabf10 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -376,7 +376,7 @@ static void
 xf86ReleaseKeys(DeviceIntPtr pDev)
 {
     KeyClassPtr keyc;
-    int i, sigstate;
+    int i;
 
     if (!pDev || !pDev->key)
         return;
commit e7cd5cce740e653000fb1192b600268dcf77dde2
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Oct 18 15:11:31 2012 +1000

    dix: fix zaphod screen scrossing (#54654)
    
    POINTER_SCREEN coordinates are screen-relative. For a Zaphod setup, the
    coordinates after a screen crossing are already relative to the new screen's
    origin. Add that offset to the coordinates before re-setting.
    
    regression introduced by
    commit bafbd99080be49a17be97d2cc758fbe623369945
    Author: Peter Hutterer <peter.hutterer at who-t.net>
    Date:   Wed Aug 8 11:34:32 2012 +1000
    
        dix: work around scaling issues during WarpPointer (#53037)
    
    X.Org Bug 54654 <http://bugs.freedesktop.org/show_bug.cgi?id=54654>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/dix/getevents.c b/dix/getevents.c
index 71d83c4..8b4379d 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1400,8 +1400,9 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type,
        coordinates were.
      */
     if (flags & POINTER_SCREEN) {
-        screenx = sx;
-        screeny = sy;
+        scr = miPointerGetScreen(pDev);
+        screenx = sx + scr->x;
+        screeny = sy + scr->y;
     }
 
     scr = positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative,
commit 676447190190d8546165e21be242cf16dd69f5ae
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Oct 17 14:13:29 2012 +1000

    Xi: don't deliver TouchEnd to a client waiting for TouchBegin (#55738)
    
    If a client is still waiting for the TouchBegin, don't deliver a TouchEnd
    event.
    
    X.Org Bug 55738 <http://bugs.freedesktop.org/show_bug.cgi?id=55738>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Thomas Jaeger <thjaeger at gmail.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 6ed4991..4cbeb37 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1862,6 +1862,11 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
         goto out;
     }
 
+    if (listener->state == LISTENER_AWAITING_BEGIN) {
+        listener->state = LISTENER_HAS_END;
+        goto out;
+    }
+
     /* Event in response to reject */
     if (ev->device_event.flags & TOUCH_REJECT) {
         if (listener->state != LISTENER_HAS_END)
commit 3018f9c1e5109680dcf69b8f2d7807696a473bde
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Oct 12 13:48:27 2012 +1000

    Xi: set xChangeDeviceControlReply.status to Success by default
    
    If the status is other than Success, the code will set it to the required
    value.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/Xi/chgdctl.c b/Xi/chgdctl.c
index 9fe69a5..7daf584 100644
--- a/Xi/chgdctl.c
+++ b/Xi/chgdctl.c
@@ -126,7 +126,8 @@ ProcXChangeDeviceControl(ClientPtr client)
         .repType = X_Reply,
         .RepType = X_ChangeDeviceControl,
         .sequenceNumber = client->sequence,
-        .length = 0
+        .length = 0,
+        .status = Success,
     };
 
     switch (stuff->control) {
commit 2decff6393a44b56d80d53570718f95354fde454
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Oct 11 16:03:33 2012 +1000

    xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP
    
    For button release events, the current code picks the VCK. Because that has
    a XKB struct, it thinks this is a PointerKeys event and proceeds to send the
    release event through the XTest pointer. That has no effect in normal
    operation as the button is never down and an attempt is silently discarded
    (normal event processing continues with the VCP).
    
    On server shutdown, the XTest device is already removed, leading to a
    null-pointer derefernce when the device is checked for whether buttons are
    down (XkbFakeDeviceButton → button_is_down(xtest pointer)).
    
    The current state has only worked by accident, the right approach here is to
    handle the VCP's event as such and not switch to the keyboard.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 082c0db..c1af32e 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -709,7 +709,7 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse)
     xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse);
     DeviceEvent *event = &ev->device_event;
 
-    dev = IsFloating(mouse) ? mouse : GetMaster(mouse, MASTER_KEYBOARD);
+    dev = (IsMaster(mouse) || IsFloating(mouse)) ? mouse : GetMaster(mouse, MASTER_KEYBOARD);
 
     if (dev && dev->key) {
         xkbi = dev->key->xkbInfo;
commit cc1d8fa8a4ef2e34e9837a44945094fd77e40a0b
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Sun Oct 14 23:38:20 2012 -0500

    Configure fixes for MinGW
    
    As for Cygwin, define FD_SETSIZE for uses of select() to be correct.
    Link with libpthread.
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/configure.ac b/configure.ac
index b6ed92c..86153ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -420,7 +420,7 @@ case $host_os in
   darwin*)
 	AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
 	;;
-  cygwin*)
+  cygwin*|mingw*)
 	CFLAGS="$CFLAGS -DFD_SETSIZE=256"
 	;;
 esac
@@ -1904,7 +1904,7 @@ if test "x$XWIN" = xyes; then
 			XWIN_SERVER_NAME=Xming
 			AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location])
 			AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets])
-			XWIN_SYS_LIBS=-lws2_32
+			XWIN_SYS_LIBS="-lpthread -lws2_32"
 			;;
 	esac
 


More information about the xorg-commit mailing list