390 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
43c5b45f4a mingw32: fix winsock2.h include
winsock2.h needs to be included before windows.h

> /usr/share/mingw-w64/include/winsock2.h:15:2: error: #warning Please include winsock2.h before windows.h [-Werror=cpp]
>    15 | #warning Please include winsock2.h before windows.h
>       |  ^~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-12 19:41:55 +01:00
Enrico Weigelt, metux IT consult
3c2bf225ca xnest: silence type mismatch warning on ming32
KeySym and xcb_keysym_t should both be 32bit, but for the compiler
they're long vs int, so it's spitting out a warning here. That's
coming from xorgproto's weird way of defining those types.

Add static type size assert and hard typecast to silence it.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-12 19:41:55 +01:00
Enrico Weigelt, metux IT consult
33729b1361 include: windowstr.h: unexport w*() macros
These aren't used by any drivers, so no need to keep them public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 19:54:42 +01:00
Enrico Weigelt, metux IT consult
9b8d7d1eb9 treewide: don't include <region.h> anymore
Nothing in there that we need, include <regionstr.h> instead.
But keeping the file in place, until all external consumer have
been migrated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 19:27:27 +01:00
Enrico Weigelt, metux IT consult
416f69eb88 include: misc.h: unexport lowbit() macro
Not used by any drivers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-20 19:20:07 +01:00
Chase
ba33b36f7a xnest icons: const correctness 2025-11-17 12:53:09 +01:00
Enrico Weigelt, metux IT consult
56c4d68140 treewide: drop ScreenInfoPtr parameter from InitOutput()
Nobody's using this pointer anymore, everybody's using the global
screenInfo structure.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 19:49:23 +02:00
Enrico Weigelt, metux IT consult
2404643489 xnest: use screenInfo insead of pointer passed to InitOutput()
We only have one global screenInfo struct ever, and many other parts of the
Xserver can only operate on global screenInfo, so it's time to phase out
this extra pointer. Once the same has done on the other DDXes, it will
be dropped from InitOutput()'s parameter list.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-11 11:23:48 +02:00
Enrico Weigelt, metux IT consult
48cb1118ee treewide: drop unnecessary pixmap field initialization
The PixmapRec is already calloc()'ed, so no need for additional zero-writes
into individual fields. This also removes some unncessary #ifdefs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-01 13:31:52 +02:00
Enrico Weigelt, metux IT consult
5bde454490 xnest: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
bbabd96e6c meson: rename symbol MITSHM to CONFIG_MITSHM
some bit better naming for config symbols.
Yet leaving the old one defined, until all drivers have kept up.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-05 11:39:28 +02:00
Enrico Weigelt, metux IT consult
967ae609b6 dix: drop DDXBEFORERESET symbol
Reduce complexity for things that really don't matter much:

The ddxBeforeReset() function is called when the Xserver going to reset
(new server generation). Right now, the only DDX really needing that is
Xwin, on all the others it's just no-op.

We've got an extra complicated build logic, which ifdef's out this all when
Xwin isn't built at all. The saving is extremely minimal - just skipping
few stub functions, which in most sessions aren't even called.

Therefore, get rid of this extra complexity that isn't giving us any
notable gain.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-04 11:41:48 +02:00
Collin
8ba351aa96 screen: initialize rootDepth to zero to fix uninitialized-variable warning 2025-07-23 16:09:52 +02:00
Enrico Weigelt, metux IT consult
9217a30960 xnest: use dixAddAtom()
Use the new helper for creating atoms on demand.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-23 12:24:27 +02:00
Enrico Weigelt, metux IT consult
030745a0e7 dix: move inpututils.h and rename it to inpututil_privs.h
it's a private header, thus should not be in public include directory.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-18 04:51:30 +02:00
Enrico Weigelt, metux IT consult
c6777fe48e xnest: drop unused DarwinHandleGUI()
Obsolete since 17 years now, probably just forgotten to clean up.

Fixes: ef1c52053755fa14b4ca98b22c506f73f5f4a4b7
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-07-04 17:10:02 +02:00
Enrico Weigelt, metux IT consult
6a3162d623 Xnest: fix analyzer warning on uninitialized DefaultVisual
In xnestOpenScreen(), some compilers/analyzers spitting out a false alarm on
`defaultVisual` field potentially used uninitialized. This can't practically
happen, but not all compilers/analyzers really can see that.

Adding a zero initializer doesn't cost us anything, so silencing that false
alarm is trivial.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 20:30:46 +02:00
rendick
cd2e185838 Xnest: implement a defined initialization order in BoxRec
Signed-off-by: rendick <rendick123@proton.me>
2025-06-13 19:15:41 +02:00
dec05eba
8c3c20f3fe xnest/os: Fix incorrect power of two operator
2^16 is 2 xor 16 which equals 18, not 2 to the power of 16 which is 65536

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-13 13:27:25 +02:00
Enrico Weigelt, metux IT consult
e6467895f9 dix: add dixAllocServerXID()
Adding a separate function for allocating server-client's XIDs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:48 +02:00
Enrico Weigelt, metux IT consult
c90974c00d 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>
2025-06-12 17:21:47 +02:00
Enrico Weigelt, metux IT consult
625c657a4c os: log: add syslog support
Add support for logging to syslog.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult
3c028a8cc0 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>
2025-06-12 17:21:46 +02:00
Enrico Weigelt, metux IT consult
e439636c39 Xnest: dont use VLA
Replace VLA usage by calloc()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
5038b4e413 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>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
5913906151 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>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
9969258e44 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-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
4716ee9981 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-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
8c701832ea 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-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
1f4cbdb448 Xnest: replace XConnectionNumber() by xcb_get_file_descriptor()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
988cc9e496 Xnest: replace XReparentWindow() by xcb_reparent_window()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
5f5e6f110a Xnest: drop using XLoadQueryFont()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
84be220cd4 Xnest: replace XTextWidth[16]() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
43b225c28c Xnest: load fonts via xcb
FIXME: support xf86bigfont extension
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
2ed4c16b36 Xnest: replace XQueryBestSize() by xcb_query_best_size()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
115a7ceb23 Xnest: replace X(Un)InstallColormap() by xcb_(un)install_colormap()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
ae22721ae7 Xnest: drop obsolete XGetVisualInfo() call and reundant colormaps
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
2956ea0f7d 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-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
6977718454 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-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
822b82d831 Xnest: fetch visuals from XCB setup data instead of Xlib
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
6b5a8e001c 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-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
c44225d17d Xnest: replace XParseGeometry() by own implementation
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
de13460b05 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-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
146538a475 Xnest: collect upstream window geometry in one xRectangle struct
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
4a014637a4 Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
3157b2e1dc Xnest: replace XGetPointerMapping() by xcb_get_pointer_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
949bdc209c Xnest: replace XGetPointerControl() by xcb_get_pointer_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
b708a86d46 Xnest: replace XGetModifierMapping() by xcb_get_modifier_mapping()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
2b3a1c27c9 Xnest: fetch keyboard mapping via xcb
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 17:21:45 +02:00
Enrico Weigelt, metux IT consult
170124c148 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-12 17:21:45 +02:00