Commit Graph

356 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 41f4b5188e WIP: use pixmap lifecycle api 2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult 68518bb169 xnest: add pixmap depths to global depth list
Right now, we're only registering the depths of our visuals, which are
mirroring upstream's visuals. But forgotten to register the pixmap depths
that don't have an assiocated visual.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:54 +01:00
Enrico Weigelt, metux IT consult 310382b7b4 (!1688) os: log: add syslog support
Add support for logging to syslog.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:30:21 +01:00
Enrico Weigelt, metux IT consult cb6173b2a7 (submit/unexport-ddx-callbacks) os: rename ddx.h to ddx_priv.h
Make it clear that stuff from this file really isn't supposed to be used
by dynamically loaded modules like drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 1abe6d2c9b (submit/unexport-ddx-callbacks) os: unexport ddx callbacks
The DDX callbacks (where core/DIX calls into DDX) aren't supposed to be
called by drivers directly, so unexport them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:51 +01:00
Enrico Weigelt, metux IT consult 42a9ff83ff (submit/miext-extinit) miext: move over extinit_priv.h from include
Since most of the extension init logic (and on/off switches for them)
is driven from miext, this seems the appropriate place for the header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:28:50 +01:00
Enrico Weigelt, metux IT consult 96668e2327 (submit/miext-extinit) glx: unexport noGlxExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult ff51adee62 (submit/miext-extinit) dpms: unexport noDPMSExtension field
This field isn't used by any drivers, and also better belongs into
the corresponding extension instead of OS adaption layer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:56 +01:00
Enrico Weigelt, metux IT consult afbbff1a27 (submit/xnest-config.h) Xnest: drop obsolete xnest-config.h
This file became pretty no-op, just including dix-config.h.
So we can remove it now and include dix-config.h directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult b2faddac65 (submit/xnest-config.h) Xnest: no need to include xkb-config.h
Xnest doesn't need anything from xkb-config.h, so no need to include it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult ee8464e398 (submit/xnest-config.h) Xnest: simplify disabling unsupported extension
Instead of strange #undef hacks in various places, just go the straight
route and set the corresponding no*Extension flags on server startup.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:55 +01:00
Enrico Weigelt, metux IT consult e27eb8826b (!1654) Xnest: use xcb_window_t instead of Window
Since we're now using xcb for upstream X11 connection, it's cleaner to
use it's type for the window IDs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult cec5b8e984 (!1654) Xnest: dont link Xlib anymore
Now that we completely ported from Xlib to XCB, we can finally stop
importing Xlib :)

FIN.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:54 +01:00
Enrico Weigelt, metux IT consult 8550911777 (!1654) Xnest: use XCB for upstream connection
Now that no Xlib operations (besides opening and closing connection)
aren't used anymore, we can move over the last pieces and use XCB
instead of Xlib for connecting the upstream Xserver.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult bd24052c4b (!1654) Xnest: use XCB for event loop
Now that no X11 calls are being done via Xlib anymore, we're free to
also move over event receiving, leaving Xlib pretty much unused.

Also need to add a simple event queue mechanism, because we've go a
screen operation (see xnestBitBlitHelper) that needs to collect up
certain events for it's return value.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a58732874e (!1654) Xnest: drop xnestWindowExposures micro-optimization
xnestWindowExposures() is a micro-optimization for the specific case that
a newly created window receives exposure events (from our upstream server)
inside the region we're already exposing on our own (miWindowExposures()):
it peeks the Xlib event queue for all expose events, checks whether their
areas are inside our exposure region and requeue's those that aren't.

Unfortunately, this depends on Xlib's internal queue mechamism, thus standing
in the way of moving to XCB (which doesn't have that).

Removing this doens't seem to make any practical difference, even with
demanding applications like GIMP. The only cost is potentially having some
initial window content painted twice, *if* the application really draws
something complicated right after creating the window.

*If* there'll really be a demand for such an optimization some day, it can
be reimplemented without any message queue: just redirecting all expose events
into recording them in a region, which is flushed out later. But for now,
there really doesn't seem to be any practical need for that.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a6731426f1 (!1654) Xnest: replace XConnectionNumber() by xcb_get_file_descriptor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult ee85cdf541 (!1654) Xnest: replace XReparentWindow() by xcb_reparent_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult f7d5d8e7e8 (!1654) Xnest: drop using XLoadQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 8239af59e6 (!1654) Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 6be00ab072 (!1654) Xnest: load fonts via xcb
FIXME: support xf86bigfont extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult fcd79d90ee (!1654) Xnest: replace XQueryBestSize() by xcb_query_best_size()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 71b34fef4d (!1654) Xnest: replace X(Un)InstallColormap() by xcb_(un)install_colormap()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 852493ddeb (!1654) Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult f75166bd64 (!1654) Xnest: use new lookup table for visuals and cmaps mappings
Use the visuals lookup table introduced by previous commit for
looking up local vs upstream visuals and their colormaps.
Replacing the the old Xlib visuals table.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult d6298df576 (!1654) Xnest: screen: record visuals and cmaps in separate table
Record the associations between host's and our visuals as well their
corresponding cmaps in a global table, which's used later for lookups.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 47e352dbe8 (!1654) Xnest: fetch visuals from XCB setup data instead of Xlib
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a38fc83799 (!1654) Xnest: screen move assigment between depths and visual assignment to own function
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 25e854979c (!1654) Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 5bd0415613 (!1654) Xnest: replace XGetWindowAttributes() by xcb_get_geometry()
Use xcb function instead of Xlib, and also spare one additional
(unused) request.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 0775a1dcb2 (!1654) Xnest: collect upstream window geometry in one xRectangle struct
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 2c283076f2 (!1654) Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 240d827a6e (!1654) Xnest: replace XGetPointerMapping() by xcb_get_pointer_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult ce7e99afb5 (!1654) Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 08dcfe0270 (!1654) Xnest: replace XGetModifierMapping() by xcb_get_modifier_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult e83a87abc1 (!1654) Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult a1bc0c7bf9 (!1654) Xnest: add own copy of fixed xcb_xkb_get_kbd_by_name()
This is a temporary measure, until xcbproto / libxcb is fixed:
keep an own copy of the fixed xcb_xkb_get_kbd_by_name(), renamed
as xcb_xkb_get_kbd_by_name_1().

Once xcbproto/libxcb is fixed (and new xcb release is out), this
commit can be reverted.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult bd232f422d (!1654) Xnest: use xcb for retrieving keymap controls
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 27ff310dca (!1654) Xnest: replace XSelectInput() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult df5c389d51 (!1654) Xnest: replace XSetStandardProperties() by xcb functions
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 9996aa209b (!1654) Xnest: fetch supported pixmap formats from xcb setup data
There's even no need to keep our own copies, since we can ask XCB's
copy any time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult faa298057b (!1654) Xnest: fetch allowed screen depths from xcb screen info
There's even no need to keep our own copies, since we can ask XCB's
copy any time.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 4ff6ba467d (!1654) Xnest: Pixmap: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 3d3f1f379c (!1654) Xnest: GC: replace XGetImage() by xcb_get_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 8eebda19b7 (!1654) Xnest: replace XDestroyWindow() by xnest_destroy_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult df1d34d842 (!1654) Xnest: replace XCreatePixmapFromBitmapData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 3866d8ab1a (!1654) Xnest: replace XCreateBitmapFromData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 058009071d (!1654) Xnest: replace XDefineCursor() by xcb_change_window_attributes()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 3494f77e88 (!1654) Xnest: replace xnestRecolorCursor() by xcb_recolor_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00
Enrico Weigelt, metux IT consult 71bfa9921c (!1654) Xnest: replace XFreeCursor() by xcb_free_cursor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-10-31 19:23:53 +01:00