Commit Graph

20 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult e1ab85e768 Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:39:18 +02:00
Enrico Weigelt, metux IT consult 143c1e0648 Xnest: use new lookup table for visuals and cmaps mappings
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:39:18 +02:00
Enrico Weigelt, metux IT consult 0913ee24d0 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-08-26 14:39:18 +02:00
Enrico Weigelt, metux IT consult 0042894dfb Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:39:18 +02:00
Enrico Weigelt, metux IT consult 7603a5d6c1 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-08-26 14:39:18 +02:00
Enrico Weigelt, metux IT consult cfcea4ef79 Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:39:18 +02:00
Enrico Weigelt, metux IT consult 90b30fef64 Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:39:17 +02:00
Enrico Weigelt, metux IT consult a1d0ad2155 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-08-26 14:39:13 +02:00
Enrico Weigelt, metux IT consult ebe499b2c4 Xnest: use xcb for retrieving keymap controls
This needs fix in xcbproto:

https://gitlab.freedesktop.org/xorg/proto/xcbproto/-/merge_requests/49

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult 801716a695 Xnest: replace XSetStandardProperties() by xcb functions
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult 2cd8b6c285 Xnest: replace XCreatePixmapFromBitmapData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult 4a7a6cfb8d Xnest: replace XCreateBitmapFromData() by xcb_put_image()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult cde9d848d6 Xnest: replace XSetWMColormapWindows() by xcb_icccm_set_wm_colormap_windows_checked()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult 3aa6daef7e Xnest: use XIDs directly, instead of Xlib's GC
Now that no Xlib drawing functions used anymore, we can finally switch over
to using GC XID's directly, instead of Xlib's GC struct.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult 8a068eb15a Xnest: replace XChangeGC() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult db2743387b Xnest: replace XChangeKeyboardControl() by xcb_change_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult 9cf63422e2 xnest: replace XConfigureWindow() calls by xcb_configure_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult d7e5f08aa8 Xnest: converter from XSetWindowAttributes struct to uint32_t list
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult 8281c536c1 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>
2024-08-26 14:21:54 +02:00
Enrico Weigelt, metux IT consult 9dd8e84b8a 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>
2024-08-26 14:21:54 +02:00