Commit Graph

368 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 104478000f 1 2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult ec50b25d0b 1 2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult c56c11574d hack1 2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult e7b358e174 1 2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 3802b10cdb Xnest: move xnestEventmask into struct xnest_upstream_info
This is per upstream connection state, so it's better of in the
upstream information struct.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult b02a5ebc5e Xnest: make GC funcs static
These aren't used anywhere else, outside GC.c, just referenced in the func
vector struct, so no need to have them publicly visible.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 889a25e4cc Xnest: explicit GC operation struct initialization
Just doing array-like listing of the init values is error-prone:
somebody might change the order in the struct and things will going wild.

Better be explicit about which fields are assigned to which values.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 1dbffd9368 Xnest: move xnestBitmapGC into struct xnest_upstream_info
This is per upstream connection state, so it's better of in the
upstream information struct.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 3a317cdd8b hack 2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 6c9ef7905a WIP: rootless mode
2do: input not working yet
     properties (eg. window name aren't set)
     connection closes when window closed
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 00da0f625f Xnest: write through window properties to upstream server
Write through the window properties set by Xnest's client to the
upstream windows.

This is important for rootless mode.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 731e84e592 Xnest: helper for writing property by atom and type name
Add a little helper for writing properties, using atom and type as string
instead of XIDs. The upstream's atom XIDs are looked up automatically.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 3a53bebd2f Xnest: helper for intern'ing atoms
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 81b041cae3 Xnest: move per-screen screensaver window to xnest_screen_info struct 2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 56c646cb63 Xnest: xnestWindowParent macro by xnest_upstream_window_parent()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult 6f20cee79c Xnest: move per-screen upstream frame window into separate screen private struct
Start collecting the per-screen data into an own struct. Leaving this struct
in a global array (just like the individual fields) right now, because several
places still need to iterate over it. In later steps might move into a per
screen's devPrivate.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:18:45 +02:00
Enrico Weigelt, metux IT consult a1616d7b25 (!1688) os: log: add syslog support
Add support for logging to syslog.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 19:14:55 +02:00
Enrico Weigelt, metux IT consult 7a292adac0 (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-09-13 19:14:18 +02:00
Enrico Weigelt, metux IT consult e9da6db826 (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-09-13 19:14:18 +02:00
Enrico Weigelt, metux IT consult 566344b025 (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-09-13 13:36:29 +02:00
Enrico Weigelt, metux IT consult b5d8ba2750 (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-09-13 13:36:28 +02:00
Enrico Weigelt, metux IT consult d1c014a032 (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-09-13 13:36:28 +02:00
Enrico Weigelt, metux IT consult 6edc2d96fc (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-09-13 13:36:28 +02:00
Enrico Weigelt, metux IT consult b4423b5ecc (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-09-13 13:36:28 +02:00
Enrico Weigelt, metux IT consult 1f9c6a013a (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-09-13 13:36:28 +02:00
Enrico Weigelt, metux IT consult f2df5822b6 (!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-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 378009cd06 (!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-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 49f1fb8831 (!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-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult d557777117 (!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-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 25285a2b46 (!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-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 14a4ef45ba (!1654) Xnest: replace XConnectionNumber() by xcb_get_file_descriptor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult b1a5198666 (!1654) Xnest: replace XReparentWindow() by xcb_reparent_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 4efc1dca79 (!1654) Xnest: drop using XLoadQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 9488bb3079 (!1654) Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 10340ed5c8 (!1654) Xnest: load fonts via xcb
FIXME: support xf86bigfont extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 8297df575c (!1654) Xnest: replace XQueryBestSize() by xcb_query_best_size()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 5d4215b346 (!1654) Xnest: replace X(Un)InstallColormap() by xcb_(un)install_colormap()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 0cc03c0e12 (!1654) Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult def55f6037 (!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-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 53022239a4 (!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-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 1a2b44f1f9 (!1654) Xnest: fetch visuals from XCB setup data instead of Xlib
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 5878abf9e6 (!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-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 954b262407 (!1654) Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 83a2c7d559 (!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-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 351d8d898e (!1654) Xnest: collect upstream window geometry in one xRectangle struct
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 820324d5dd (!1654) Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult ce3b17c7eb (!1654) Xnest: replace XGetPointerMapping() by xcb_get_pointer_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 61fc7d42dd (!1654) Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult c4c669822a (!1654) Xnest: replace XGetModifierMapping() by xcb_get_modifier_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00
Enrico Weigelt, metux IT consult 0144bdc76d (!1654) Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-09-13 13:36:27 +02:00