Commit Graph

18 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 23c2ebff6f (!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>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult c5d5d63e3b (!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>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult 3a3e41678c (!1654) Xnest: drop using XLoadQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult 2dd391f527 (!1654) Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult cd5a580c56 (!1654) Xnest: load fonts via xcb
FIXME: support xf86bigfont extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult a303769a49 (!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>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult 1879b61643 (!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>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult e4ee9a2a9e (!1654) Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult e29fe1a86a (!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>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult a4c7daf61b (!1654) Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult ea0605d28e (!1654) Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult 8d367e1f48 (!1654) Xnest: use xcb for retrieving keymap controls
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult d55900ade6 (!1654) Xnest: replace XSetStandardProperties() by xcb functions
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult 30d0b16c87 (!1654) Xnest: replace XCreatePixmapFromBitmapData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult 30e163a92a (!1654) Xnest: replace XCreateBitmapFromData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult eb780f9103 (!1654) Xnest: replace XSetWMColormapWindows() by xcb_icccm_set_wm_colormap_windows_checked()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult 0adf2195a2 (!1654) Xnest: add helper for retrieving GC XID on upstream connection
Upcoming patches will need to retieve GC's XIDs on the upstream connection.
Moving this out into separate .c file, in order to not creating more
dependencies on Xlib headers, which we wanna get rid of.

For now, looking at the Xlib GC structure, attached to our DDX GCs.
When all users of the Xlib GC have gone (ie. moved all consumers to xcb),
we'll create the GC via xcb directly, thus replacing the Xlib GC struct
by XID - the interface of this helper will remain the same.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult 1c3b7afc6b (!1654) Xnest: fetch xcb setup data
Fetching the setup data from xcb instead of Xlib, storing in our own struct,
holding all information needed for one particular upstream connection.
For now, there's only one, but future multi-upstream implementation will
change this to an array (and storing pointers to particular upstream in
various places).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00