Commit Graph

19488 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult fdd85258ad Revert "DEBUG 13"
This reverts commit 3ea4291907ea00bf3cf2e73f2e3ab268a2e1c1b4.
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 68746123a5 DEBUG 13 2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult efa4633733 glamor: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 7d0c83c8ce exa: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult b7efaadba0 damage: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 2244e57dac Xext: xv: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 5cdcf18555 Xext: shm: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new pixmap destroy notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult fdd17e158e 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-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 4f96e73717 dri3: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 6dff41795b render: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult a66f25a240 xvmc: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 67f388835f xv: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult cc993c3133 xfixes: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 938e006c43 Xext: shm: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new screen close notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 8e43be7a3a 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-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 242d11e338 rootless: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 7e52c2a486 dbe: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 2da166e165 composite: use window position notify hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window position notify hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult cffe310ed6 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-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult af14ff6b62 xwayland: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult af3c898daa xfree86: dri: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:33 +02:00
Enrico Weigelt, metux IT consult 93fadb1d7a xfree86: xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult 6c97fda209 kdrive: xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult b59a5e85c4 rootless: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

2do: should check whether it's better to directly assign the screen procs,
w/o any wrapping at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult aecb404ffc composite: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult 3319de0d2b xv: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult fa21d6fd0b damage: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult 9577590f98 render: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult afa1352985 present: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult 2494b55db2 dbe: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so
use the new window destructor hook instead.
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult 98fad8b1f1 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-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult 09f25e0e9e dix: make DeleteCallbackList() non-static and document it
Allow using it by other places outside this file, so we can also support
callback lists in dynamically allocated structures:

Those cases need to explicitly call DeleteCallbackList() before free()ing
the structures - otherwise we're getting heap corruptions, because the
actual deletion can happen asynchronously.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:32 +02:00
Enrico Weigelt, metux IT consult 4cc92e13b5 (!1705) xwin: drop wrapping on ScreenRec->ModifyPixmapHeader()
Instead of complicated wrapping, just call fbModifyPixmapHeader() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult e4559f5737 (!1705) xwin: drop winResizeWindowMultiWindow()
This wrapping function for Screen->ResizeWindow() is does nothing more than
just call the original functions. So no need to keep wrapping it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 491093bb61 (!1705) xwin: drop wrapping on ScreenRec->MoveWindow()
Instead of complicated wrapping, just call fbMoveWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 7ca497cc96 (!1705) xwin: drop wrapping on ScreenRec->RestackWindow()
This proc vector is optional (callers check for non-null) and neither fb nor
mi set it, so we can just assign our function directly. No need for wrapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 3d99c87d39 (!1705) xwin: drop wrapping on ScreenRec->ReparentWindow()
This proc vector is optional (callers check for non-null) and neither fb nor
mi set it, so we can just assign our function directly. No need for wrapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 7eee4fbc76 (!1705) xwin: drop wrapping on ScreenRec->UnrealizeWindow()
Instead of complicated wrapping, just call fbUnrealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult e8b370c9a9 (!1705) xwin: drop wrapping on ScreenRec->RealizeWindow()
Instead of complicated wrapping, just call fbRealizeWindow() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 903f873084 (!1705) xwin: drop wrapping on ScreenRec->SetShape()
Instead of complicated wrapping, just call fbSetShape() directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 03e2f11217 (!1705) xwin: drop winCopyWindowMultiWindow()
This wrapping function for Screen->CopyWindow() is does nothing more than
just call the original functions. So no need to keep wrapping it at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 69f3f94e21 (!1705) xwin: call winFinishScreenInitFB() directly
Both engines, GDI as well as DirectDraw, using the same screen init finish function,
so no need to keep indirection via per-engine callback pointer.

The winFinishScreenInitFB() can also be made static now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 5a2b94e024 (!1705) xwin: glx: drop glxWinUnrealizeWindow()
It does nothing more than just calling the original/wrapped function,
so we don't need that at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult ec87d336c3 (!1705) xwin: glx: drop glxWinRealizeWindow()
It does nothing more than just calling the original/wrapped function,
so we don't need that at all.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 9af0a3ec51 (!1705) xwin: drop wrapping on ScreenRec->ChangeWindowAttributes()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult b336fe7140 (!1705) xwin: drop wrapping on ScreenRec->CreateWindow()
Instead of complicated wrapping, just call fbCreateWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 1d96b6838f (!1705) xwin: drop wrapping on ScreenRec->PositionWindow()
Instead of complicated wrapping, just call fbPositionWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 23b24ddd27 (!1705) xwin: drop wrapping on ScreenRec->DestroyWindow()
Instead of complicated wrapping, just call fbDestroyWindow directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 1d2c4f40ea (!1905) 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-04-25 15:43:26 +02:00
Enrico Weigelt, metux IT consult 7a33d3da96 (!1905) dix: replace FreeDefaultStipple()
It's just a one-liner only called once, so no actual need for it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-04-25 15:43:26 +02:00