Commit Graph

153 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult fe4bc433a4 sdk: reinstate COMPOSITE symbol
Composite extension is always enabled for pretty long time now, but some
drivers (eg. xf86-video-intel) still relying on this symbol being set,
otherwise assuming to run w/o composite and doing crazy things.

Fixes: d708b28adc
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-19 11:21:31 +02:00
Enrico Weigelt, metux IT consult c8b81fdbc5 drop Xwayland
It always had it's own lifecycle (not been part of Xorg releases),
doesn't make sense to maintain a competing implementation that we
won't use anyways.

Once that's gone, we can also drop few things in core/dix that had
been added just for xwayland only.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 12:51:36 +02:00
Enrico Weigelt, metux IT consult 4379f7cc87 Xnamespace: namespace extension skeleton
Add tiny skeleton for the namespace extension. Disabled by default,
can be enabled via +extension arg, but doesn't actually do something yet.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 5c0cbd0f92 os: drop own implementation of strcasecmp() and strncasecmp()
These are POSIX standard since 2001, so shouldn't be needed anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 945edb0186 meson.build: move writing conf_data into tail of main meson file
This allows us to do further probing in the included meson files:
Individual subdirectories (eg. DDXes, extensions, OS layer, ...)
can now probe things that are only relevant to them - no need to fill
the already too fat includes/meson.build with even more things.

Preparation for upcoming commits that'll make us of that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 9a82f5c30b drop remains of cygwin support
Cygwin support doesn't seem to be used anymore, so it can be dropped.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult a13a1e9264 dix: don't install selection.h anymore
This file isn't included by any driver - not even indirectly, and hard
to imagine any driver ever needs it, so no need to keep it installed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult 580f88464d dix: add generic Xinerama capable VRR infrastructure
We don't have a standard protocol for enabling VRR yet, but some time ago an
ad-hoc had been made in the amdgpu driver (later also copied to modsetting),
which works by client setting the _VARIABLE_REFRESH window property.

The way it's currently done - driver is highjacking the X_ChangeProperty and
X_DeleteProperty request handlers - is pretty fragile, and is also a violation
of layers: drivers never should be twisted with core protocol details. (And in
the future, this should be done by some suitable extension).

Another problem is Xinerama: when it's enabled, this only works on the first
screen - the others won't ever see this signal, no matter on which one(s) the
Window is physically placed (for the wire protocol, all windows are on screen 0,
unless the client explicitly creates them on another one)

This commit adds a generic Screen proc for telling the DDX, whether the VRR mode
shall be changed (for now, it's only DISABLED and ENABLED). Drivers can hook into
here in order to receive this signal, w/o having to highjack any core request
handlers. Catching the property change is now entirely done in the DIX.

The (non-standard) status qou of (ab)using window properties is kept, but it's
now also easy to add a new signaling mechanism, in case a standard is agreed on.

Yet a quite naive implementation (eg. not acting on moving windows between screens),
but enough to fix the most pressing problems supporting extra screens in general,
as well as stopping the highjacking of core request handlers by drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult eb95982b2a bsd: drop PCCONS support
The old PCCONS driver only seems to be used on minimal install disks and
cannot coexist with newer ones (at least that's the feedback I've gotten
from BSD community), so there's probably no practical use case for
supporting it in Xorg anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:31 +02:00
Enrico Weigelt, metux IT consult d708b28adc treewide: drop COMPOSITE symbol
It's always enabled for very long time now (at least since meson transition),
there doesn't seem to be any need to ever disable it again. So we can reduce
code complexity by removing all the ifdef's.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:47:01 +02:00
Enrico Weigelt, metux IT consult 1c088613ba include: don't install propertyst.h
Nothing in here needs anything from that include file, so no need for
including it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:31:02 +02:00
Enrico Weigelt, metux IT consult e9351ba7e0 include: drop obsolete dixevents.h
The include has become empty now. Not used by any external drivers,
so it can be dropped now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:35 +02:00
Alan Coopersmith 4b5d410591 dix-config.h: define HAVE_STRUCT_SOCKADDR_STORAGE for xtrans 1.6
xtrans 1.6 will use struct sockaddr_storage if HAVE_STRUCT_SOCKADDR_STORAGE
is defined, even if IPv6 is disabled, unlike previous versions which tied
it to the IPv6 #define.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1864>
2025-03-14 22:38:36 +00:00
Enrico Weigelt, metux IT consult 171db3b01b meson: drop defining BIGREQS
This symbol isn't used for decades, so no need to define it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1700>
2025-02-06 23:22:31 +00:00
Enrico Weigelt, metux IT consult f8fc46cbbf include: drop now empty xkbfile.h
This (public) file isn't used by anybody outside Xserver tree
and doesn't contain anything useful anymore, so lets drop it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1729>
2025-02-06 22:45:25 +00:00
Enrico Weigelt, metux IT consult 4775f547d8 netbsd: disable pccons support
On NetBSD, pccons is (almost) dead: only remaining port is arc,
but only on some specific kernel, which is unlikely to be used
for running X.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1588>
2025-02-06 19:03:25 +00:00
Enrico Weigelt, metux IT consult fb696a7d7b rename old symbol PANORAMIX to XINERAMA
PANORAMIX was the original working title of the extension, before it became
official standard. Just nobody cared about fixing the symbols to the official
naming.

For backwards compatibility with drivers, the old PANORAMIX symbol will
still be set.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1258>
2025-02-06 15:51:27 +00:00
Alan Coopersmith 6cc358dfb4 os: if inet_ntop() is available, use it for IPv4 addresses as well
Support for using inet_ntop() was originally added to support IPv6,
and only used for IPv6 addresses in AuthAudit().  Two decades later,
support for inet_ntop() is ubiquitous and OS'es have marked inet_ntoa()
as deprecated, so use the modern interface for IPv4 as well now.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1760>
2025-01-27 22:34:51 +00:00
Alan Coopersmith 2ffe0f8a35 os: if getaddrinfo() is available, use it, even if IPv6 support is disabled
Support for using getaddrinfo() was originally added to support IPv6,
and only used if IPv6 support was enabled.  Two decades later, support
for getaddrinfo() is ubiquitous and OS'es have marked gethostbyname()
as deprecated, so use the modern interface whenever we can now.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1760>
2025-01-27 22:34:51 +00:00
Alan Coopersmith a1b5aa5a7f dix-config.h: add HAVE_SOCKLEN_T definition
Needed to build with IPv6 disabled using gcc 14 on some platforms to avoid:

In file included from /usr/X11/include/X11/Xtrans/transport.c:67,
                 from xstrans.c:17:
/usr/X11/include/X11/Xtrans/Xtranssock.c: In function ‘_XSERVTransSocketOpen’:
/usr/X11/include/X11/Xtrans/Xtranssock.c:467:28: error: passing argument 5
 of ‘getsockopt’ from incompatible pointer type [-Wincompatible-pointer-types]
  467 |             (char *) &val, &len) == 0 && val < 64 * 1024)
      |                            ^~~~
      |                            |
      |                            size_t * {aka long unsigned int *}

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1736>
2024-10-30 12:26:58 -07:00
Enrico Weigelt, metux IT consult 84be5b4e9c dix: unexport non-public functions from dixgrabs.h and document prototypes
* unexport functions from dixgrab.h, that aren't used by any driver/module.
* add paremeter names to prototypes
* add doxygen-style documentation for all the prototypes

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-10 13:50:57 +00:00
Enrico Weigelt, metux IT consult 03eb593460 include: unexport XIstubs.h
The functions declared here aren't used by any driver, so no need to keep
them in the public driver API. Since the whole file isn't included by anybody
outside the xserver tree itself, it doesn't need to be installed at all,
so making it internal and move it to Xi directory.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1325>
2024-09-01 22:21:12 +00:00
Enrico Weigelt, metux IT consult 69b57fd01f os: move defining LOCK_SERVER into meson
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1320>
2024-07-26 22:26:07 +00:00
Enrico Weigelt, metux IT consult 86d0f6dafa include: drop obsolete check for typeof operator
It really seems that compilers on all our supported platforms
(including Solaris) supporting `typeof`, so we can always use it
and drop hacks with undefind behaviour entirely.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1432>
2024-04-22 22:15:45 +00:00
Enrico Weigelt, metux IT consult d2d3f4a700 os: define SECURE_RPC locally instead of global config header
Since this define is only used inside os subdir, move the definition there
and out of the global config header. This also makes some further steps,
e.g. checking whether it's supported, a litle bit easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1441>
2024-04-17 23:38:25 +00:00
Enrico Weigelt, metux IT consult 272e2915fe config: fix wscons backend on NetBSD
Compiler gives warning:

    ../config/wscons.c: At top level:
    ../config/wscons.c:262:1: warning: no previous prototype for ‘config_wscons_init’ [-Wmissing-prototypes]
      262 | config_wscons_init(void)
          | ^~~~~~~~~~~~~~~~~~
    ../config/wscons.c:270:1: warning: no previous prototype for ‘config_wscons_fini’ [-Wmissing-prototypes]
      270 | config_wscons_fini(void)
          | ^~~~~~~~~~~~~~~~~~

Problem is: commit bcee84c3e4 wanted to enable
wscons support on NetBSD, but only added compiling config/wscons.c, but didn't
enable setting the CONFIG_WSCONS symbol, so it won't be called at all.

Fixes: bcee84c3e4
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1450>
2024-04-02 09:50:56 +02:00
Enrico Weigelt, metux IT consult 2003adfd33 xwin: consolidate debugging symbols
We've got three #define's that are all set at once, on enable_debugging.

A comment in meson.build already asks for consolidating them into one,
so just do it now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1409>
2024-03-19 02:05:35 +00:00
Enrico Weigelt, metux IT consult afaad1b847 include: add comment on _XSERVER64 define
Since the whole 32/64 bit issue is a bit complex, it's worth adding some
comment on what the _XSERVER64 symbol really is needed for.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1413>
2024-03-18 23:24:36 +00:00
Olivier Fourdan 701284f057 xwayland/glamor: Drop the EGLStream backend
Now that the NVIDIA proprietary driver has grown support for GBM, the
EGLStream backend for NVIDIA GPUs is now superseded by the standard
GBM backend in Xwayland.

This code path is therefore not used and hardly ever tested.

Remove support for EGLStream in Xwayland.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
2024-03-18 15:41:17 +00:00
Enrico Weigelt, metux IT consult 8f2894c4d0 include: unexport xserver_poll.h
It doesn't seem to have any exported functions, so doesn't need to be
exported to the public module API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1352>
2024-03-12 15:01:35 +00:00
Enrico Weigelt, metux IT consult c66eaf431c include: dont install glx_extinit.h
This header isn't included by any (known) driver/module and doesn't export
any functions, thus no need to install it anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1361>
2024-03-09 17:57:25 +00:00
Enrico Weigelt, metux IT consult 17ad53c803 include: unexport registry.h
This file isn't included by any known modules, so no need to keep it
around in the public api.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1348>
2024-03-03 23:20:06 +00:00
Enrico Weigelt, metux IT consult c3255fbc1c os: drop unneeded DDXOSVERRORF conditional
This conditional practically only controls whether we have an pointer,
where DDX can plug in it's own VErrorF() handler (currently only xwin
doing that). The cost of having it even when DDX doesn't use it, is
really negligible: it's just one pointer and an extra non-null check
on it per VErrorF() call - a very cold path. Strangely, xwin has extra

Getting rid of this unnecessary complexity that really hasn't any
practical gain.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1329>
2024-03-03 23:15:14 +00:00
Enrico Weigelt, metux IT consult ebabca56a4 consolidate MITSHM and HAS_SHM symbols
Both symbols are set on exactly the same condition (build_mitshm),
so can be consolidated into one: MITSHM

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1296>
2024-03-03 23:07:18 +00:00
Enrico Weigelt, metux IT consult 5b2c00d38a include: drop closestr.h from public module API
None of the public module API functions use the types defined in here,
this file isn't even included anywhere (in the public headers). Thus it
doesn't seem to be needed in the public API at all - so make it private.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1281>
2024-03-03 22:46:34 +00:00
Enrico Weigelt, metux IT consult eed0697ec9 os: consolidate busfault handling
The symbols HAVE_SIGACTION and BUSFAULT are set under the same conditions,
so can be consolidated into one. Also define dummies when HAVE_SIGACTION
is not set, so a few #ifdef's less clutterig the code.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1297>
2024-02-23 23:15:12 +00:00
Enrico Weigelt, metux IT consult 834acc88fb factor out X_REGISTRY_RESOURCE and X_REGISTRY_REQUEST to meson.build
there are several feautures depending on LookupResourceName() et al,
so set these symbole inside meson.build, instead of #define'ing them
conditionally in registry.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1262>
2024-02-23 23:02:00 +00:00
Enrico Weigelt, metux IT consult 8d2117abeb hw: xwayland: fix build if neither gbm nor eglstream available
glamor needs to be disabled if neither gbm nor eglstream is available,
otherwise build breaks.

Closes: xorg/xserver#1631
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-19 00:53:30 +00:00
Matthieu Herrb 238f8edcaf xfree86/bsd: fix build on NetBSD/amd64.
The IOPL function for 64 bit systems is x86_64_iopl() there
2024-02-18 00:03:45 +00:00
Olivier Fourdan 7fdef970c4 build: Switch to meson 0.56
And replace the deprecated meson API accordingly.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2024-01-08 10:38:05 +00:00
Sam James 515b240a24 meson: add option for systemd_notify
Without this, systemd will be used if installed on the system automagically,
which is a problem if the built e.g. Xwayland is going to be used on a non-systemd
machine.

Bug: https://bugs.gentoo.org/908254
Signed-off-by: Sam James <sam@gentoo.org>
2024-01-08 01:23:55 +00:00
Jan Beich 58e8c967b6 os: Use LOCAL_PEERCRED to determine local client PID on FreeBSD
LOCAL_PEERCRED is similar to SO_PEERCRED but takes SOL_LOCAL. On DragonFly
cr_pid isn't supported yet, so fall back to getpeereid().

Based on https://gitlab.freedesktop.org/wayland/wayland/-/commit/54b237a61257
2023-12-17 17:07:16 +00:00
John Kennedy 997e17eabe Enable USE_DEV_IO on FreeBSD/aarch64 2023-10-22 16:08:21 +00:00
Peter Hutterer a133334270 xwayland: Add XTEST support using EIS
This adds support for XTEST in Xwayland using EIS, the emulated input
library [1].

To differentiate between X11 clients using XTEST, initiate a EI context
for each client and use the actual client name, from its command
line.

When an X11 client first tries to use XTEST to generate emulated input
events, a new connection to libEI is initiated by Xwayland on behalf
of the X11 client.

During that connection phase, the EI server will not be accepting
events until the emulated device is actually created, meaning that any
XTEST request from the X11 client will be discarded until the EI server
is willing to accept events.

To avoid that issue, add an event queue in Xwayland per X11 client that
will keep those requests, and dequeue them as soon as the EI server is
ready, i.e. once the EI device is added.

If the X11 client disconnects from the Xserver before the EI server is
ready, or if the connection is closed by the EI server, those events are
discarded and the queue cleared from any pending events.

For 10 minutes after the client disconnects, keep the internal struct
alive. If a client with the same commandline arguments connects again,
re-use the same struct. This means we are faster with the events the
second time around but it also allows the EIS server to pause individual
clients that keep sending intermittent events and disconnect immediately
(e.g. it'd be possible to pause xdtotool while an authentication prompt
is active).

[1] https://gitlab.freedesktop.org/libinput/libei

Thanks to Jan Beich <jbeich@FreeBSD.org> for fixing the build on BSD.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Co-authored-by: Olivier Fourdan <ofourdan@redhat.com>
Co-authored-by: David Redondo <kde@david-redondo.de>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2023-06-26 13:19:19 +02:00
Simon Ser 636c9aa359 build: set _GNU_SOURCE when checking for SO_PEERCRED
SO_PEERCRED is not POSIX, so might be hidden unless _GNU_SOURCE
is defined.

See [1]: cc.has_header_symbol() does not inherit the project
arguments.

[1]: https://github.com/mesonbuild/meson/issues/3301

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-04-14 14:59:05 +00:00
Simon Ser f31ca9238f xwayland: use gbm_bo_create_with_modifiers2()
This allows us to pass flags to the function, avoiding the forced
implicit GBM_BO_USE_SCANOUT which happens with the older version.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2023-04-12 10:44:25 +02:00
Olivier Fourdan 2f8778ca68 xwayland: wl_pointer.axis_v120 is no longer optional
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>
2023-02-09 22:57:00 +00:00
Jeremy Huddleston Sequoia 8a4ab22873 os: Use LOCAL_PEERPID from sys/un.h if it is available to detemine the pid 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>
2023-01-26 17:51:16 +00:00
Peter Hutterer 3a02f56b43 xwayland: hook up wl_pointer.axis_v120 events
For details on the protocol itself see the Wayland merge request:
https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72

The v120 event has a value base of 120, so one wheel detent is 120, half a
wheel is 60, etc. This is the API Windows has been using since Vista but it
requires HW support from the device. Logitech mice and many Microsoft mice of
the last decade or so have support and it's enabled in the kernel since v5.0.

The new events replace wl_pointer.axis_discrete events, once you bind to
wl_pointer >= 8 you only get the v120 events. So backwards compatibility
is simple, we just multiply the discrete events if we get them and
treat everything as 120 event internally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-01-18 13:33:54 +10:00
Jeremy Huddleston Sequoia 66e7b7349d Revert "meson: Don't build COMPOSITE for XQuartz"
This will allow us to remove build-time conditionalization on COMPOSITE
while still allowing XQuartz to disable it and use ROOTLESS.

This reverts commit 9c03733669.
2023-01-17 15:17:45 -08:00