Commit graph

9413 commits

Author SHA1 Message Date
Liu Heng
7fb5e00ad8 xwayland: Fix incorrect pointer coordinates in enter events
Xwayland was sending incorrect pointer coordinates to X clients on
pointer enter events.

This was caused by calling CheckMotion() with a NULL event, which
prevented the pointer sprite hot coordinates from being updated
properly.

Fix this by constructing a proper DeviceEvent of type ET_Enter in
pointer_handle_enter, initializing it with the current timestamp
and EVENT_SOURCE_FOCUS, and passing it to CheckMotion() instead
of NULL.

This ensures the pointer sprite coordinates are correctly updated
when the pointer enters a window.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2113>
2025-12-16 10:51:34 +08:00
kohnish
0060b91b49 Revert "dix: unexport dixLookupProperty()"
This reverts commit fb697dd644.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2101>
2025-11-17 21:33:26 +01:00
Takashi Yano
3b39aebf98 Fix mach64 driver crash
Due to lack of iopl(3), mach64 driver crashes when ior(BUS_CNTL) is
called. Since BUS_CNTL is out of the range 0x0000-0x03ff, ioperm(0,
1024, 1) is not sufficient and the ior() causes access violation.
This patch reintroduce iopl(3) call in the function hwEnableIO().

Addresses: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1110521
Fixes: a0f738a673 ("Fixed ioperm calls in hwEnableIO")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2052>
2025-10-25 20:34:53 +00:00
Michel Dänzer
6f31791945 xwayland: Ignore non-InputOutput children in window_get_client_toplevel
InputOnly windows aren't relevant here.

E.g. mutter-x11-frames uses GTK4, which creates a 1x1 InputOnly child
window, which previously prevented this code from working as intended.

v2: (Olivier Fourdan)
* Rename output_child -> input_output_child.
* Add comment in get_single_input_output_child explaining why we return
  NULL if input_output_child is already non-NULL.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2069>
2025-10-10 08:26:49 +00:00
Michel Dänzer
105b5f2402 xwayland: Add heuristic for WM windows based on reparenting
If the WM client reparents a window, mark the new parent as a WM window.

This helps with current mutter, where decoration windows are created by
a separate mutter-x11-frames client instead of the WM client. There
might be other compositors doing something similar now or in the future.

v2:
* Skip the whole unwrap-and-call-down dance in xwl_reparent_window if
  xwl_screen->ReparentWindow is NULL.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2069>
2025-10-10 08:26:49 +00:00
Michel Dänzer
66984ab8ae xwayland: Take viewport scale into account for the input region
This is necessary because the input region is specified in surface
coordinates.

Fixes: a4ed100c0c ("xwayland: Set wl_surface input region:)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2071>
2025-10-08 08:03:38 +00:00
Alan Coopersmith
d9389873d6 Strip trailing whitespace from source files
Performed with: `git ls-files | xargs perl -i -p -e 's{[ \t]+$}{}'`

`git diff -w` & `git diff -b` show no diffs from this change

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2074>
2025-10-05 11:56:48 -07:00
Alan Coopersmith
5210495f7d xfree86: Fix -Wdiscarded-qualifiers warnings in SPARC Sbus probe code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
2025-10-03 10:55:17 -07:00
Alan Coopersmith
c62cd2feaa xfree86: add missing headers to build sun_init.c on Solaris/SPARC
Fixes: 0f715b4ca ("xfree86: os-support: move hidden Solaris-specific symbols out of public header")
Fixes: e2fa0d2ae ("fix including <sys/mman.h>")

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
2025-10-03 10:55:17 -07:00
Alan Coopersmith
908f0a488d xfree86: fix meson build on 64-bit Solaris/SPARC systems
For cpu_family(), meson returns "sparc" for 32-bit sparc,
and "sparc64" for 64-bit sparc, regardless of the OS in use.

For cpu(), meson returns values like "sun4v" on Solaris/SPARC,
and doesn't promise stability of the values, or portability across
OS'es, unlike cpu_family().

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
2025-10-03 10:55:17 -07:00
Mikhail Dmitrichenko
b096785df4 xwayland: Fix search of duplicate lease names
Commit d36f66f15d ("Check for duplicate output names") would walk the
list of existing outputs and leases to check that no other existing
output has the same name.

The change however, inadvertently reused the regular screen outputs when
searching the leased names.

Fix this by using the lease name, not the regular output names that we
already checked just above.

Found by SAST tool Svace.

Fixes: d36f66f15d - xwayland: Check for duplicate output names
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1843
Reviewed-by Olivier Fourdan <ofourdan@redhat.com>

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2063>
2025-09-18 09:55:47 +00:00
Nicolas Guichard
bcc0587ab9 xwayland: Fix minimum wl_compositor protocol version
Commit 54f8fc4090 introduced the use of
wl_surface::set_buffer_scale, which is only available starting with
version 3 of the wl_compositor protocol. Because we already prefer
version 4 when available, this went unnoticed but broke versions 1, 2
and 3 when reaching the wl_surface::set_buffer_scale call.

This restores functionality for version 3 and properly document that
versions 1 and 2 are not supported anymore.

Signed-off-by: Nicolas Guichard <nicolas.guichard@kdab.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1862>
2025-09-18 11:40:44 +02:00
Ian Forbes
afc8b781d8 xwayland: Try harder to find a top-level for root grabs
The commit referenced below partially resolved an issue with grabs being made
on the root window. Unfortunately it assumes that the application uses
the same client for all windows. VMware Workstation uses nested windows
for each VM, each of which runs its own process with this own client.
Theses windows are managed by the GUI which is the top level for the
application and maps the windows based on which tab is selected.

Because the VM windows issue a grab on the root window and don't share
the same client as the GUI, grabs don't work properly with global shortcut
inhibition being completely broken.

Getting the parent top-level of the nested windows fixes this issue.

Fixes: c7730cfe55 ("xwayland: Translate keyboard grabs on the root window")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2016>
2025-09-12 07:47:39 +00:00
Alan Coopersmith
b858cb5ccd Revert "dix: unexport cursor refcounting functions"
This reverts commit 4aadbeb8aa.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2058>
2025-09-06 17:01:39 +00:00
Alan Coopersmith
774da7dfc0 Revert "dix: unexport NewCurrentScreen()"
This reverts commit bd3c252710.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2058>
2025-09-06 17:01:37 +00:00
Alan Coopersmith
cc7b0b7681 modesetting: fix modesetting symbol test when glx is disabled
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
48acd1ae78 xwayland: fix builds with xace disabled
CI meson-disable-options builds were failing with:
../hw/xwayland/xwayland-screen.c: In function ‘xwl_close_screen’:
../hw/xwayland/xwayland-screen.c:246:5: error: implicit declaration of
 function ‘XaceDeleteCallback’; did you mean ‘DeleteCallback’?
 [-Werror=implicit-function-declaration]
  246 |     XaceDeleteCallback(XACE_PROPERTY_ACCESS, xwl_access_property_callback, screen);
      |     ^~~~~~~~~~~~~~~~~~
      |     DeleteCallback

../hw/xwayland/xwayland-screen.c:246:24: error: ‘XACE_PROPERTY_ACCESS’
 undeclared (first use in this function)
  246 |     XaceDeleteCallback(XACE_PROPERTY_ACCESS, xwl_access_property_callback, screen);
      |                        ^~~~~~~~~~~~~~~~~~~~

../hw/xwayland/xwayland-screen.c: In function ‘xwl_screen_init’:
../hw/xwayland/xwayland-screen.c:1174:5: error: implicit declaration of
 function ‘XaceRegisterCallback’ [-Werror=implicit-function-declaration]
 1174 |     XaceRegisterCallback(XACE_PROPERTY_ACCESS, xwl_access_property_callback, pScreen);
      |     ^~~~~~~~~~~~~~~~~~~~

../hw/xwayland/xwayland-screen.c:1174:26: error: ‘XACE_PROPERTY_ACCESS’
 undeclared (first use in this function)
 1174 |     XaceRegisterCallback(XACE_PROPERTY_ACCESS, xwl_access_property_callback, pScreen);
      |                          ^~~~~~~~~~~~~~~~~~~~

Fixes: a07c2cda9 ("xwayland: Add an XACE property access handler")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
ec14ecf751 modesetting: Fix builds with pciaccess or udev_kms disabled
CI meson-disable-options builds were failing with:
../hw/xfree86/drivers/modesetting/driver.c:127:5: error: ‘ms_device_match’
 undeclared here (not in a function)
  127 |     ms_device_match,
      |     ^~~~~~~~~~~~~~~
../hw/xfree86/drivers/modesetting/driver.c: In function ‘ms_get_drm_master_fd’:
../hw/xfree86/drivers/modesetting/driver.c:1179:19: error: variable ‘pEnt’
 set but not used [-Werror=unused-but-set-variable]
 1179 |     EntityInfoPtr pEnt;
      |                   ^~~~
../hw/xfree86/drivers/modesetting/driver.c: At top level:
../hw/xfree86/drivers/modesetting/driver.c:84:13: error: ‘ms_pci_probe’
 used but never defined [-Werror]
   84 | static Bool ms_pci_probe(DriverPtr driver,
      |             ^~~~~~~~~~~~
../hw/xfree86/drivers/modesetting/driver.c:313:1: error: ‘probe_hw_pci’
 defined but not used [-Werror=unused-function]
  313 | probe_hw_pci(const char *dev, struct pci_device *pdev)
      | ^~~~~~~~~~~~

Fixes: a72bdf170 ("modesetting: rewrite probing based on fbdev.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2056>
2025-08-30 10:01:32 -07:00
Alan Coopersmith
d03c84b57f xfree86: Fix builds with gcc -Wpedantic
../hw/xfree86/loader/loadmod.c:85:33: warning: ISO C forbids empty
 initializer braces before C23 [-Wpedantic]
   85 | static int ModuleDuplicated[] = { };
      |                                 ^
../hw/xfree86/loader/loadmod.c:85:12: error: zero or negative size array
 ‘ModuleDuplicated’
   85 | static int ModuleDuplicated[] = { };
      |            ^~~~~~~~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2054>
2025-08-23 15:38:40 +00:00
Alan Coopersmith
bf867b4658 Revert "os: unexport Os*() functions"
OsBlockSignals & OsReleaseSignals are required by libint10.so

This reverts commit be4c8444eb.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2049>
2025-07-20 12:41:06 -07:00
liuheng
9b6f72395a config: Preserve section data when parsing duplicate files
Previously, when parsing multiple configuration files containing the same
section names, only the last occurrence of each section would be retained.
Earlier definitions were silently discarded due to unconditional memory
allocation and overwriting of pointers during parsing.

This resulted in incomplete or incorrect configuration state when users
intended to merge or extend configuration through multiple files.

The section parsing functions in Files.c, Flags.c, and Module.c now
accept existing section pointers. These functions allocate new memory only
if the input pointer is NULL, preserving earlier data when re-parsing.

read.c has been updated to detect and pass existing section pointers when
encountering duplicate sections across files, preventing loss of prior content.

With these changes, the parser properly accumulates and merges configuration
data across multiple files, ensuring that all relevant settings are preserved.

Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/467
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2045>
2025-07-19 20:58:11 +00:00
Martin von Gagern
0d39d7a8f3 modesetting: Check for NULL mode_output before printing warning message
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1816
Signed-off-by: Martin von Gagern <gagern@google.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1938>
2025-07-19 20:52:27 +00:00
Michel Dänzer
010c00828a xwayland/present: Only flip if the window pixmap dimensions match
If they don't, attaching the new buffer changes the dimensions of the
wl_surface representing the window, which can break stuff as described
in https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2044 .

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2047>
2025-07-18 14:33:08 +00:00
Alan Coopersmith
8540bda07a Revert "include: drop now empty xkbfile.h"
This reverts commit f8fc46cbbf.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2046>
2025-07-12 11:47:06 -07:00
Vlad Zahorodnii
60f0bfe852 xwayland: Dispatch tablet tool tip events after frame events
Xwayland dispatches tablet tool tip events immediately when they arrive.

With compositors such as mutter and sway, it is not an issue because
their libinput backends synthetize axis events before tip events. In
other words, axis data and the tip status belong to different frames.

On the other hand, kwin sends axis and tip events in a single frame
(its libinput backend generates a single tip event with axis data
attached to it). Since the tip events are dispatched immediately,
they can have wrong information associated with them, for example tool
position or pressure. It results in undesired "streaks" when the user
presses the tablet tool against the tablet.

See also https://bugs.kde.org/show_bug.cgi?id=479856.

Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2032>
2025-06-25 11:44:07 +00:00
Alan Coopersmith
6a9b2f37bb Revert "os: log: replace LogMessageVerbSigSafe() by LogMessageVerb()"
This reverts commit dd37cc4855.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:51 +00:00
Alan Coopersmith
8ff12a8e53 Revert "os: log: replace ErrorFSigSafe() by ErrorF()"
This reverts commit 2d18c353b4.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:50 +00:00
Alan Coopersmith
6dc94cb934 Revert "os: log: replace VErrorFSigSafe() by VErrorF()"
This reverts commit da22bc9ae0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:50 +00:00
Alan Coopersmith
523409ca2c Revert "xwin: drop duplicate OsVendorVErrorF()"
This reverts commit 9652bc73e2.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:49 +00:00
Alan Coopersmith
ebcec3629c Revert "os: log: replace VErrorF() by LogVMessageVerb()"
This reverts commit f4eb217f11.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2036>
2025-06-24 23:40:49 +00:00
Alan Coopersmith
6a49a358e3 Revert "xfree86: common: unexport UnloadModule() and UnloadSubModule()"
This reverts commit 00f69564c5.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2037>
2025-06-24 23:23:50 +00:00
Aaron Plattner
d258c26626 Revert "panoramix: don't install panoramiX.h and panoramiXsrv.h"
The NVIDIA driver still supports GLX across physical screens in Xinerama
configurations, and uses the definitions in these headers to do that.

This reverts commit 3f469acb96.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 11:23:14 -07:00
Aaron Plattner
15ca09904a Revert "mi: unexport miWindowExposures()"
libwfb.so has a reference to this function:

 $ nm -D ./build.debug/hw/xfree86/dixmods/libwfb.so | grep miWindowExposures
                  U miWindowExposures

This reverts commit e424f49cdb.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2025-06-24 10:52:53 -07:00
Alan Coopersmith
8006778970 Revert "xfree86: common: move private defs out of xf86sbusBus.h"
This reverts commit 50d1a98c6a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
4e315f0b94 Revert "xfree86: int10: move private defs out of xf86int10.h"
This reverts commit a0eea4e0ec.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
711fdc51f1 Revert "xfree86: common: move private defs from xf86Xinput.h to xf86Xinput_priv.h"
This reverts commit df33e1c51b.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
c692580d74 Revert "xfree86: common: move private defs out of xf86VGAarbiter.h"
This reverts commit 013eaacdd0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
d13ba4a9e5 Revert "xfree86: modes: move private definitions out of from xf86RandR12.h"
This reverts commit ac5e95be49.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
58f469947b Revert "xfree86: parser: move private defs from xf86Parser.h to xf86Parser_priv.h"
This reverts commit d4724009ce.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
98e082ffe4 Revert "xfree86: ddc: move private definitions from xf86DDC.h to xf86DDC_priv.h"
This reverts commit 00c2a8fb0a.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
781a12fb8d Revert "xfree86: move private definitions out of dri2.h"
This reverts commit 1d3c26446d.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
41a55b1e2a Revert "xfree86: move private definitions out of dri.h"
This reverts commit cf03948572.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
44c89ebf32 Revert "xfree86: sdksyms.sh: add more headers"
This reverts commit 1efb2151e3.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2027>
2025-06-19 16:03:01 +00:00
Alan Coopersmith
b82110826f Revert "os: move out extension disable flags to corresponing extensions"
This reverts commit 356e18dcc6.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2022>
2025-06-17 20:54:49 +00:00
Alan Coopersmith
33a11228cf Revert "include: unexport no*Extension flags"
This reverts commit e3cbde9914.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2022>
2025-06-17 20:54:49 +00:00
Alan Coopersmith
d7e741665b Revert "xfree86: drop xf86MsgVerb() in favor of LogMessageVerb()"
This reverts commit 14767eccc0.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:06 +00:00
Alan Coopersmith
64593971d7 Revert "xfre86: drop xf86Msg() in favor of LogMessageVerb()"
This reverts commit a136ce3d57.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:06 +00:00
Alan Coopersmith
746f249a0d Revert "xfree86: use LogMessageVerb() instead of xf86MsgVerb()"
This reverts commit 6fc4f35f62.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:05 +00:00
Alan Coopersmith
692800af00 Revert "xfree86: i2c: use LogMessageVerb() instead of xf86Msg()"
This reverts commit 1f93ec5c33.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:05 +00:00
Alan Coopersmith
714d7ea170 Revert "xfree86: os-support: use LogMessageVerb() instead of xf86Msg()"
This reverts commit 4ba0cf1f55.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2021>
2025-06-17 20:42:05 +00:00