Commit Graph

1784 Commits

Author SHA1 Message Date
Roman Gilg e4dabe8d93 Remove build-only include from public header
The dix-config.h file is not installed, but dix.h is. The include makes the
compilation of external drivers fail (for example the libinput driver).

The Xserver compilation also works without the include, so just remove it.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
2021-08-07 14:26:26 +02:00
Demi Marie Obenour 5c2592cbb1 Add do-while loops to DIX macros
This ensures they will behave properly in conditionals and always
require a trailing semicolon.
2021-07-31 08:55:52 -04:00
Alex Richardson d83c84bd9d Mark the dixChangeWindowProperty() value argument as const
It is copied using memcpy() and not modified so we can add const. This
fixes a -Wincompatible-pointer-types-discards-qualifiers compiler warning
that was failing a -Werror XVnc build for me.

Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2021-07-30 08:36:35 +00:00
Povilas Kanapickas b67e514dbb meson: Fix warnings when reading back and checking feature flags
Meson does not like comparing things of different types which is a
problem when reading back values of feature flags as they may contain
either false (bool) or 1 (string).

Since there is a strong reason why we use false when the feature does
not exist, we work around this issue by always converting the returned
value to int via to_int().

Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1190
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-07-05 12:46:14 +00:00
Olivier Fourdan 6b47321bc6 dix: Add optional terminate delay
When the command line option "-terminate" is used, it could be
interesting to give it an optional grace period to let the Xserver
running for a little longer in case a new connection occurs.

This adds an optional parameter to the "-terminate" command line option
for this purpose.

v2: Use a delay in seconds instead of milliseconds
    (Martin Peres <martin.peres@mupuf.org>)
v3: Clarify man page entry, ensure terminateDelay is always >= 0,
    simplify TimerFree(). (Peter Hutterer <peter.hutterer@who-t.net>)

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-07 17:28:05 +02:00
Olivier Fourdan e167299f60 xfixes: Add ClientDisconnectMode
With Wayland compositors now being able to start Xwayland on demand, the
next logical step is to be able to stop Xwayland when there is no more
need for it.

The Xserver itself is capable of terminating itself once all X11 clients
are gone, yet in a typical full session, there are a number of X11
clients running continuously (e.g. the Xsettings daemon, IBus, etc.).

Those always-running clients will prevent the Xserver from terminating,
because the actual number of X11 clients will never drop to 0. Worse,
the X11 window manager of a Wayland compositor also counts as an X11
client, hence also preventing Xwayland from stopping.

Some compositors such as mutter use the XRes extension to query the X11
clients connected, match their PID with the actual executable name and
compare those with a list of executables that can be ignored when
deciding to kill the Xserver.

But that's not just clumsy, it is also racy, because a new X11 client
might initiate a connection the X11 server right when the compositor is
about to kill it.

To solve this issue directly at the Xserver level, this add new entries
to the XFixes extension to let the X11 clients themselves specify the
disconnect mode they expect.

Typically, those X11 daemon clients would specify the disconnect mode
XFixesClientDisconnectFlagTerminate to let the Xserver know that they
should not be accounted for when checking the remaining clients prior
to terminate.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-07 17:28:05 +02:00
Povilas Kanapickas dccc0275f4 Bump XI protocol version to 2.4 2021-05-30 13:26:44 +03:00
Povilas Kanapickas 5163fc8bc2 Implement gesture processing logic 2021-05-30 13:26:42 +03:00
Povilas Kanapickas 100a2ad6da dix: Implement gesture event submission code path 2021-05-30 13:26:40 +03:00
Povilas Kanapickas 7656a9c8dd dix: Implement internal gesture state handling 2021-05-30 13:26:39 +03:00
Povilas Kanapickas 227f601de3 xi: Implement conversions from internal to Xi2 gesture event structs 2021-05-30 13:26:37 +03:00
Povilas Kanapickas f83f7dbb1c xi: Bump max supported XI2 event type 2021-05-30 13:26:34 +03:00
Povilas Kanapickas 080bac39c8 xi: Implement grab support for new gesture event types 2021-05-30 13:26:32 +03:00
Povilas Kanapickas b544a1fdb8 xi: Implement internal gesture event struct 2021-05-30 13:26:31 +03:00
Povilas Kanapickas 22fa31ed56 dix: Add new internal event enums for gesture events 2021-05-30 13:26:30 +03:00
Jan Beich eceafd4a2d meson: switch getpeer* checks to autotools style
Checking for function "getpeereid" : YES
Checking for function "getpeerucred" : NO
[...]
include/meson.build:182:7: ERROR: Argument to "not" is not a boolean.

Fixes: 68c2cfadd6 ("meson: Make sure defines are either set to 1 or not defined")
2021-04-09 16:44:27 +00:00
Jan Beich 9f8421af63 meson: check pthread_setname_np like autotools
FreeBSD < 12.2 and OpenBSD only have pthread_set_name_np.
As libpthread isn't in scope use -Werror to trip the check.

Header <pthread.h> has symbol "PTHREAD_MUTEX_RECURSIVE" : YES
Checking if "pthread_setname_np(tid, name)" compiles: YES

os/inputthread.c:326:5: error: implicit declaration of function 'pthread_setname_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    pthread_setname_np (pthread_self(), "InputThread");
    ^
os/inputthread.c:447:5: error: implicit declaration of function 'pthread_setname_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    pthread_setname_np (pthread_self(), "MainThread");
    ^

Fixes: c20e7b5e22 ("meson: Automatically detect HAVE_PTHREAD_SETNAME_NP")
2021-04-09 15:43:37 +00:00
Povilas Kanapickas 68c2cfadd6 meson: Make sure defines are either set to 1 or not defined
This will make the behavior of meson consistent with autotools. The
configuration macros are exposed to public headers so any inconsistency
is likely to break code for anyone who's not careful to use #ifdef
instead of #if.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-04-09 11:18:54 +00:00
Povilas Kanapickas faff5bbdf5 meson: Sync the name of INPUTTHREAD conf macro with autotools build
The rest of dix code uses INPUTTHREAD, so having a different name in
meson configuration was an oversight.

Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/936

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2021-04-09 11:18:54 +00:00
Povilas Kanapickas 2df55813d0 meson: Drop version subpatch handling 2021-04-08 14:06:02 +00:00
Adam Jackson 5d3679104a meson.build: Keep the protocol version looking like xserver 1.20.x did
This effectively changes the versioning to be as if xserver 21.0 was
xserver 1.21.0. This should keep any client-side version checks that
know about the Xorg 7.0 -> xserver 1.0 epoch from getting confused.
2021-04-08 14:06:02 +00:00
George Matsumura 3e4e70db10 meson: Fix DragonFly BSD identifier in meson build files
This changes the operating system identifier tested against
host_machine.system() in meson build files from "dragonflybsd"
to the officially stable "dragonfly".

Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
2021-04-08 02:23:21 +00:00
Michel Dänzer 6c51818a0f meson: Make sure XKM_OUTPUT_DIR has a trailing slash
RunXkbComp passes an invalid file path to xkbcomp if there's no
trailing slash.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1146
Suggested-by: Dylan Baker <dylan.c.baker@intel.com>
2021-03-15 16:53:46 +01:00
Jan Beich 376eaadde3 meson: hide C API if Xorg is disabled (like autotools)
When building only Xwayland using Meson some files are always installed.
This causes package conflict if Xwayland is built separately from Xorg.

  include/xorg/compositeext.h
  include/xorg/damage.h
  include/xorg/damagestr.h
  include/xorg/dbestruct.h
  include/xorg/dri3.h
  include/xorg/fb.h
  include/xorg/fboverlay.h
  include/xorg/fbpict.h
  include/xorg/fbrop.h
  include/xorg/geext.h
  include/xorg/geint.h
  include/xorg/glyphstr.h
  include/xorg/mi.h
  include/xorg/micmap.h
  include/xorg/micoord.h
  include/xorg/migc.h
  include/xorg/miline.h
  include/xorg/mioverlay.h
  include/xorg/mipict.h
  include/xorg/mipointer.h
  include/xorg/mipointrst.h
  include/xorg/mistruct.h
  include/xorg/misync.h
  include/xorg/misyncfd.h
  include/xorg/misyncshm.h
  include/xorg/misyncstr.h
  include/xorg/mizerarc.h
  include/xorg/panoramiX.h
  include/xorg/panoramiXsrv.h
  include/xorg/picture.h
  include/xorg/picturestr.h
  include/xorg/present.h
  include/xorg/presentext.h
  include/xorg/randrstr.h
  include/xorg/rrtransform.h
  include/xorg/shadow.h
  include/xorg/shmint.h
  include/xorg/syncsdk.h
  include/xorg/vndserver.h
  include/xorg/wfbrename.h
  include/xorg/xace.h
  include/xorg/xacestr.h
  include/xorg/xorg-server.h
  include/xorg/xvdix.h
  include/xorg/xvmcext.h
  share/aclocal/xorg-server.m4

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2021-03-11 00:22:36 +00:00
Olivier Fourdan b5e1f13681 dix: Add POINTER_RAWONLY flag
This add a new flag POINTER_RAWONLY for GetPointerEvents() which does
pretty much the opposite of POINTER_NORAW.

Basically, this tells GetPointerEvents() that we only want the
DeviceChanged events and any raw events for this motion but no actual
motion events.

This is preliminary work for Xwayland to be able to use relative motion
events for raw events. Xwayland would use absolute events for raw
events, but some X11 clients (wrongly) assume raw events to be always
relative.

To allow such clients to work with Xwayland, it needs to switch to
relative raw events (if those are available from the Wayland
compositor).

However, Xwayland cannot use relative motion events for actual pointer
location because that would cause a drift over time, the pointer being
actually controlled by the Wayland compositor.

So Xwayland needs to be able to send only relative raw events, hence
this API.

Bump the ABI_XINPUT_VERSION minor version to reflect that API addition.

v2: Actually avoid sending motion events (Peter)
v3: Keep sending raw emulated events with RAWONLY (Peter)

Suggested-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1130
2021-02-15 09:42:00 +01:00
Jeremy Huddleston Sequoia f699aac2ea xquartz: Remove check for libdispatch now that we don't support pre-SnowLeopard
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01 16:21:39 -08:00
Povilas Kanapickas f5220117e9 dix: Extract FreezeThisEventIfNeededForSyncGrab() 2020-11-25 04:20:22 +00:00
Povilas Kanapickas 36f8dacc06 dix: Extract ActivateGrabNoDeliver() 2020-11-25 04:20:22 +00:00
Povilas Kanapickas 23a8b62d34 dix: Store replayed event into GrabInfoRec struct as InternalEvent* 2020-11-25 04:20:22 +00:00
Povilas Kanapickas 8bd8b3af19 dix: Rename LISTENER_* to TOUCH_LISTENER_* 2020-11-25 04:20:22 +00:00
Povilas Kanapickas 56d7205921 dix: Extract DeliverDeviceClassesChangedEvent() utility function 2020-11-25 04:20:21 +00:00
Povilas Kanapickas 5b0c5344b7 dix: Extract CopySprite() utility 2020-11-25 04:20:21 +00:00
Michel Dänzer add3df2001 Consolidate fourcc.h
Move the copy in hw/xfree86/common to include/, and remove the one in
hw/kdrive/src/.

Fixes DIX glamor code including an xfree86 DDX header.
2020-09-15 11:43:16 +02:00
Dave Airlie ea47af87f6 xserver/output: rename some badly named variables/APIs.
This is an API and ABI break

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-10 06:17:44 +10:00
Alan Coopersmith 23e83724df Fix spelling/wording issues
Most (but not all) of these were found by using
  codespell --builtin clear,rare,usage,informal,code,names
but not everything reported by that was fixed.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-05 13:07:33 -07:00
Jan Beich b5b529799a meson: split udev from udev_kms which requires systemd
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
2020-05-27 07:16:02 +00:00
Adam Jackson ee9f6e20de meson: Add support for libunwind 2020-02-12 16:56:13 -05:00
Kenneth Graunke 25ca99df38 configure: Define GLAMOR_HAS_EGL_QUERY_DRIVER when available
Commit 195c2ef8f9 added this to the Meson
build but neglected to add it to autotools.

v2: Also update dix-config.h.in

Fixes: 195c2ef8f ("glamor: Add a function to get the driver name via EGL_MESA_query_driver")

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> [v1]
Reviewed-by: Eric Engestrom <eric@engestrom.ch> [v1]
Reviewed-by: Matt Turner <mattst88@gmail.com>
2020-01-14 12:50:53 -08:00
Kenneth Graunke 195c2ef8f9 glamor: Add a function to get the driver name via EGL_MESA_query_driver
This maps to eglGetDisplayDriverName if EGL_MESA_query_render is
supported, otherwise it returns NULL.
2019-11-26 01:13:45 -08:00
Matt Turner e6ab7f9f34 xfree86: Test presence of isastream()
isastream() was never more than a stub in glibc, and was removed in
glibc-2.30 by commit a0a0dc83173c ("Remove obsolete, never-implemented
XSI STREAMS declarations").

Bug: https://bugs.gentoo.org/700838
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-11-22 15:22:43 -05:00
Arthur Williams fe439596b9 include: Increase the number of max. input devices to 256.
Extending the decade old f0124ed93, to increase the number of input
devices from 40 to 256. 40 translates at most 9 MD, while 256 will allow
63 MD. It is an arbitrary number, but people are hitting the current
limit under reasonable conditions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64793
Signed-off-by: Arthur Williams <taaparthur@gmail.com>
2019-11-09 23:05:13 -05:00
Jon Turney 622eea366a meson: Add sha1 library options
v2: Set the define for xha1.c programatically, rather than using loads
of conditionals.
2019-10-30 16:58:39 +00:00
Adam Jackson 89a9927b1e include: Remove now-empty site.h 2019-10-30 16:17:04 +00:00
Adam Jackson ff4e2c24ec dix: Move default screensaver defaults into globals.c 2019-10-30 16:17:04 +00:00
Adam Jackson 43fc530780 include: Move some input-related default #defines to input.h 2019-10-30 16:17:04 +00:00
Adam Jackson 2d1ed64d2a dix: Remove -to option to set the default connection timeout
One minute is admittedly arbitrary, but again, pretty sure this never
gets set on the command line in practice.
2019-10-30 16:17:04 +00:00
Adam Jackson 46a275522f xdmcp: Remove unconfigurable COMPILEDDISPLAYCLASS 2019-10-30 16:17:04 +00:00
Adam Jackson 66eb933ec9 os: Remove unconfigurable DEFAULT_ACCESS_CONTROL macro 2019-10-30 16:17:04 +00:00
Adam Jackson 56ea4c769c dix: Remove -fn and -fc options to set default text/cursor fonts
I strongly suspect these never get used in the wild, and it's not an
especially useful thing to do in any case.
2019-10-30 16:17:04 +00:00
Adam Jackson 4ebce1ed8b os: Move log verbosity defaults into os/log.c
There's not any configuration knobs for this so there's no real reason
to leave them in a configgy header.
2019-10-30 16:17:04 +00:00