summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Bump version to 23.0.99.902xwayland-23.0.99.902Olivier Fourdan2023-03-091-2/+2
| | | | | | Xwayland 23.1.0 release candidate 2. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
* xwayland: Fix uninitialised value created by a stack allocationOlivier Fourdan2023-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3c07a01c4 (xwayland: Use xdg-output name for XRandR) changed the logic to use a fixed sized buffer allocated on the stack to pass to RROutputCreate() which would then copy it. Valgrind complains about this: == Conditional jump or move depends on uninitialised value(s) == at 0x49954B: MakeAtom (atom.c:87) == by 0x5108B3: RRMonitorCrtcName (rrmonitor.c:33) == by 0x510BBB: RRMonitorSetFromServer (rrmonitor.c:92) == by 0x511882: RRMonitorMakeList (rrmonitor.c:373) == by 0x512175: ProcRRGetMonitors (rrmonitor.c:634) == by 0x508091: ProcRRDispatch (randr.c:748) == by 0x4A860E: Dispatch (dispatch.c:546) == by 0x4B692F: dix_main (main.c:271) == by 0x431C90: main (stubmain.c:34) == Uninitialised value was created by a stack allocation == at 0x42122C: xwl_output_create (xwayland-output.c:816) This is actually harmless, but also simple to avoid by just initializing the content of the array with zeros, so let's just fix that. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Fixes: commit 3c07a01c4 - xwayland: Use xdg-output name for XRandR (cherry picked from commit 1209a1bb57628df108600b09a77b15104e1bf1e2)
* xwayland/glamor: Track if a xwl_pixmap uses explicit modifiersJonas Ådahl2023-03-081-20/+30
| | | | | | | | | | | | If we allocated with implicit modifiers, then we shouldn't use the modifier returned by gbm_bo when checking whether the modifier is supported or not, since it won't be if the compositor only advertises implicit modifiers, nor should we use the modifier when creating the Wayland buffer object, as it wasn't explicitly advertised. Fixes: c6f2598a4 ("xwayland: don't fall back to wl_drm with explicit modifier") Signed-off-by: Jonas Ådahl <jadahl@gmail.com> (cherry picked from commit 4e20d96e8dfc9d19b5730c23ae3cc8da811c346e)
* xwayland/glamor/gbm: Use helper for implicit buffer params tooJonas Ådahl2023-03-081-6/+26
| | | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com> (cherry picked from commit 9bd83c02a8e02b902303a145de15c13ee650b910)
* xwayland/glamor/gbm: Initialize explicit buffer params in helperJonas Ådahl2023-03-081-31/+55
| | | | | | | This is preparing for cleaning up the macro mess. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> (cherry picked from commit af255b16513bab34bfc527cae139eb09c3fdbf82)
* xwayland/glamor/gbm: Only use modifier gbm API if explicitJonas Ådahl2023-03-081-2/+4
| | | | | | | | If we're using implicit modifiers, we'll pass NULL and zero modifiers. Lets just use the legacy API directly instead. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> (cherry picked from commit 08b0ea09de120a64c498238cc15b6cc04276ca22)
* Allow disabling the SHAPE extension at runtimeSimon Ser2023-03-033-1/+3
| | | | | | | | | | To correctly render a window making use of SHAPE, a compositor must query the shape rectangles. This may not be a desirable feature for a Wayland compositor. Allow SHAPE to be turned off at runtime, so that the compositor can opt-out. Signed-off-by: Simon Ser <contact@emersion.fr> (cherry picked from commit 21b3dad2380639573c251d95910bcb644049ee5f)
* xwayland: use drmDevice to compare DRM devicesSimon Ser2023-03-035-21/+37
| | | | | | | | | | The linux_dmabuf_v1 protocol doesn't guarantee any DRM node type: the compositor may send a primary node or a render node. Use drmDevice so that device comparisons are node-type-insensitive. Signed-off-by: Simon Ser <contact@emersion.fr> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1447 (cherry picked from commit 6f0b9deed66882aa18983eb35abca45207e37316)
* Add libdrm 2.4.109 requirementAustin Shafer2023-03-033-2/+10
| | | | | Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 5a742ab8763d7b041c427f1d725f6bbd7ae82fa1)
* xwayland: Use MAP_PRIVATE for keymapsOlivier Fourdan2023-03-031-1/+1
| | | | | | | | | | | | | | With wl_pointer.axis_v120 support, the wl_seat supported version has been bumped to 8, but Xwayland is still using MAP_SHARED which is prohibited, wl_seat version 7 and above enforces the use of MAP_PRIVATE for keymaps. Use MAP_PRIVATE for the keymaps mmap(). Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1512 Fixes: 3a02f56b4 - hook up wl_pointer.axis_v120 events (cherry picked from commit d5dd3f3ceea30034e0bde1d11b460149c9373b93)
* xwayland: don't fall back to wl_drm with explicit modifierSimon Ser2023-03-031-1/+1
| | | | | | | | | | | | | | | It's incorrect to strip an explicit modifier. Daniels' docs [1] states: > when importing a buffer, the user may supply `DRM_FORMAT_MOD_INVALID` as the > buffer modifier (or not supply a modifier) to indicate that the modifier is > unknown for whatever reason; this is only acceptable when the buffer has > not been allocated with an explicit modifier [1]: https://lore.kernel.org/dri-devel/20210905122742.86029-1-daniels@collabora.com/ Signed-off-by: Simon Ser <contact@emersion.fr> (cherry picked from commit c6f2598a4e62ea6c0d5244faf1488b20985df908)
* xwayland: fix error path when modifier is not supportedSimon Ser2023-03-031-2/+3
| | | | | | | | | When the modifier is not supported by the compositor, and the DMA-BUF contains multiple planes, xwl_pixmap->buffer is NULL. Avoid crashing when calling wl_buffer_add_listener(). Signed-off-by: Simon Ser <contact@emersion.fr> (cherry picked from commit 76a329e55c34e2d60a0b1d92bf61bbf3baf5dd41)
* xwayland: Include <sys/type.h> where neededOlivier Fourdan2023-03-032-0/+5
| | | | | | | | | | | | | | | With the addition of linux_dmabuf v4, the code adds dev_t in various places but did not include <sys/types.h>. While that works on glibc, it may fail to build on other libc implementations such as musl libc. Make sure to explicitly include <sys/types.h> where we use dev_t. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1445 Fixes: bddfe190de - Implement linux_dmabuf_feedback event handlers (cherry picked from commit 24171bb71010a90f1ac323be49121c1503658567)
* Bump version to 23.0.99.901xwayland-23.0.99.901Olivier Fourdan2023-02-221-2/+2
| | | | | | Xwayland 23.1.0 release candidate 1. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
* dix: fix wheel emulation lockup when a negative increment is setPeter Hutterer2023-02-201-3/+3
| | | | | | | | | | | | | | | The increment sign wasn't taking into account when checking if the next value is past our current value. The result was that for negative increments, we kept looping indefinitely, locking up the server. Easiest to reproduce with the evdev driver which has a negative increment on the y axis. Fixes 0a22502c34f2ea9799a67386498f657d769c7af8 dix: switch scroll button emulation to multiples of increment Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit d2158d4063dd87e630ca4c853ac07b88f3662c8f)
* Bump version to 23.0.99.1Olivier Fourdan2023-02-171-2/+2
| | | | | | In preparation for a 23.1 release. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
* meson: Change project name to xwaylandMichel Dänzer2023-02-172-3/+3
| | | | (cherry picked from commit 001f0c89383a2c5227175da1fff8c9592413ba4c)
* Don't install XvfbMichel Dänzer2023-02-172-131/+1
| | | | | | | | | | We're keeping it for unit tests, but we don't want to ship it from this branch. Also disable Xvfb in CI for ninja test. It's still built and used for unit tests as part of ninja dist, but we don't want to run XTS on Xvfb. (cherry picked from commit 0408fcb329d47571ebb69e2166646db4ac80d0a6)
* meson: Build Xwayland unconditionallyMichel Dänzer2023-02-172-52/+25
| | | | | | | | And simplify build_glamor logic, we don't need the separate glamor_option variable anymore. (cherry picked from commit fdc61c5a3cc2637a52928c8e2fd4d50118c7ffea) (cherry picked from commit 274d54d1c3876fd8c5142f43cd9204c0de417e92)
* Drop miext/shadow directoryMichel Dänzer2023-02-1730-2790/+0
| | | | | | Not used on this branch. (cherry picked from commit be7257c5d1401e098f2d43a917371b8c8d37edea)
* Drop EXA codeMichel Dänzer2023-02-1715-9348/+0
| | | | | | Not used on this branch. (cherry picked from commit aa49cd5ab72fa9624e1a20750af542b3bbb1e988)
* Drop config directoryMichel Dänzer2023-02-1716-2542/+0
| | | | | | | Not used anymore on this branch. (cherry picked from commit 23296633bb221242aac631a542762cca240abf4f) (cherry picked from commit d07af46a67bc8e68fa050c605bb556bc25886f16)
* Drop Xephyr / kdrive DDXMichel Dänzer2023-02-1735-12765/+1
| | | | (cherry picked from commit 9335ee79942c25e5b71debfde8b4f288287d4314)
* Drop Xorg DDXMichel Dänzer2023-02-17340-141531/+8
| | | | (cherry picked from commit 4f4b8e00fcb3a26332bef569e6bdd56941385b24)
* Drop Xwin DDX and x86 MinGW-w64 cross buildMichel Dänzer2023-02-17112-35733/+2
| | | | | | (cherry picked from commit 8f480147f6b63ebc51b8dcb80e55c7b8f91dad98) This partly reverts commit d3933a24d1abdcb56f45e6076cb84a1110674a8a.
* Drop Xnest DDXMichel Dänzer2023-02-1744-5730/+1
| | | | (cherry picked from commit 69cc6a6caa44b967df42579f26a07466c653074d)
* Drop Xquartz DDXMichel Dänzer2023-02-17252-49699/+1
| | | | (cherry picked from commit 6cae4b397d3753969e9046a562c23471c3ca724e)
* dix: switch scroll button emulation to multiples of incrementPeter Hutterer2023-02-161-24/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current algorithm triggers a bug in Xwayland when two devices have different granularity of scrolling. In Xwayland, the scroll increment is 1 and all physical devices scroll through the same (x)wayland pointer device. This may cause events to get lost when changing devices: - mouse scrolls by full increment, current value is 1.0 last scroll button was sent for valuator value 0.0, delta is 1.0 and we emulate a button event. - touchpad scrolls by partial increment, current value is 1.3 last scroll button was sent for valuator value 1.0, delta is 0.3 and no button event is emulated - mouse scrolls by full increment, current value is -0.7, last scroll button was sent for valuator value 1.0, delta is -0.7 and no button event is emulated Thus the wheel event appears to get lost. Xwayland cannot reliably detect this case because we don't see the physical devices. We can work around this by instead emulating buttons whenever we cross a multiple of increment. However, this has a drawback: high-resolution scroll devices can now trigger a button event storm by jittering across the multiple of increment. e.g. in the example above the touchpad moving from 1.3 to 1.0 would cause a click, despite this being a third of an increment. Fixes #1339 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Olivier Fourdan <ofourdan@redhat.com>
* dix: remove pointless "flexible" x/y axis mappingPeter Hutterer2023-02-161-7/+6
| | | | | | | | | storeLastValuators() takes the index in the mask for the x and y axis. Completely pointless because any device that doesn't have x/y on 0 and 1, respectively, is going to break in fun ways anyway. And we only have two callers two this function, both of which hardcode 0 and 1. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* present: Send a PresentConfigureNotify event for destroyed windowsAdam Jackson2023-02-153-4/+19
| | | | | | | | | | | | This enables fixing a deadlock case on the client side, where the client ends up blocked waiting for a Present event that will never come because the window was destroyed. The new PresentWindowDestroyed flag allows the client to avoid blocking indefinitely. Signed-off-by: Adam Jackson <ajax@redhat.com> See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116 See-also: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6685 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* xwayland: override Meson dependencySimon Ser2023-02-131-14/+27
| | | | | | | | This allows developers to setup Xwayland as a subproject of a Wayland compositor, and have it correctly pick up the features advertised in the dependency variables. Signed-off-by: Simon Ser <contact@emersion.fr>
* xwayland: generate pkg-config file from MesonSimon Ser2023-02-132-35/+23
| | | | | | | | | | | | Remove the xwayland.pc.in file: - This avoids writing down each pkg-config variable twice: once in the Meson files to set the configuration data, once in the .pc.in file to print it. - We'll be able to re-use the same variables for use as a subproject. Signed-off-by: Simon Ser <contact@emersion.fr>
* xwayland: Use wl_output.name for XRandROlivier Fourdan2023-02-131-2/+22
| | | | | | | | | | | If wl_output provides us with an output name, use that as well. If we have both xdg_output.name and wl_output.name (from version >= 4), prefer the latter. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com># See-also: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/189 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* xwayland: Pass the wl_output versionOlivier Fourdan2023-02-133-4/+6
| | | | | | | | | | | With the wl_output protocol, the actual bind to the interface is done in xwl_output_create(). Pass the version number from the registry so we can bind to the minimum version. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* xwayland: Use xdg-output name for XRandROlivier Fourdan2023-02-131-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, Xwayland assigns sequential output names for XRandR. When an output is hotplugged, a new name is assigned sequentially (XWAYLAND0, XWAYLAND1, etc.). This is a problem because if a monitor is unplugged and plugged again, it will get a new name each time. Luckily, xdg-output provides us with a name for the outputs. Even though the protocol states that the name is not a reflection of the underlying DRM connector name, it is to remain consistent across sessions with the same hardware and software configuration. So we could use the xdg-output name for the XRandR reported name for the output. Doing so is a bit tricky though, because the output name is set at creation and is not supposed to change. The xdg-output event that provides us with the name will come at a later time. So we just allocate a default fixed size for the output name at creation and just replace the default output name with the xdg-output name when that is known. Also, historically, some X11 clients were expecting output names in Xwayland to be named XWAYLAND<x> and used that to check whether they were running on Xwayland. Those clients should now use the Xwayland X11 extension which is designed specifically for that purpose. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1353 See-also: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/954 Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* xwayland: Tell RR has changed only when doneOlivier Fourdan2023-02-131-1/+2
| | | | | | | | | | | | | | | | Since commit 204f10c2, we notify XRandR clients that the randr configuration has changes as soon as an new output is created. Yet, this might be premature, considering that at that point, we are still to receive the wl_output and xdg-output events that will most likely change the setup. So instead of calling RRTellChanged() from xwl_output_create(), wait until we get to call apply_output_change(), which occurs after the done events from both xdg-output and wl_output are received. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* xwayland: fix GBM on driver without explicit modifiersSimon Ser2023-02-131-3/+2
| | | | | | | | | | | Some drivers (e.g. AMD GFX8-) don't support explicit format modifiers. On these drivers, gbm_bo_create_with_modifiers() will fail. This results in "Error getting buffer" in the logs later on with all X11 windows staying invisible. Fallback to the modifier-less API gbm_bo_create() in that case. Signed-off-by: Simon Ser <contact@emersion.fr>
* xwayland: Do not use "XWayland" spelling in code identifiersMichel Dänzer2023-02-131-5/+5
| | | | Let's not give people any excuse for this spelling.
* xwayland: Spell XWAYLAND consistently in debug messagesMichel Dänzer2023-02-131-1/+1
|
* xwayland: Spell Xwayland consistently in error messagesMichel Dänzer2023-02-132-3/+3
|
* xwayland/window: Do not double add window to damage listMinh Phan2023-02-101-1/+2
| | | | | | | | | | The window might be retained in the damage list after `xwl_screen_post_damage` in certain conditions. This means we need to check if the window is already in the list to avoid adding the same window twice which will lead to list corruption resulting in server freeze in `xwl_screen_post_damage`. Signed-off-by: Minh Phan <phanquangminh217@gmail.com>
* dix: Clear device sprite after free in AttachDevice()Olivier Fourdan2023-02-091-0/+1
| | | | | | | | | | | | | | | | | The code in AttachDevice() may free the dev->spriteInfo->sprite under some circumstances and later call GetCurrentRootWindow() which uses the same dev->spriteInfo->sprite. While it seems unlikely that this is actually an issue, considering the cases where one or the other get called, it still makes the code look suspicious. Make sure to clear set dev->spriteInfo->sprite to NULL immediately after it's freed to avoid any confusion, even if only to clarify the code. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1436
* xwayland: wl_pointer.axis_v120 is no longer optionalOlivier Fourdan2023-02-094-17/+2
| | | | | | | With Wayland 1.21 being our baseline, we do not need to compile wl_pointer.axis_v120 conditionally. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
* build: Bump Wayland dependency to 1.21Olivier Fourdan2023-02-091-1/+1
| | | | | | | | Wayland 1.21 was released on June 30, 2022 and our CI already installs Wayland 1.21 so let's just require the version we actually use in our CI. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
* glamor: handle EXT_gpu_shader4 in dual source blend pathsDave Airlie2023-02-101-3/+8
| | | | | Fixes: a9552868697c ("glamor: add EXT_gpu_shader4 support") Acked-by: Emma Anholt <emma@anholt.net>
* Xi: fix potential use-after-free in DeepCopyPointerClassesPeter Hutterer2023-02-071-1/+3
| | | | | | | | | CVE-2023-0494, ZDI-CAN-19596 This vulnerability was discovered by: Jan-Niklas Sohn working with Trend Micro Zero Day Initiative Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* xwayland: Commit surface changes with libdecor configureOlivier Fourdan2023-02-031-0/+7
| | | | | | | | | | | With libdecor, when the state changes (in the configure handler), we need to commit the libdecor frame but also the wl_surface, otherwise the surface is left in a uncommitted state until a wl_surface commit eventually occurs later. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Fixes: c74c6add3e - xwayland: add optional support for libdecor Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* darwin: Implement DetermineClientCmd for macOSJeremy Huddleston Sequoia2023-01-261-1/+109
| | | | | | | | | Withoug a proper implementation of DetermineClientCmd, clients that connect via an ssh tunnel are miscategorized as local. This results in failures when we try to use SCM_RIGHTS (eg: in MIT-SHM). Fixes: https://github.com/XQuartz/XQuartz/issues/314 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* os: Use LOCAL_PEERPID from sys/un.h if it is available to detemine the pid ↵Jeremy Huddleston Sequoia2023-01-262-0/+19
| | | | | | | | | | when falling back on getpeereids() This provides a way to determine the pid of a peer connection on systems like darwin that do not support getpeerucred() nor SO_PEERCRED. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* os: Update GetLocalClientCreds to prefer getpeerucred() or SO_PEERCRED over ↵Jeremy Huddleston Sequoia2023-01-261-14/+14
| | | | | | | | | | | | | | | | getpeereid() GetLocalClientCreds() was preferring getpeereid() above other implementations. getpeereid(), however, only returns the effective uid and gid of the peer, leaving the pid unset. When this happens, we are unable to use the pid to determine the peer's command line arguments and incorrectly treat ssh-tunneled traffic as local. To address this, we now prioritize getpeerucred() or SO_PEERCRED as those two implementations will return the pid in addition to uid and gid. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>