xserver-multidpi/include
Hans de Goede 834a467af9 dix: Add GetCurrentClient helper
Request-handlers as registered in the requestVector array, always get
passed the clientPtr for the client which sent the request.
But the implementation of many request-handlers typically consists of
a generic handler calling implementation specific callbacks and / or
various helpers often multiple levels deep and in many cases the clientPtr
does not get passed to the callbacks / helpers.

This means that in some places where we would like to have access to the
current-client, we cannot easily access it and fixing this would require
a lot of work and often would involve ABI breakage.

This commit adds a GetCurrentClient helper which can be used as a
shortcut to get access to the clienPtr for the currently being processed
request without needing a lot of refactoring and ABI breakage.

Note using this new GetCurrentClient helper is only safe for code
which only runs from the main thread, this new variable MUST NOT be used
by code which runs from signal handlers or from the input-thread.

The specific use-case which resulted in the creation of this patch is adding
support for emulation of randr / vidmode resolution changes to Xwayland.
This emulation will not actually change the monitor resolution instead it
will scale any window with a size which exactly matches the requested
resolution to fill the entire monitor. The main use-case for this is
games which are hard-coded to render at a specific resolution and have
sofar relied on randr / vidmode to change the monitor resolution when going
fullscreen.

To make this emulation as robust as possible (e.g. avoid accidentally scaling
windows from other apps) we want to make the emulated resolution a per client
state. But e.g. the RRSetCrtc function does not take a client pointer; and is
a (used) part of the Xorg server ABI (note the problem is not just limited
to RRSetCrtc).

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2019-10-12 12:19:14 +02:00
..
.gitignore dtrace: Move Xserver.d from dix/ to include/ 2019-08-27 17:38:54 -04:00
busfault.h Trap SIGBUS to handle truncated shared memory segments 2013-11-11 15:16:07 -08:00
callback.h Avoid starting a comment with */* 2014-07-17 10:19:52 -07:00
client.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
closestr.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
closure.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
colormap.h dix: Unexport various implementation details 2015-07-08 16:40:57 -04:00
colormapst.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
cursor.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
cursorstr.h cursor: drop ARGB_CURSOR 2015-06-30 12:17:51 +10:00
dbus-core.h xfree86: drop double-typedef of DBusConnection 2014-11-12 10:25:00 +10:00
displaymode.h vidmode: move display mode definitions 2016-02-29 16:28:57 -05:00
dix-config-apple-verbatim.h Move the apple fat binary hacks back to a header file, and make it apple-only. 2009-01-30 16:36:45 -08:00
dix-config.h.in configure: Check for sigprocmask 2019-05-18 14:59:38 +00:00
dix.h dix: Add GetCurrentClient helper 2019-10-12 12:19:14 +02:00
dixaccess.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
dixevents.h dix: Remove redundant declarations. 2012-05-14 13:31:00 +01:00
dixfont.h include: Stop including <X11/fonts/fontproto.h> 2018-10-25 12:32:48 -04:00
dixfontstr.h dix: Switch to the libXfont2 API (v2) 2016-07-18 15:25:59 -04:00
dixgrabs.h Avoid starting a comment with */* 2014-07-17 10:19:52 -07:00
dixstruct.h os: Define {ReadFdFrom,WriteFdTo}Client unconditionally 2018-03-08 14:12:36 -05:00
eventconvert.h input: drop FP1616 macro 2012-11-19 12:12:23 +10:00
events.h dga: #if XFreeXDGA → #ifdef XFreeXDGA 2018-02-19 13:14:43 -05:00
eventstr.h dga: #if XFreeXDGA → #ifdef XFreeXDGA 2018-02-19 13:14:43 -05:00
exevents.h dix: Move DeviceFocusEvent from Xi into enterleave.c 2012-05-17 08:50:44 +10:00
extension.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
extinit.h miinitext: Load GLX on the mi path 2018-02-14 17:04:48 -05:00
extnsionst.h dix: Remove extension aliases 2017-06-20 16:37:24 -04:00
gc.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
gcstruct.h fb: Remove 24bpp support (v3) 2017-03-17 15:14:42 -04:00
globals.h miinitext: General cleanup (v2) 2018-01-22 17:28:12 -05:00
glx_extinit.h miinitext: Load GLX on the mi path 2018-02-14 17:04:48 -05:00
glxvndabi.h GLX: Add a function to change a clients vendor list. 2019-05-17 08:25:28 -07:00
hotplug.h config: Replace OdevAttributes linked list with struct 2014-07-17 17:10:48 -07:00
input.h dix: Remove LegalModifier() 2018-09-28 16:25:17 -04:00
inputstr.h miinitext: General cleanup (v2) 2018-01-22 17:28:12 -05:00
inpututils.h Input: Add DeviceEventSource enum 2015-11-24 11:36:32 +10:00
list.h Correct xorg_list_is_empty return value description 2018-02-12 08:09:53 +10:00
Makefile.am dtrace: Move Xserver.d from dix/ to include/ 2019-08-27 17:38:54 -04:00
meson.build meson: fix builds on Solaris 11.4 2019-09-23 16:28:42 -07:00
misc.h modesetting: Fix potential buffer overflow 2017-10-30 13:44:34 -04:00
miscstruct.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
nonsdk_extinit.h Make PseudoramiXExtensionInit() prototype more generally available 2015-03-16 16:56:17 +00:00
opaque.h dix: Remove the magic WhenMapped backing store hack 2018-10-23 18:37:46 +00:00
optionstr.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
os.h os: Ensure sigset_t is provided when compiling for MinGW 2019-05-18 14:59:38 +00:00
pixmap.h Make PixmapDirtyUpdateRec::src a DrawablePtr 2017-08-15 17:01:39 +09:00
pixmapstr.h Make PixmapDirtyUpdateRec::src a DrawablePtr 2017-08-15 17:01:39 +09:00
privates.h dix: Remove PRIVATE_DAMAGE 2017-03-21 11:20:26 -04:00
probes.h dtrace: s/#if/#ifdef/ for XSERVER_DTRACE 2019-08-27 17:38:59 -04:00
property.h dix: Add a callback chain for window property state change 2017-02-23 13:30:11 -05:00
propertyst.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
protocol-versions.h present: Advertise protocol version 1.2 2018-03-19 15:44:46 -04:00
ptrveloc.h dix: indentation fixes for pointer acceleration 2012-05-16 10:59:35 +10:00
region.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
regionstr.h dix: make RegionInit legal C++ 2015-01-23 10:35:49 -08:00
registry.h XSERVER_DTRACE needs request names from registry too 2014-09-22 12:00:46 -07:00
resource.h dix: export ResourceClientBits() 2015-09-01 20:11:26 -07:00
rgb.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
screenint.h dix: De-ugly the prototype for Add{GPU,}Screen 2018-10-30 12:21:41 -04:00
scrnintstr.h Make PixmapDirtyUpdateRec::src a DrawablePtr 2017-08-15 17:01:39 +09:00
selection.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
servermd.h dix: Fix image byte order on big endian hardware 2015-05-07 14:03:50 -04:00
site.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
swaprep.h dix: Unexport various implementation details 2015-07-08 16:40:57 -04:00
swapreq.h dix: Unexport various implementation details 2015-07-08 16:40:57 -04:00
systemd-logind.h systemd-logind: let the logind code decided whether to close an fd 2014-05-05 07:26:33 +10:00
validate.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
version-config.h.in Move VENDOR_* defines from AC_SUBST to a header to avoid angering shave. 2009-04-14 10:35:44 -04:00
vidmodestr.h vidmode: build without xf86vidmodeproto 2016-03-01 11:25:59 -05:00
window.h dix: Add hybrid full-size/empty-clip mode to SetRootClip 2016-02-22 13:26:31 -05:00
windowstr.h dix: Remove WindowRec::backStorage 2019-04-12 21:53:03 +00:00
XIstubs.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xkb-config.h.in Move to autoconf standard function name checks & defines 2011-12-05 14:32:45 -08:00
xkbfile.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
xkbrules.h xkb: add a call to init an XkbRMLVOSet from const chars 2014-02-04 10:53:59 +10:00
xkbsrv.h dix: Don't track the XKB client versions in the ClientRec 2017-10-24 15:53:28 -04:00
xkbstr.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
xorg-config.h.in xorg: Remove the XF86PM define. 2018-08-02 10:27:37 -04:00
xorg-config.h.meson.in xorg: Remove the XF86PM define. 2018-08-02 10:27:37 -04:00
xorg-server.h.in xorg: Remove unused definitions from xorg-server.h.in 2018-03-28 09:54:17 -04:00
xorg-server.h.meson.in meson: Generate xorg-server.h 2018-03-28 09:54:22 -04:00
Xprintf.h os/xprintf: add Xvscnprintf and Xscnprintf 2012-05-03 14:59:23 +10:00
xserver_poll.h Fix typo in error message 2019-01-10 18:40:20 +02:00
xserver-properties.h Add missing labels for multitouch valuators 2012-10-30 15:11:10 +10:00
Xserver.d dtrace: Move Xserver.d from dix/ to include/ 2019-08-27 17:38:54 -04:00
xsha1.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
xwayland-config.h.in xwayland: Add glamor egl_backend for EGLStreams 2018-04-24 16:51:18 -04:00
xwayland-config.h.meson.in xwayland: Add glamor egl_backend for EGLStreams 2018-04-24 16:51:18 -04:00
xwin-config.h.in configure: Restore DEFAULT_LOGDIR to xwin-config.h, it is used 2014-06-02 13:07:46 +01:00
xwin-config.h.meson.in Add meson.build for XWin server (v2) 2017-06-02 09:32:35 -07:00