• Hans de Goede's avatar
    dix: Add GetCurrentClient helper · 834a467a
    Hans de Goede authored
    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: default avatarOlivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
    Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    834a467a
Name
Last commit
Last update
..
.gitignore Loading commit data...
Makefile.am Loading commit data...
XIstubs.h Loading commit data...
Xprintf.h Loading commit data...
Xserver.d Loading commit data...
busfault.h Loading commit data...
callback.h Loading commit data...
client.h Loading commit data...
closestr.h Loading commit data...
closure.h Loading commit data...
colormap.h Loading commit data...
colormapst.h Loading commit data...
cursor.h Loading commit data...
cursorstr.h Loading commit data...
dbus-core.h Loading commit data...
displaymode.h Loading commit data...
dix-config-apple-verbatim.h Loading commit data...
dix-config.h.in Loading commit data...
dix.h Loading commit data...
dixaccess.h Loading commit data...
dixevents.h Loading commit data...
dixfont.h Loading commit data...
dixfontstr.h Loading commit data...
dixgrabs.h Loading commit data...
dixstruct.h Loading commit data...
eventconvert.h Loading commit data...
events.h Loading commit data...
eventstr.h Loading commit data...
exevents.h Loading commit data...
extension.h Loading commit data...
extinit.h Loading commit data...
extnsionst.h Loading commit data...
gc.h Loading commit data...
gcstruct.h Loading commit data...
globals.h Loading commit data...
glx_extinit.h Loading commit data...
glxvndabi.h Loading commit data...
hotplug.h Loading commit data...
input.h Loading commit data...
inputstr.h Loading commit data...
inpututils.h Loading commit data...
list.h Loading commit data...
meson.build Loading commit data...
misc.h Loading commit data...
miscstruct.h Loading commit data...
nonsdk_extinit.h Loading commit data...
opaque.h Loading commit data...
optionstr.h Loading commit data...
os.h Loading commit data...
pixmap.h Loading commit data...
pixmapstr.h Loading commit data...
privates.h Loading commit data...
probes.h Loading commit data...
property.h Loading commit data...
propertyst.h Loading commit data...
protocol-versions.h Loading commit data...
ptrveloc.h Loading commit data...
region.h Loading commit data...
regionstr.h Loading commit data...
registry.h Loading commit data...
resource.h Loading commit data...
rgb.h Loading commit data...
screenint.h Loading commit data...
scrnintstr.h Loading commit data...
selection.h Loading commit data...
servermd.h Loading commit data...
site.h Loading commit data...
swaprep.h Loading commit data...
swapreq.h Loading commit data...
systemd-logind.h Loading commit data...
validate.h Loading commit data...
version-config.h.in Loading commit data...
vidmodestr.h Loading commit data...
window.h Loading commit data...
windowstr.h Loading commit data...
xkb-config.h.in Loading commit data...
xkbfile.h Loading commit data...
xkbrules.h Loading commit data...
xkbsrv.h Loading commit data...
xkbstr.h Loading commit data...
xorg-config.h.in Loading commit data...
xorg-config.h.meson.in Loading commit data...
xorg-server.h.in Loading commit data...
xorg-server.h.meson.in Loading commit data...
xserver-properties.h Loading commit data...
xserver_poll.h Loading commit data...
xsha1.h Loading commit data...
xwayland-config.h.in Loading commit data...
xwayland-config.h.meson.in Loading commit data...
xwin-config.h.in Loading commit data...
xwin-config.h.meson.in Loading commit data...