834a467af9
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> |
||
---|---|---|
.. | ||
.gitignore | ||
atom.c | ||
buildatoms | ||
BuiltInAtoms | ||
colormap.c | ||
cursor.c | ||
devices.c | ||
dispatch.c | ||
dispatch.h | ||
dixfonts.c | ||
dixutils.c | ||
enterleave.c | ||
enterleave.h | ||
eventconvert.c | ||
events.c | ||
extension.c | ||
gc.c | ||
getevents.c | ||
globals.c | ||
glyphcurs.c | ||
grabs.c | ||
initatoms.c | ||
inpututils.c | ||
main.c | ||
Makefile.am | ||
meson.build | ||
pixmap.c | ||
privates.c | ||
property.c | ||
protocol.txt | ||
ptrveloc.c | ||
region.c | ||
registry.c | ||
resource.c | ||
selection.c | ||
stubmain.c | ||
swaprep.c | ||
swapreq.c | ||
tables.c | ||
touch.c | ||
window.c |