Commit Graph

59 Commits

Author SHA1 Message Date
dasha_uwu cacdcc5b2e dix: export DeliverEvents for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 3db3ca9889 dix: export TryClientEvents for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
Enrico Weigelt, metux IT consult f98bee5e2e dix: add RootWindowFinalizeCallback() to symbol table for legacy Nvidia.
Nvidia has a strange habit of messing with really internal stuff,
so need to add it to the executable's symbol table.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 950cfb2bdc dix: helper for retrieving client owning a XID
Add a little helper that's looking up the ClientPtr to the client
of the owner of given XID. The lookup is solely done on the ID space,
the actual resource doesn't even need to exist.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult c4632a40dc dix: add callback for post root window init
Allow extensions to catch in right after a screen's root window has
been finally initialized

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 0b9a2fc6b0 dix: rename MarkClientException() to dixMarkClientException()
DIX functions should have proper naming.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult 62b86f2b13 dix: make LEGAL_NEW_RESOURCE() macro private
Not used by any external driver, so no need to keep it in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:43 +02:00
Enrico Weigelt, metux IT consult 0a315e45dd dix: replace CLIENT_ID() macro by dixClientIdForXID() inline function
Make it type-safe and a bit more obvious what it really does,
also adding some inline documentation. Since it's just some
bit shifting magic, it's qualified for inlining.

The CLIENT_ID() macro isn't used by any external modules, so the
new function doesn't need to be in a public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:53:27 +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 b0f94e1c5c dix: add CreateScreenResources callback mechanism
Right now, extensions that need to be called after the CreateScreenResources
proc had been run, must wrap the screen proc vector directly (all of them
forming kind of daisy chain), and so - when called - temporarily restore the
previous one, call it, wrap again, and if the call was successful finally
doing it's own stuff. (same is done for many other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

Instead introducing a simple approach for letting extension hook into a
post-CreateScreenResources callback list safely, w/o having to care much
about side effects with the call chain. Extensions now can simply register
their business logic and get called back - w/o ever having to mess with the
ScreenRec's internal structures.

Note that these hooks are executed *AFTER* the original CreateScreenResources()
proc had been called SUCCESSFULLY (returned TRUE), so callees can rely on
the DDX/driver had already done it's job.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:47 +02:00
Enrico Weigelt, metux IT consult befc3d22cf dix: add per-screen pixmap destructor mechanism
Right now, extension specific pixmap destruction procedures are implemented
by wrapping the ScreenRec's DestroyPixmap() proc pointer: the extensions are
storing the original pointer in their private data and putting in their own one.
On each call, their proc restores the original one, calls it, and switches back
again. When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

It's even getting worse: the proc also has to do ref counting, and only destroy
the pixmap if refconter reaching zero - that's all done in the individual screen
drivers. Therefore, all extensions must check for refcnt == 1, in order to know
when to really act.

This commit introduces a simple approach for letting extension hook into the
pixmap destruction safely, w/o having to care much about side effects with
the call chain. Extensions now can simply register their destructor proc
(and an opaque pointer) and get called back - w/o ever having to mess with
the ScreenRec's internal structures.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:46:30 +02:00
Enrico Weigelt, metux IT consult c5780c4c35 dix: add per-screen close notify hook
Right now, extension specific actions on screen closing implemented by wrapping
the ScreenRec's PositionWindow() proc pointer: the extensions are storing the
original pointer in their private data and putting in their own one. On each
call, their proc restores the original one, calls it, and switches back again.
When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

This commit introduces a simple approach for letting extension hook into the
screen closing path safely, w/o having to care much about side effects with
the call chain. Extensions now can simply register their hook proc (and an
opaque pointer) and get called back - w/o ever having to mess with the
ScreenRec's internal structures. These hooks are called before the original
vector (usually handled by DDX/screen driver directly) is called.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:41 +02:00
Enrico Weigelt, metux IT consult 479484b631 dix: add per-screen window position notify hook
Right now, extension specific actions on window positioning are implemented
by wrapping the ScreenRec's PositionWindow() proc pointer: the extensions are
storing the original pointer in their private data and putting in their own one.
On each call, their proc restores the original one, calls it, and switches back
again. When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

This commit introduces a simple approach for letting extension hook into the
window positioning path safely, w/o having to care much about side effects
with the call chain. Extensions now can simply register their hook proc
(and an opaque pointer) and get called back - w/o ever having to mess with
the ScreenRec's internal structures. These hooks are called before the original
vector (usually handled by DDX/screen driver directly) is called.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:44:33 +02:00
Enrico Weigelt, metux IT consult 3a0edc36b6 dix: add per-screen window destructor hook
Right now, extension specific window destruction procedures are implemented
by wrapping the ScreenRec's DestroyWindow() proc pointer: the extensions are
storing the original pointer in their private data and putting in their own one.
On each call, their proc restores the original one, calls it, and switches back
again. When multiple extensions doing so, they're forming a kind of daisy chain.
(the same is done for lots of other procs)

While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.

This commit introduces a simple approach for letting extension hook into the
window destruction safely, w/o having to care much about side effects with
the call chain. Extensions now can simply register their destructor proc
(and an opaque pointer) and get called back - w/o ever having to mess with
the ScreenRec's internal structures.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:59 +02:00
Enrico Weigelt, metux IT consult a110b3e02e dix: consolidate screen destruction in dixFreeScreen()
Consolidate duplicated screen destruction logic into new function
dixFreeScreen().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:43:54 +02:00
Enrico Weigelt, metux IT consult 9d78e139a0 dix: unexport SetInputCheck() and make it inline
Not used by any drivers, so no need to keep it exported.
It's also so simple (and rarely called) that easily can be inlined.

Also unexport HWEventQueueType and HWEventQueuePtr, since they're
not used by any drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:20:09 +02:00
Enrico Weigelt, metux IT consult 2f7ba4bf32 dix: unexport InitBlockAndWakeupHandlers()
Not supposed to be called by drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:49 +02:00
Enrico Weigelt, metux IT consult f069b91c8a dix: unexport WakeupHandler()
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:19:46 +02:00
Enrico Weigelt, metux IT consult 9f0d07a7d9 dix: unexport BlockHandler()
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:19:43 +02:00
Enrico Weigelt, metux IT consult 6fc8b593a4 dix: rename IsParent() to WindowIsParent()
Spending it a more fitting name.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:19:21 +02:00
Enrico Weigelt, metux IT consult abcd627d40 dix: unexport IsParent()
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:19:18 +02:00
Enrico Weigelt, metux IT consult b826800613 dix: unexport OtherClientGone()
Just an internal resource destructor, 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:19:07 +02:00
Enrico Weigelt, metux IT consult 0124a7c370 dix: unexport and document ScreenRestructured()
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:19:04 +02:00
Enrico Weigelt, metux IT consult 2b89942c7a dix: unexport and document WindowsRestructured()
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:19:00 +02:00
Enrico Weigelt, metux IT consult 17ef760571 dix: unexport and document WindowHasNewCursor()
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:18:57 +02:00
Enrico Weigelt, metux IT consult 95f802e3f6 dix: unexport RootWindowFinalizeCallback field
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:18:54 +02:00
Enrico Weigelt, metux IT consult 472e686496 dix: unexport DeliverEventsToWindow()
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:18:43 +02:00
Enrico Weigelt, metux IT consult 5d6d3b56ad dix: unexport DeliverEvents() and fix return type
* not needed by any drivers, so no need to keep it exported
* correct return type is `enum EventDeliveryState`

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:40 +02:00
Enrico Weigelt, metux IT consult a20e0304fe dix: unexport TryClientEvents()
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:18:37 +02:00
Enrico Weigelt, metux IT consult 9e93d51e41 dix: unexport and document AlterSaveSetForClient()
Not used by any external drivers, so no need to keep it exported.
Also using XRetCode and marking paremters where NULL isn't allowed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:17 +02:00
Enrico Weigelt, metux IT consult a58fd6f511 (!2007) dix: unexport SendGraphicsExpose() and fix parameter types
* not used by any drivers, so no need to keep it exported
* fix parameter types to matching the protocol types

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:08 +02:00
Enrico Weigelt, metux IT consult a94e906084 dix: unexport SendErrorToClient() and fix parameter types
* not used by any drivers, so no need to keep it exported
* fix parameter types to matching the protocol types

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:18:05 +02:00
Enrico Weigelt, metux IT consult 689de526a4 dix: unexport and document ClientIsAsleep()
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:18:01 +02:00
Enrico Weigelt, metux IT consult 2e0cde7b56 dix: unexport and document ClientWakeup()
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:17:58 +02:00
Enrico Weigelt, metux IT consult 646c76adea dix: unexport and document ClientSignalAll()
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:17:52 +02:00
Enrico Weigelt, metux IT consult b528301f97 dix: unexport and document ClientSignal()
Not used by any external drivers, so no need to keep it exported.

Also renamed to dixClientSignal(), since there's a conflicting prototype
in fontsproto.h.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:49 +02:00
Enrico Weigelt, metux IT consult 8104fc115d dix: unexport and document ClientSleep()
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:17:45 +02:00
Enrico Weigelt, metux IT consult 49107319f7 dix: unexport and document MarkClientException()
Not supposed to be used by external drivers, so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:42 +02:00
Enrico Weigelt, metux IT consult 5ae5fa9671 dix: unexport and document NextAvailableClient()
Only called from OS layer, thus should not be exported at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:39 +02:00
Enrico Weigelt, metux IT consult fe951f7dd4 dix: unexport and document EventSuppressForWindow()
Not used by any external drivers, and not supposed to be used by them,
so no need to keep it exported.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:32 +02:00
Enrico Weigelt, metux IT consult b15cde3a1c dix: unexport and document EventSelectForWindow()
Not used by any external drivers, and not supposed to be used by them,
so no need to keep it in public API.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:29 +02:00
Enrico Weigelt, metux IT consult 09f46c97b6 dix: MaybeDeliverEventToClient(): change return type to Bool
Callers are only interesed in whether event was actually sent
(retval==1) or not, so Bool is suffient and easier.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:22 +02:00
Enrico Weigelt, metux IT consult d74f591ce4 dix: MaybeDeliverEventToClient() drop count parameter
It's always called with just a single event, so no need for the count
parameter. Also renaming it in order to better fit it's new semantics.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:18 +02:00
Enrico Weigelt, metux IT consult 0b6715c6dc dix: unexport and document MaybeDeliverEventsToClient()
Not used by any external drivers, and only supposed to be DIX internal,
so shouldn't be exported at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:17:14 +02:00
Enrico Weigelt, metux IT consult 0f522fa893 dix: unexport and document SetCriticalEvent()
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:16:50 +02:00
Enrico Weigelt, metux IT consult 1fc9a26afd drop not needed includes of geext.h
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1810>
2025-02-24 20:19:55 +00:00
Enrico Weigelt, metux IT consult b3ec0bf58a dix: unexport MakePredeclaredAtoms()
Should never be called by modules/drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1802>
2025-02-17 18:13:33 +00:00
Enrico Weigelt, metux IT consult 06b599edb6 dix: unexport fields from opaque.h not used by modules/drivers
Lots of fields from opaque.h aren't used by any drivers/modules and thus
don't need to be exported at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1351>
2024-06-23 21:19:27 +00:00
Enrico Weigelt, metux IT consult 53e8ba3aff dix: move party_like_its_1989 into dix_priv.h
Internal symbol, no need to have it in public header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1351>
2024-06-23 21:19:27 +00:00
Enrico Weigelt, metux IT consult f17bc7e24d include: split out non-exported prototypes to dix_priv.h
Public server module API shouldn't be clobbered with private definitions,
thus move them out to dix-intern.h

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1289>
2024-04-30 00:47:38 +00:00