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
1a5eb7752b
( !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>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
b155017c8e
( !1654 ) Xnest: replace XConnectionNumber() by xcb_get_file_descriptor()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
3fb0ad0c48
( !1654 ) Xnest: replace XReparentWindow() by xcb_reparent_window()
...
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
e0aa804354
( !1654 ) Xnest: replace XQueryBestSize() by xcb_query_best_size()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
b27fd4039e
( !1654 ) Xnest: replace X(Un)InstallColormap() by xcb_(un)install_colormap()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
8489fd6166
( !1654 ) Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps
...
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
194d3adf17
( !1654 ) Xnest: fetch visuals from XCB setup data instead of Xlib
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
b173b478c2
( !1654 ) Xnest: screen move assigment between depths and visual assignment to own function
...
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
1bcfc40a16
( !1654 ) Xnest: collect upstream window geometry in one xRectangle struct
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
af5dfed95e
( !1654 ) Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_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
f55a2ce5d4
( !1654 ) Xnest: replace XGetPointerMapping() by xcb_get_pointer_mapping()
...
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
a03e39525e
( !1654 ) Xnest: replace XGetModifierMapping() by xcb_get_modifier_mapping()
...
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
b95ed60be0
( !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>
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
19524534b5
( !1654 ) Xnest: replace XSelectInput() by xcb_change_window_attributes()
...
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
ae44aaa61d
( !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>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
d88ae96439
( !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>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
790c268dbb
( !1654 ) Xnest: Pixmap: replace XGetImage() by xcb_get_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
8ae264dc6b
( !1654 ) Xnest: GC: replace XGetImage() by xcb_get_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
64868aca8f
( !1654 ) Xnest: replace XDestroyWindow() by xnest_destroy_window()
...
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
f456d11fce
( !1654 ) Xnest: replace XDefineCursor() by xcb_change_window_attributes()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
851cfa3d80
( !1654 ) Xnest: replace xnestRecolorCursor() by xcb_recolor_cursor()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
1544199ab5
( !1654 ) Xnest: replace XFreeCursor() by xcb_free_cursor()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
8ac51df8b0
( !1654 ) Xnest: replace XStoreColors() by xcb_store_colors()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
1a7ea374b4
( !1654 ) Xnest: replace XQueryColors() by xcb_query_colors()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
159e4be499
( !1654 ) Xnest: replace XSetWindowColormap() by xcb_change_window_attributes()
...
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
e675544c2b
( !1654 ) 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>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
673822fc4a
( !1654 ) Xnest: GC: set stipple filling via xcb_change_gc
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
9dea9b4766
( !1654 ) Xnest: replace XSetClipMask() by xcb_change_gc()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
ba05e5cf08
( !1654 ) Xnest: replace XSetClipRectangles() by xnset_set_clip_rectangles()
...
Use XCB for setting clip rectangles.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
752753f32d
( !1654 ) Xnest: replace XSetDashes() by xnest_set_dashes()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
5d2964cade
( !1654 ) Xnest: replace XChangeGC() by xcb_change_gc()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
c4e45678f9
( !1654 ) Xnest: replace XChangeKeyboardControl() by xcb_change_keyboard_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
6aa4a648c9
( !1654 ) Xnest: replace XChangePointerControl() by xcb_change_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
5e2102c114
( !1654 ) Xnest: replace XChangeWindowAttributes() by xcb_aux_change_window_attributes()
...
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00
Enrico Weigelt, metux IT consult
37fef0283f
( !1654 ) Xnest: replace XDrawImageString() by xcb_image_text_8()
...
Replace XDrawImageString() by xcb_image_text_8(), as well as their 16-bit
counterparts.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:38 +02:00