- Jul 03, 2020
-
-
The way Xwayland works (like all Wayland clients), it first queries the Wayland registry, set up all relevant protocols and then initializes its own structures. That means Xwayland will get the Wayland outputs from the Wayland compositor, compute the physical size of the combined outputs and set the corresponding Xwayland screen properties accordingly. Then it creates the X11 screen using fbScreenInit() but does so by using a default DPI value of 96. That value is used to set the physical size of the X11 screen, hence overriding the value computed from the actual physical size provided by the Wayland compositor. As a result, the DPI computed by tools such as xdpyinfo will always be 96 regardless of the actual screen size and resolution. However, if the Wayland outputs get reconfigured, or new outputs added, or existing outputs removed, Xwayland will recompute and update the physical size of the screen, leading to an unexpected change of DPI. To avoid that discrepancy, use a fixed size DPI (defaults to 96, and can be set using the standard command lime option "-dpi") and compute a physical screen size to match that DPI setting. Note that only affects legacy core protocols, X11 clients can still get the actual physical output size as reported by the Wayland compositor using the RandR protocol, which also allows for the size to be 0 if the size is unknown or meaningless. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Simon Ser <contact@emersion.fr> Closes: #731
-
ProcVidModeGetGamma() relies on GetGamma() to initialise values if it returns TRUE. Without this, we're sending uninitialised values to clients. Fixes: #1040
-
- Jul 02, 2020
-
-
When running with a weston session without a pointer device (thus with the wl_seat not having a pointer) xwayland pointer warping and pointer confining should simply be ignored to avoid crashes. Signed-off-by:
Sjoerd Simons <sjoerd@collabora.com>
-
- Jun 27, 2020
-
-
Since the introduction of "modesetting: Remove unnecessary fb addition from drmmode_xf86crtc_resize" the fb_id isn't initialited at drmmode_xf86crtc_resize. Rotate operation of XRandR uses rotate_bo. So in this case the fb_id associated to the front_bo is not initialized at drmmode_set_mode_major. So fd_id remains 0. As every call to drmmode_xf86crtc_resize allocates a new front_bo we should destroy unconditionally the old_front_bo if operation success. So we free the allocated GBM handles. This avoids crashing xserver with a OOM in the RPI4 1Gb at 4k resolution after 3 series xrandr rotations from normal to left and vice versa reported at https://github.com/raspberrypi/firmware/issues/1345 Signed-off-by:
Jose Maria Casanova Crespo <jmcasanova@igalia.com> Reviewed-by:
Keith Packard <keithp@keithp.com> Closes: #1024 Fixes: 87745321 "modesetting: Remove unnecessary fb addition from drmmode_xf86crtc_resize"
-
- Jun 25, 2020
-
-
Michel Dänzer authored
These events aren't reachable after xwl_present_cleanup, so they're leaked if we don't free them first. This requires storing the pixmap pointer in struct xwl_present_window. Luckily, the buffer pointer isn't used for anything, so just replace that. v2: * Bump pixmap reference count in xwl_present_flip and drop it in xwl_present_free_event, fixes use-after-free in the latter due to the pixmap already being destroyed. Reviewed-by:
Dave Airlie <airlied@redhat.com>
-
Michel Dänzer authored
Minor cleanup, and will make the next change simpler. No functional change intended. Reviewed-by:
Dave Airlie <airlied@redhat.com>
-
Michel Dänzer authored
When present_wnmd_clear_window_flip is done, present_destroy_window frees struct present_window_priv, and the events in the flip queue become unreachable. So if we don't free them first, they're leaked. Also drop the call to present_wnmd_set_abort_flip, which just sets a flag in struct present_window_priv and thus can't have any observable effect after present_destroy_window. Closes: #1042 Reviewed-by:
Dave Airlie <airlied@redhat.com>
-
Michel Dänzer authored
The comment was incorrect: Any reference held by the window (see present_wnmd_execute) is in addition to the one in struct present_vblank (see present_vblank_create). So if we don't drop the latter, the pixmap will be leaked. Reviewed-by:
Dave Airlie <airlied@redhat.com>
-
- Jun 24, 2020
-
-
During a VT-Switch a raw pointer to the shared cursor object is saved which is then freed (in case of low refcount) by a call to xf86CursorSetCursor with argument pCurs = NullCursor. This leads to a dangling pointer which can follow in a use after free. This fix ensures that there is a shared handle saved for the VT-Switch cycle. Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
- Jun 23, 2020
-
-
Aaron Ma authored
EDID1.4 replaced GTF Bit with Continuous or Non-Continuous Frequency Display. Check the "Display Range Limits Descriptor" for GTF support. If panel doesn't support GTF, then add gtf modes. Otherwise X will only show the modes in "Detailed Timing Descriptor". V2: Coding style changes. V3: Coding style changes, remove unused variate. V4: remove unused variate. BugLink: https://gitlab.freedesktop.org/drm/intel/issues/313 Signed-off-by:
Aaron Ma <aaron.ma@canonical.com> Reviewed-by:
Adam Jackson <ajax@redhat.com>
-
- Jun 19, 2020
-
-
When the linux-dmabuf protocol is available, prefer it over the old wl_drm protocol. Previously wl_drm was used when modifiers aren't supported, however linux-dmabuf supports formats without modifiers too. In this case, linux-dmabuf will send a DRM_FORMAT_MOD_INVALID modifier for each supported format [1]. This allows compositors to better handle these buffers, getting a DMA-BUF and implementing features like direct scan-out. A similar logic has been implemented for EGL [2]. DRM_FORMAT_MOD_INVALID is now stored in the xwl_screen->formats list. glamor_get_modifiers still returns FALSE with zero modifiers if the only advertised modifier is DRM_FORMAT_MOD_INVALID. [1]: wayland/wayland-protocols@fb9b2a87 [2]: mesa/mesa@c376865f Signed-off-by:
Simon Ser <contact@emersion.fr> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
Previously, linux-dmabuf was used unconditionally if the buffer had a modifier. However creating a linux-dmabuf buffer with a format/modifier which hasn't been advertised will fail. Change xwl_glamor_gbm_get_wl_buffer_for_pixmap to use linux-dmabuf when the format/modifier has been advertised only. Signed-off-by:
Simon Ser <contact@emersion.fr> Closes: #1035 Tested-by:
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
Simon Ser authored
This flag should only be used when the caller intends to display the buffer on a hardware plane. Xwayland isn't a DRM client, so it doesn't make sense to use this flag. This change will allow the driver to potentially use buffer parameters that are more optimized. Signed-off-by:
Simon Ser <contact@emersion.fr> Reviewed-by:
Daniel Stone <daniels@collabora.com> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com>
-
- Jun 05, 2020
-
-
Adam Jackson authored
Without this the client library will flail around looking for a default provider, probably one named "indirect", and that defeats the point of having the EGL provider for direct context support in the first place. This assumes that "mesa" will work, of course, and in general it should. Mesa drivers will DTRT through the DRI3 setup path, and if our glamor is atop something non-Mesa then you should fall back to llvmpipe like 1.20. In the future it might be useful to differentiate the vendor here based on whether glamor is using gbm or streams. Fixes: #1032
-
- Jun 03, 2020
-
-
Matthieu Herrb authored
None of the current BSD is actually using this code. (checked DragonFly 5.8.1, FreeBSD 11.2, NetBSD 9.0 and OpenBSD 6.7) Signed-off-by:
Matthieu Herrb <matthieu@herrb.eu>
-
- May 27, 2020
-
-
Jan Beich authored
DragonFly and FreeBSD can use xf86-input-libinput with config/udev. ld: error: undefined symbol: xf86PlatformDeviceProbe >>> referenced by xf86platformBus.c >>> xf86platformBus.c.o:(xf86platformProbe) in archive hw/xfree86/common/libxorg_common.a ld: error: undefined symbol: xf86PlatformDeviceCheckBusID >>> referenced by xf86platformBus.c >>> xf86platformBus.c.o:(xf86platformProbeDev) in archive hw/xfree86/common/libxorg_common.a ld: error: undefined symbol: xf86PlatformReprobeDevice >>> referenced by xf86platformBus.c >>> xf86platformBus.c.o:(xf86platformVTProbe) in archive hw/xfree86/common/libxorg_common.a ld: error: undefined symbol: NewGPUDeviceRequest >>> referenced by udev.c >>> udev.c.o:(device_added) in archive config/liblibxserver_config.a ld: error: undefined symbol: DeleteGPUDeviceRequest >>> referenced by udev.c >>> udev.c.o:(device_removed) in archive config/liblibxserver_config.a
-
Jan Beich authored
In file included from ../glx/glxdri2.c:35: /usr/local/include/GL/internal/dri_interface.h:43:10: fatal error: 'drm.h' file not found #include <drm.h> ^~~~~~~ In file included from ../glx/glxdriswrast.c:39: /usr/local/include/GL/internal/dri_interface.h:43:10: fatal error: 'drm.h' file not found #include <drm.h> ^~~~~~~
-
Jan Beich authored
../os/xsha1.c:36:10: fatal error: 'sha1.h' file not found #include <sha1.h> ^~~~~~~~ ../os/xsha1.c:45:5: error: implicit declaration of function 'SHA1Init' is invalid in C99 [-Werror,-Wimplicit-function-declaration] SHA1Init(ctx); ^ ../os/xsha1.c:54:5: error: implicit declaration of function 'SHA1Update' is invalid in C99 [-Werror,-Wimplicit-function-declaration] SHA1Update(sha1_ctx, data, size); ^ ../os/xsha1.c:63:5: error: implicit declaration of function 'SHA1Final' is invalid in C99 [-Werror,-Wimplicit-function-declaration] SHA1Final(result, sha1_ctx); ^
-
- May 20, 2020
-
-
Xwayland uses the device private to point to the `xwl_seat`. Device may be removed at any time, including on suspend. On resume, if the DIX code ends up calling a function that requires the `xwl_seat` such as `xwl_set_cursor()` we may end up pointing at random data. Make sure the clear the device private data on removal so that we don't try to use it and crash later. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net> #709
-
Peter Hutterer authored
wayland/ci-templates was moved to freedesktop/ci-templates, everything else stayed the same so the sha is still valid. Signed-off-by:
Peter Hutterer <peter.hutterer@who-t.net> Acked-by:
Michel Dänzer <mdaenzer@redhat.com>
-
- May 18, 2020
-
-
Simon Ser authored
Drop GBM_BO_USE_SCANOUT from the GBM_BO_IMPORT_FD import, add GBM_BO_USE_RENDERING to the GBM_BO_IMPORT_FD_MODIFIER import. If the DMA-BUF cannot be scanned out, gbm_bo_import with GBM_BO_USE_SCANOUT will fail. However Xwayland doesn't need to scan-out the buffer and can work fine without scanout. Glamor only needs GBM_BO_USE_RENDERING. Signed-off-by:
Simon Ser <contact@emersion.fr> Reviewed-by:
Michel Dänzer <mdaenzer@redhat.com> Reviewed-by:
Daniel Stone <daniels@collabora.com>
-
- May 13, 2020
-
-
In this pretty Wine/Proton specific kludge, we try to handle confining grabs on InputOnly windows by trying to find the InputOutput window that the pointer would get visually confined to. The grabbing window and the visible window come from different clients, so we used to simply resort to the pointer focus. This is troublesome though, as the call may happen very soon at a time that the toplevel wasn't yet mapped by the Wayland compositor, so the pointer focus may well be out of date soon. In these situations, it does seem that even though the confining grab happens too early to have the wayland surface mapped, the xserver view of the WindowPtr does already reflect the size. Use this to find out the better window to assign the confining grab to, one whose geometry fully contains the InputOnly window's. Signed-off-by:
Carlos Garnacho <carlosg@gnome.org> Reviewed-by:
Olivier Fourdan <ofourdan@redhat.com>
-
- May 12, 2020
-
-
Olivier Fourdan authored
xwl_seat_maybe_lock_on_hidden_cursor() checks that the value of cursor_confinement_window is not NULL, yet there is no code path that could lead to this. Remove the test for cursor_confinement_window being set, it's useless. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Carlos Garnacho <carlosg@gnome.org> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Olivier Fourdan authored
When an X11 client issues a ConfinePointer wit ha hidden cursor, Xwayland may translate that as a pointer lock. However, if the pointer is located on another window at the time, the request may be ignored, even if the pointer later enters the window. To avoid that issue, check again if locking the pointer with a hidden cursor is needed when pointer enters a surface. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Carlos Garnacho <carlosg@gnome.org> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Olivier Fourdan authored
When an X11 client has an active grab on the pointer, all events are reported relative to the window with the grab. For Xwayland, if an X11 client has a grab with a pointer confinement active, while pointer focus is on another window, motion events should not be reported to the client with the grab, because that sets the X11 client appart, the events would be reported when the pointer is on any X11 window but not on Wayland native surfaces. Therefore, if the pointer is confined on a window and that window differs from the actual pointer focus window, just pretend we lost pointer focus to another window. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Closes: #962 Reviewed-by:
Carlos Garnacho <carlosg@gnome.org> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
Olivier Fourdan authored
If a client issues a grab on the pointer while the cursor is on another X11 window, and then hides the cursor, we may end up locking the pointer onto that other window. Then a button click might end up moving the focus away from the window which issued the grab, leaving the whole setup in a mixed up state. Typically, if the pointer is on another X11 window, we should not try to lock the pointer, so that it can be moved back to the window which actually issues the grab (and hence the pointer confinement). Typically, this is the same as an X11 client issuing a pointer grab while the cursor is on another Wayland native window. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Closes: #962 Reviewed-by:
Carlos Garnacho <carlosg@gnome.org> Reviewed-by:
Peter Hutterer <peter.hutterer@who-t.net>
-
- May 11, 2020
-
-
Alan Coopersmith authored
Mostly http->https conversions, but also replaces gitweb.fd.o with gitlab.fd.o, and xquartz.macosforge.org with xquartz.org. Signed-off-by:
Alan Coopersmith <alan.coopersmith@oracle.com>
-
- May 08, 2020
-
-
Martin Weber authored
-
- May 07, 2020
-
-
Signed-off-by:
Christopher Chavez <chrischavez@gmx.us>
-
- May 01, 2020
-
-
- Apr 30, 2020
-
-
On systems with ACPI but disabled APM (e.g. --disable-linux-apm) the code does not compile due to preprocessor directives. If APM is disabled, the final return statement is considered to be part of ACPI's last if-statement, leading to a function which has no final return statement at all. I have refactored the code so ACPI and APM are independent of each other. Signed-off-by:
Tobias Stoeckmann <tobias@stoeckmann.org>
-
- Apr 27, 2020
-
-
Olivier Fourdan authored
Mutter recently added headless tests, and when running those tests the Wayland compositor runs for a very short time. Xwayland is spawned by the Wayland compositor and upon startup will query the various Wayland protocol supported by the compositor. To do so, it will do a roundtrip to the Wayland server waiting for events it expects. If the Wayland compositor terminates before Xwayland has got the replies it expects, it will loop indefinitely calling `wl_display_roundtrip()` continuously. To avoid that issue, add a new `xwl_screen_roundtrip()` that checks for the returned value from `wl_display_roundtrip()` and fails if it is negative. Signed-off-by:
Olivier Fourdan <ofourdan@redhat.com> Reviewed-by:
Roman Gilg <subdiff@gmail.com> Reviewed-by:
Jonas Ådahl <jadahl@gmail.com>
-
- Apr 15, 2020
-
-
Jon Turney authored
Since we now only work with UTF-8 (or ISO8859-1) text in the clipboard, we don't need to setlocale().
-
Jon Turney authored
This avoids including Xdefs.h, which means we avoid all the issues with _XSERVER64 effecting how types are defined by that.
-
Jon Turney authored
All helper client code now uses xcb, so calling XSetAuthorization() is no longer needed. This is the last reference to libX11 from helper clients, so linking with x11-xcb and libX11 is no longer required. Also drop (unneeded?) linking with libXau. Also drop installing these prerequistes on AppvVeyor. Also move prototypes for functions in winauth.c from win.h into a new header, winauth.h, and include that where needed.
-
Jon Turney authored
Convert clipboard integration code from libX11 to xcb This drops support for COMPOUND_TEXT. Presumably some ancient (pre-2000) clients exist which support that, but not UTF8_STRING, but we don't have an example to test with. (Given the nature of the thing, the users of those clients probably work in CJK languages) Supporting COMPOUND_TEXT would also involve writing (or extracting from Xlib) support for the ISO 2022 encoding. v2: Fix the length of text property set by a SelectionRequest The length of the text property is not neccessarily the same as the length of the clipboard text before it is d2u converted (specifically, if that contains any '\r\n' sequences, it will be shorter as they are now just '\n')
-
Jon Turney authored
Always use CF_UNICODETEXT clipboard format. Windows will automatically down-convert to CF_TEXT for clients which request that. This is subtly different in one way: if CF_TEXT is requested, we now post CF_UNICODETEXT and it is converted to CF_TEXT *in the locale of the requesting process*. Previously, we would convert to CF_TEXT *in our locale* and post that. It looks like the code in the !X_HAVE_UTF8_STRING case didn't actually work correctly, but fortunately that has never been true...
-
Jon Turney authored
The original Win32 clipboard API is widely regarded as terrible, since it relies on clients co-operatively managing the clipboard viewer chain, and a single buggy client can break it for all other clients. The last Windows version only supporting that API was Windows XP (5.1), EOLed in 2014. (This requires MinGW-w64 w32api 6.0.0 or later for Add/RemoveClipboardListener correctly exported by the x86_64 user32 implib)
-
Jon Turney authored
-