Commit Graph

15778 Commits

Author SHA1 Message Date
Keith Packard 7e5c9bdf73 Bump version to 1.19.0
Signed-off-by: Keith Packard <keithp@keithp.com>
2016-11-15 08:12:05 -08:00
Keith Packard ea8efb3a99 dix: Make sure client is not in output_pending chain after closed (RH 1382444)
I think it is possible that output could get queued to a client during
CloseDownClient. After it is removed from the pending queue, active
grabs are released, the client is awoken if sleeping and any work
queue entries related to the client are processed.

To fix this, move the call removing it from the output_pending chain
until after clientGone has been set and then check clientGone in
output_pending_mark.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1382444
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-11-15 08:05:15 -08:00
Timo Aaltonen 7513da40a6 dri2: Sync i965_pci_ids.h from mesa
Import changes from these mesa commits:
85ea8deb26da420 i965: Removing PCI IDs that are no longer listed as Kabylake.
bdff2e554735ed9 i956: Add more Kabylake PCI IDs.
f1fa8b4a1ca73fa i965/bxt: Add 2x6 variant
d1ab544bb883d04 i965/chv: Display proper branding
20e8ee36627f874 i965/skl: Update Skylake renderer strings
644c8a515192d28 i965/skl: Add two missing device IDs

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Timo Aaltonen <tjaalton@ubuntu.com>
2016-11-02 13:16:53 -04:00
Ian Ray 4cfee39872 xwayland-shm: block signals during fallocate
posix_fallocate() does an explicit rollback if it gets EINTR, and
this is a problem on slow systems because when the allocation size
is sufficiently large posix_fallocate() will always be interrupted
by the smart scheduler's SIGALRM.

Changes since v1 - big comment in the code to explain what is going on

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ian Ray <ian.ray@ge.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Daniel Stone <daniels@collabora.com>
2016-11-01 14:00:04 -04:00
Keith Packard 512e75a23b Bump to 1.18.99.902 (1.19 RC2)
Signed-off-by: Keith Packard <keithp@keithp.com>
2016-10-28 09:32:42 -07:00
Keith Packard c85f81825e dix: Bump MAXHASHSIZE for the resource db [v2]
[This was originally a workaround for a client-side resource leak:

http://lists.freedesktop.org/archives/xorg-devel/2012-November/034555.html

Obviously that's a broken app, but the performance problem it
illustrates - that walking the linked list ends up burning all your CPU
time - is real enough. - ajax]

v2: Replace with a shorter code sequence which computes the same
    results for all but numBits == 7

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2016-10-28 09:28:32 -07:00
Keith Packard 356db2340f Merge remote-tracking branch 'jturney/master' 2016-10-28 09:05:54 -07:00
Keith Packard 9ed5b26354 os: Recompute whether any clients are ready after ProcessWorkQueue() (bug 98030)
If a work proc wakes up a sleeping client and it is ready to execute,
we need to re-compute the local 'are_ready' value before deciding
what timeout value to use in WaitForSomething.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98030
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-28 09:00:46 -07:00
Keith Packard 2c91f3235a ephyr: Leave window unmapped for -glamor-skip-present [v2]
If we're never painting anything in the window, we probably don't need
to map it.

v2: Drop ephyr_glamor_gles2 from hostx.c

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-10-28 08:41:28 -07:00
Alex Goins cba5a10fd9 ramdac: Check sPriv != NULL in xf86CheckHWCursor()
xf86CheckHWCursor() would dereference sPriv without NULL checking it. If Option
"SWCursor" is specified, sPriv == NULL. In this case we should assume that HW
cursors are not supported.

Signed-off-by: Alex Goins <agoins@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2016-10-28 08:17:21 -07:00
Jon Turney 03d99ef729 glx/dri2: Don't build DRI loader if DRI2 isn't enabled
This partially reverts 501d8e2b.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-10-27 14:25:42 +01:00
Peter Hutterer 5cb3283386 inputthread: On Linux leave the main thread's name as-is
On Linux, setting the main thread's name changes the program name
(/proc/self/comm). Setting it to MainThread breaks scripts that rely on
the command name, e.g. ps -C Xorg.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-10-27 09:53:01 +10:00
Olivier Fourdan 007f8ee61a xwayland: Activate and enable touch devices
On some random condition, a touch event may trigger a crash in Xwayland
in GetTouchEvents().

The (simplified) backtrace goes as follow:

 (gdb) bt
 #0  GetTouchEvents() at getevents.c:1892
 #1  QueueTouchEvents() at getevents.c:1866
 #2  xwl_touch_send_event() at xwayland-input.c:652
 #5  wl_closure_invoke() from libwayland-client.so.0
 #6  dispatch_event() from libwayland-client.so.0
 #7  wl_display_dispatch_queue_pending() from libwayland-client.so.0
 #8  xwl_read_events() at xwayland.c:483
 #9  ospoll_wait() at ospoll.c:412
 #10 WaitForSomething() at WaitFor.c:222
 #11 Dispatch() at dispatch.c:412
 #12 dix_main() at main.c:287
 #13 __libc_start_main() at libc-start.c:289
 #14 _start ()

The crash occurs when trying to access the sprite associated with the
touch device, which appears to be NULL. Reason being the device itself
is more a keyboard device than a touch device.

Moreover, it appears the device is neither enabled nor activated
(inited=0, enabled=0) which doesn't seem right, but matches the code in
init_touch() from xwayland-input.c which would enable the device if it
was previously existing and otherwise would create the device but not
activate it.

Make sure we do activate and enable touch devices just like we do for
other input devices such as keyboard and pointer.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 13:01:54 -04:00
Rui Matos f68ba7b81f xwayland: Transform pointer enter event coordinates
Pointer enter event coordinates are surface relative and we need them to
be screen relative for pScreen->SetCursorPosition().

https://bugzilla.gnome.org/show_bug.cgi?id=758283

Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 12:40:40 -04:00
Nikhil Mahale f5c6d751d0 modesetting: unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT
Commit c7e8d4a6ee had already unifdef
MODESETTING_OUTPUT_SLAVE_SUPPORT but commit
9257b1252d didn't notice that.

Signed-off-by: Nikhil Mahale <nmahale@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 12:40:35 -04:00
Hans de Goede 4aaeeda477 xfree86: Xorg.wrap: Do not require root rights for cards with 0 outputs
Prior to this commit the Xorg.wrap code to detect if root rights are
necessary checked for DRM_IOCTL_MODE_GETRESOURCES succeeding *and*
reporting more then 0 output connectors.

DRM_IOCTL_MODE_GETRESOURCES succeeding alone is enough to differentiate
between old drm only cards (which need ums and thus root) and kms capable
cards.

Some hybrid gfx laptops have 0 output connectors on one of their 2 GPUs,
resulting in Xorg needlessly running as root. This commits removes the
res.count_connectors > 0 check, fixing this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-10-26 12:40:23 -04:00
Michel Dänzer 7d91063aca DRI2: Sync radeonsi_pci_ids.h from Mesa
Fixes DRI2 client driver name mapping for newer AMD GPUs with the
modesetting driver, allowing the DRI2 extension to initialize.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 12:40:20 -04:00
Mihail Konev f6ff2e974c modesetting: fix glamor ifdef
Add a missing ifdef needed for --disable-glamor.

Signed-off-by: Mihail Konev <k.mvc@ya.ru>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 12:40:18 -04:00
Mihail Konev 8fee6a917b xwin: make glx optional again
Commit 501d8e2b removed --enable-aiglx, but made xwin always be
--enable-glx.

Signed-off-by: Mihail Konev <k.mvc@ya.ru>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 12:40:14 -04:00
Peter Hutterer d13cb97442 ddx: add new call to purge input devices that weren't added
Special case for the systemd-logind case in xfree86: when we're vt-switched
away and a device is plugged in, we get a paused fd from logind. Since we
can't probe the device or do anything with it, we store that device in the
xfree86 and handle it later when we vt-switch back. The device is not added to
inputInfo.devices until that time.

When the device is removed while still vt-switched away, the the config system
never notifies the DDX. It only runs through inputInfo.devices and our device
was never added to that.

When a device is plugged in, removed, and plugged in again while vt-switched
away, we have two entries in the xfree86-specific list that refer to the same
device node, both pending for addition later. On VT switch back, the first one
(the already removed one) will be added successfully, the second one (the
still plugged-in one) fails. Since the fd is correct, the device works until
it is removed again. The removed devices' config_info (i.e. the syspath)
doesn't match the actual device we addded tough (the input number increases
with each plug), it doesn't get removed, the fd remains open and we lose track
of the fd count. Plugging the device in again leads to a dead device.

Fix this by adding a call to notify the DDX to purge any remainders of devices
with the given config_info, that's the only identifiable bit we have at this
point.

https://bugs.freedesktop.org/show_bug.cgi?id=97928

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 15:35:07 +10:00
Peter Hutterer 8fcf2fa78f xfree86: swap the list of paused devices to an xorg_list
No functional changes but it makes it easier to remove elements from the
middle of the list (future patch).

We don't have an init call into this file, so the list is manually
initialized.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 15:35:07 +10:00
Peter Hutterer 28d8855cd4 xfree86: use the right option traversal list to search for an option
They're identically laid-out structs but let's use the right type to search
for our desired value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-26 15:35:07 +10:00
Emil Velikov 7fc96fb02d glamor: don't look for non-existing EGL_KHR_platform_base
The extension does not exist in the registry, thus needs to know they're
using EGL 1.5 in order to determine the eglGetPlatformDisplay function
pointer is valid.

Thus brings us into some lovely circular dependency.

Since mesa won't be able (in the foreseeable future) to export the KHR
flavour of extension (another way one could assume that EGL 1.5 is
available) just drop all the heuristics and use the
EGL_EXT_platform_base extension.

In practise (checked with the Mali driver) any EGL 1.5 driver will
advertise support for EGL_EXT_platform_base.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-10-25 13:04:48 -04:00
Mihail Konev 5dcb0666b8 os/inputthread: Ensure pollfd refreshing
When putting a device node into a poll-request list, do not overwrite a
"please-remove" element with the same fd, so that a closed device file
is ospoll_remove'd prior to being ospoll_add'ed.

Before, the opposite order was possible, resulting in ospoll_add
considering the newly opened file being already polled, should it have a
fd for which the "please-remove" has not been procesed yet. In this
case, no further events would be seen from the device.

Signed-off-by: Mihail Konev <k.mvc@ya.ru>
Regressed-in: 52d6a1e832
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97880
Patchwork: https://patchwork.freedesktop.org/patch/113763/
Hit-and-Reduced-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-and-Reduced-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2016-10-15 13:39:26 -07:00
Michel Dänzer 9cf0bd4d45 xf86Cursor: Take the input lock in xf86Set/MoveCursor
Prevents the HW cursor from intermittently jumping around when the
cursor image is changed while the cursor is being moved. This is hardly
noticeable in normal operation but can be quite confusing when stepping
through these codepaths in a debugger.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-13 18:31:23 +09:00
Michel Dänzer 011ce3297d xf86Cursor: Use PRIME master xf86CursorScreenRec::HotX/Y for slaves
xf86CursorScreenRec::HotX/Y contain 0 for PRIME slave screens.

Fixes incorrect HW cursor position on PRIME slave screens.

Also hoist the hotspot translation out from xf86ScreenSet/MoveCursor to
xf86Set/MoveCursor, since the hotspot position is a property of the
cursor, not the screen.

v2:
* Squash patches 1 & 2 of the v1 series, since it's basically the same
  problem
* Use the master screen's xf86CursorScreenRec::HotX/Y instead of
  CursorRec::bits->x/yhot, since CursorRec::bits can be NULL (Hans de
  Goede)

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2016-10-13 18:29:00 +09:00
Adam Jackson e3f53aa3a8 glx/dri2: Don't include drm headers
They're not needed, and they won't be present on win32.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emil Velikov <emil.l.veikov@gmail.com>
2016-10-10 13:43:09 -04:00
Peter Harris 97a8353ec1 Fix id in error when resource does not exist
Always set client->errorValue before returning an error.

Test program:

int main(int argc, char *argv[]) {
    int screen = 0;
    xcb_connection_t *c = xcb_connect(NULL, &screen);
    if (!c) {
        printf("Cannot connect\n");
        return 1;
    }

    xcb_void_cookie_t tok = xcb_free_gc_checked(c, BAD_VALUE);
    xcb_g_context_error_t *err = (xcb_g_context_error_t *)xcb_request_check(c, tok);
    if (!err) {
        printf("Unexpected request success\n");
        return 1;
    }
    if (err->bad_value != BAD_VALUE) {
        printf("Error: Got 0x%X, expected 0x%X\n", err->bad_value, BAD_VALUE);
        return 1;
    }
    printf("Success! Got expected bad value of 0x%X\n", BAD_VALUE);
    return 0;
}

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
2016-10-06 14:50:42 -04:00
Adam Jackson f4a4115547 glamor: Use eglGetPlatformDisplay{,EXT} if we can
eglGetDisplay forces the implementation to guess which kind of display
it's been handed. glvnd does something different from Mesa, and in
general it's impossible for the library to get this right. Add a new
inline that gets the logic right, and works around a quirk in epoxy.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-10-05 16:03:13 -04:00
Michel Dänzer 95d3980c7c test: Use $XSERVER_BUILDDIR for Xvfb executable path
Fixes make check with out-of-tree builds.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-10-05 15:25:28 -04:00
Emil Velikov cc69d4f110 xfree86/dri: remove libdrm runtime checks
As of last commit all the places in our configure.ac require version
2.3.1 (released back in 2007) or later. With the latter introducing the
1.3.0 version, as returned by drmGetLibVersion.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-10-05 14:38:13 -04:00
Emil Velikov 962962e978 configure.ac: bump the required libdrm version to 2.3.1
It fixes a bug where the version reported by drmGetLibVersion() was
'wrong'. See libdrm commit 79038751ffe("libdrm: add support for server
side functionality in libdrm") for details.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-10-05 14:38:10 -04:00
Emil Velikov 74a8b320fa configure.ac: use $LIBDRM over libdrm when using pkg-config
The former contains the minimum required version which is required.
Strictly speaking Xephyr/Xwayland may require version greater than the
current 2.3.0, although I've personally haven't checked the specifics.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-10-05 14:38:07 -04:00
Emil Velikov 45e1220486 configure.ac: default to DRI=yes on solaris platforms
Afaict there's little-to-no reason/way one would want xserver without
DRI support on Solaris platforms.

This will allow us to simplify/fix all the libdrm detection in the next
commit.

Cc: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-10-05 14:38:01 -04:00
Emil Velikov 501d8e2beb configure.ac: remove --enable-aiglx option
Presently the option guards both direct and accelerated indirect GLX. As
such when one toggles it off they end up without any acceleration.

Remove the option all together until we have the time to split/rework
things.

Cc: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-10-05 14:15:59 -04:00
Emil Velikov 7ec350ddd4 xfree86: remove aiglx cmd/xorg.conf option
The option is misleading and using it leads to disabling both direct and
accelerated indirect GLX. In such cases the xserver GLX attempts to
match DRISW (IGLX) configs with the DRI2/3 ones (direct GLX) leading to
all sorts of fun experience.

Remove the option until we get a clear split and control over direct vs
indirect GLX.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-10-05 14:15:52 -04:00
Emil Velikov 04ef8558a7 glx: drisw is not accelerated IGLX, reflect that in log messages
The messages from glxdricommon.c (used by drisw) still have the A, but
at least we're don't have it locally.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-10-05 14:15:42 -04:00
Olivier Fourdan 1c2fcb9548 glamor: Fix pixmap offset for bitplane in glamor_copy_fbo_cpu
Commit cba28d5 - "glamor: Handle bitplane in glamor_copy_fbo_cpu"
introduced a regression as the computed pixmap offset would not match
the actual coordinates and write data elsewhere in memory causing a
segfault in fbBltOne().

Translate the pixmap coordinates so that the data is read and written at
the correct location.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97974
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2016-10-05 13:57:13 -04:00
Jonas Ådahl a6e85e6330 xwayland: Add pointer warp emulator
Emulate pointer warps by locking the pointer and sending relative
motion events instead of absolute. X will keep track of the "fake"
pointer cursor position given the relative motion events, and the
client warping the cursor will warp the faked cursor position.

Various requirements need to be met for the pointer warp emulator to
enable:

The cursor must be invisible: since it would not be acceptable that a
fake cursor position would be different from the visual representation
of the cursor, emulation can only be done when there is no visual
representation done by the Wayland compositor. Thus, for the emulator
to enable, the cursor must be hidden, and would the cursor be displayed
while the emulator is active, the emulator would be destroyed.

The window that is warped within must be likely to have pointer focus.
For example, warping outside of the window region will be ignored.

The pointer warp emulator will disable itself once the fake cursor
position leaves the window region, or the cursor is made visible.

This makes various games depending on pointer warping (such as 3D
first-person shooters and stategy games using click-to-drag-map like
things) work.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2016-10-05 13:51:02 -04:00
Jonas Ådahl 467ab142ff xwayland: Translate a pointer grab with confineTo to pointer confinement
Translate grabbing a pointer device with confineTo set to a window into
confining the Wayland pointer using the pointer constraints protocol.
This makes clients that depend on the pointer not going outside of the
window region, such as certain games and virtual machines viewers, to
function more properly.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-05 13:50:54 -04:00
Jonas Ådahl ca7b593fbe xwayland: Bind pointer constraints global
Will be used by the pointer warp emulator.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-05 13:50:46 -04:00
Jonas Ådahl c14a8c6cc0 xwayland: Put getting a xwl_window from a Window in a helper
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-05 13:46:30 -04:00
Jonas Ådahl b4644ce8d3 xwayland: Set unaccelerated pointer motion delta if available
If there was an relative pointer motion within the same frame as an
absolute pointer motion, provide both the absolute coordinate and the
unaccelerated delta when setting the valuator mask.

If a frame contained only a relative motion, queue an absolute motion
with an unchanged position, but still pass the unaccelerated motion
event.

If the wl_seat advertised by the compositor is not new enough, assume
each relative and absolute pointer motion arrives within their own
separate frames.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-05 13:46:30 -04:00
Jonas Ådahl aa9634d03b xwayland: Dispatch pointer motion events on wl_pointer.frame if possible
Wait until wl_pointer.frame with dispatching the pointer motion event,
if wl_pointer.frame is supported by the compositor. This will later be
used to combine unaccelerated motion deltas with the absolute motion
delta.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-05 13:46:30 -04:00
Krzysztof Sobiecki 42e8902395 xwayland: Add a new input device used for pointer warping/locking
Generating relative and absolute movement events from the same input
device is problematic, because an absolute pointer device doesn't
expect to see any relative motion events. To be able to generate
relative pointer motion events including unaccelerated deltas, create a
secondary pointer device 'xwayland-relative-pointer', and use that for
emitting relative motion events.

Signed-off-by: Krzysztof Sobiecki <sobkas@gmail.com>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2016-10-05 13:46:30 -04:00
Jonas Ådahl 011ada724a xwayland: Move pointer button initialization into helper
We'll later use this for initializing buttons for the relative pointer
since they need to be the same.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2016-10-05 13:46:29 -04:00
Jonas Ådahl a77d0715c6 xwayland: Split up device class init/release into functions
Put device class initialization in init_[device_class](xwl_seat) and
releasing in release_[device class](xwl_seat). The purpose is to make
it easier to add more type of initialization here later, without making
the function too large.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-05 13:46:29 -04:00
Jonas Ådahl 9037ba736a xwayland: Bind the relative pointer manager
Will be used for getting unaccelerated motion events and later for
relative motions used by a pointer warp emulator.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-05 13:46:29 -04:00
Jonas Ådahl 0fae3be068 dix: Add valuator_mask_set_absolute_unaccelerated
Add a valuator mask setter for setting absolute coordinate combined
with unaccelerated motion deltas. This will later be used by Xwayland
to combine a wl_pointer.motion() event with the unaccelerated delta of
a wp_relative_pointer.relative_motion() event.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-10-05 13:46:29 -04:00
Carlos Garnacho bbd4854f81 xwayland: Apply touch abs axes transformation before posting events
The way we map the touch absolute device to screen coordinates can't
work across wl_output mode and geometry events. Instead, set up
a fixed coordinate space, and transform touch events according to
the screen coordinate space as they happen.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
2016-10-05 13:27:35 -04:00