Commit Graph

19991 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult e1f8794b1d dix: add dixClientForInputClients()
Helper function for retrieving the owning client of an InputClients.

It's an actual function, so callers don't need access to internal
knowledge (definition of struct _InputClients, clients[] array, ...)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:21 +02:00
Enrico Weigelt, metux IT consult 0ca0c334d8 dix: add dixClientForGrab()
Helper function for retrieving the owning client of a grab.

It's an actual function, so callers don't need access to internal
knowledge (definition of GrabRec, clients[] array, ...)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:16 +02:00
Enrico Weigelt, metux IT consult d697618c16 dix: replace wClient() macro by dixClientForWindow() inline function
Hide internals (drop the need to include windowstr.h), make it typesafe
as well as the naming easier to understand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:13 +02:00
Enrico Weigelt, metux IT consult 261c49b4c2 dix: events: clean up XaceHookSendAccess() client arg
Use NullClient macro instead of NULL or 0.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:10 +02:00
Enrico Weigelt, metux IT consult 6f675e4d01 os: auth: protect against duplicate auth keys
Protect the Add() proto funcs from adding duplicate auth keys.
If adding a duplicate is attempted, the XID of the already
existing one is returned instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:06 +02:00
Enrico Weigelt, metux IT consult 1629400be5 os: xdmcp: simplify AddAuth handler call
No need for loading the address into temporary variable and later doing
indirect call, since we can easily do direct call in each branch.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:03 +02:00
Enrico Weigelt, metux IT consult 6c6e0b09a1 os: auth: let GenerateAuthorization() return 0 on error
XID = 0 already is used as sign for error in several places,
so let's use that here, too.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:59 +02:00
Enrico Weigelt, metux IT consult a68f5c125c os: auth: generate XIDs in proto funcs only on success
Generate the auth object XIDs inside the proto funcs and only
on success, so we don't unnecessarily allocate XIDs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:56 +02:00
Enrico Weigelt, metux IT consult e536c2035c os: auth: move GenerateRandomData() and make it static
Only used in mitauth.c, so we can move it there and make it static.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:53 +02:00
Enrico Weigelt, metux IT consult e89006d015 os: auth: factor out auth proto names into defines
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:49 +02:00
Enrico Weigelt, metux IT consult 73abb7150d os: auth: consolidate GenerateAuthorization()
No need for having two implementations in os/ vs xwin.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:45 +02:00
Enrico Weigelt, metux IT consult 0da8fc466d os: auth: use strlen() for auth proto name length
No need to explicitly hard-code strings lengths when we can use
standard strlen(). Those code pathes are so cold that trying to
spare a few cycled for an (usually inlined) strlen() doesn't seem
to justify any extra care.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:41 +02:00
Enrico Weigelt, metux IT consult 58e661e1cc os: auth: improve readability and robustness of auth proto list
The code is easier to understand, but also more robust (eg. against struct
layout changes) if structs are initialized with explicit field names
instead of as lists.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:37 +02:00
Enrico Weigelt, metux IT consult 030b441e21 dix: resource: protect FakeClientID() from returning 0
Some callers treating XID = 0 as a sign for non-existing resource.
Practically should not happen, but nevertheless adding extra
protection, just in case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:34 +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 bef80a0db9 Xnest: drop special hack for Xlib's GC type
Now that the name clash on GC type between Xserver and xlib has been fixed,
there's no need to do the special renaming hack anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:28 +02:00
Enrico Weigelt, metux IT consult 46eeeec810 fix name clash on 'GC' between Xlib and Xserver
Both xlib as well as the Xserver use the same identifier "GC" for
different types. While on xlib it's just the numerical ID of a GC,
the xserver defines a struct for it by the same name. This is this
ugly and needs ridiculous hacks for Xserver code that needs xlib.

Easy to solve by just renaming the GC typedef to GCRec (consistent
with how we're naming other structs) and replacing GC* by GCPtr.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:25 +02:00
Enrico Weigelt, metux IT consult 38d62bcc08 dix: CreateColormap() pass in ClientPtr instead of client index
The function actually operates on ClientRec, so we can pass it in
directly, so it doesn't need to fetch it from clients[] array itself.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:22 +02:00
Enrico Weigelt, metux IT consult 1c8ef6d44d dix: colormap: let AllocColorCells() operate on ClientPtr instead of index
It's only caller already has a pointer to client struct, so no need to
let this function look it up again in the global clients array.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:19 +02:00
Enrico Weigelt, metux IT consult b9df6ed8a2 Xv: fix segfault on shutdown
Protect against adaptor having NULL port list in XvStopAdaptors()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:16 +02:00
Enrico Weigelt, metux IT consult 96523e64f3 xfixes: consolidate ProcXFixesSelectSelectionInput()
No need to have it ripped into two pieces, just making upcoming
changes more complicated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:13 +02:00
Enrico Weigelt, metux IT consult 69078b1d15 include: document the meaning of SERVER_BIT
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:10 +02:00
Enrico Weigelt, metux IT consult 7501ca09b9 dix: rename dixLookupClient() to dixLookupResourceOwner()
Choose a bit more precise / descriptive name for that function.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:07 +02:00
Enrico Weigelt, metux IT consult a48b83b9a2 dix: dixLookupClient() align parameter naming with prototype
Align the function's parameter names with those defined in the prototype.
Especially it makes code easier to understand if the result parameter
is also named "result" here, as in the prototype.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:04 +02:00
Enrico Weigelt, metux IT consult 8e161ae771 Xext: sync: a bit of request handler documentation
Improve in-code docs of some request handlers, so it becomes a bit
more obvious what they're doing.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:52:01 +02:00
Enrico Weigelt, metux IT consult 098008879b Xres: XResQueryClientIds: enable security filtering
Pass each client we're considering to report through XaceHookClientAccess(),
so security extensions have a chance to filter them out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:58 +02:00
Enrico Weigelt, metux IT consult 750b65de69 Xres: XResQueryClientPixmapBytes: enable security filtering
Pass each client we're considering to report through XaceHookClientAccess(),
so security extensions have a chance to filter them out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:44 +02:00
Enrico Weigelt, metux IT consult 146b04f4e2 Xres: XResQueryClientResources: enable security filtering
Pass each client we're considering to report through XaceHookClientAccess(),
so security extensions have a chance to filter them out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:41 +02:00
Enrico Weigelt, metux IT consult 1594bad1f8 Xres: XResQueryClients: enable security filtering
Pass each client we're considering to report through XaceHookClientAccess(),
so security extensions have a chance to filter them out.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:38 +02:00
Enrico Weigelt, metux IT consult 2be400cd99 Xext: hashtable.h: unexport functions not used by drivers
This header isn't part of SDK and no external module using those functions,
so no need to keep them exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:36 +02:00
Enrico Weigelt, metux IT consult 8060c995f5 panoramix: unexport XineramaVisualsEqualPtr and make it static
There's no user outside of panoramiX.c, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:33 +02:00
Enrico Weigelt, metux IT consult 1741809555 panoramix: unexport XineramaGetImageData()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:29 +02:00
Enrico Weigelt, metux IT consult 9f538c4f40 panoramix: unexport resource types
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:26 +02:00
Enrico Weigelt, metux IT consult b13f5e19c3 panoramix: unexport XineramaDeleteResource()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:22 +02:00
Enrico Weigelt, metux IT consult 78cb102e64 panoramix: unexport XineramaRegisterConnectionBlockCallback()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:20 +02:00
Enrico Weigelt, metux IT consult 08a40b7b76 panoramix: unexport PanoramiXFindIDByScrnum()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:17 +02:00
Enrico Weigelt, metux IT consult 5a7d4f81e8 panoramix: unexport PanoramiXCreateConnectionBlock()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:15 +02:00
Enrico Weigelt, metux IT consult 5af7c30252 panoramix: unexport PanoramiXConsolidate()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:12 +02:00
Enrico Weigelt, metux IT consult 67e5b099fb panoramix: unexport PanoramiXTranslateVisualID()
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:09 +02:00
Enrico Weigelt, metux IT consult 194c28f5e5 panoramix: unexport screen dimension fields
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:06 +02:00
Enrico Weigelt, metux IT consult adfd065667 panoramix: drop unused XineramaReinitData()
Not used anywhere (also not in drivers), so no need to keep it around
any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:04 +02:00
Enrico Weigelt, metux IT consult 142fb829a4 Xace: drop obsolete XaceHook() prototype
The prototype had been forgetten when removing the function.

Fixes: facdaae4e8
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:51:01 +02:00
Enrico Weigelt, metux IT consult e58cb61e28 Xi: unexport PointerBarrierType field
Not used by any drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:57 +02:00
Enrico Weigelt, metux IT consult abfa0b888c compext: drop unused function CompositeRegisterImplicitRedirectionException()
Not used anywhere, neither internal nor drivers, so no need to keep it around.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:55 +02:00
Enrico Weigelt, metux IT consult 468e331cc9 dri: unexport drm_format_for_depth()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:52 +02:00
Enrico Weigelt, metux IT consult 3356690d35 dri: unexport dri3_send_open_reply()
Not used by any external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:49 +02:00
Enrico Weigelt, metux IT consult 6cd503f3c5 dri: fix missing include of dix-config.h
This header needs to be included first, otherwise things can easily get really
messed up. The current code only works by accident, because some other header
already including it early enough - but a subtle change in include order
can easy break it.

Thus, always make sure the header is really included first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:44 +02:00
Enrico Weigelt, metux IT consult 223c7ac40d exa: fix missing include of dix-config.h
This header needs to be included first, otherwise things can easily get really
messed up. The current code only works by accident, because some other header
already including it early enough - but a subtle change in include order
can easy break it.

Thus, always make sure the header is really included first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:42 +02:00
Enrico Weigelt, metux IT consult 35ed325361 exa: drop ifdef on HAVE_DIX_CONFIG
We always have dix-config.h, so no need for extra guard.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:39 +02:00
Enrico Weigelt, metux IT consult 8d95320217 glamor: fix missing include of dix-config.h
This header needs to be included first, otherwise things can easily get really
messed up. The current code only works by accident, because some other header
already including it early enough - but a subtle change in include order
can easy break it.

Thus, always make sure the header is really included first.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:50:32 +02:00