The phase-β sed pass renamed every C 'Window' identifier to
WNativeWindow. That correctly updated typedef uses but also rewrote
the string 'Window Maker', UI labels like 'Window Manager', 'Window
Placement', 'Window Title', 'Window List', 'Window System session',
etc., plus a number of comments referring to 'Window' as English.
Fixed all of those. The C type uses (WNativeWindow rootWin, etc.)
remain unchanged — only English-language occurrences are reverted.
Verified that wmaker now reports 'Window Maker 0.96.0' again and
build is clean across WINGs/, src/, WPrefs.app/.
Sed pass restricted to files outside src/backend/x11 and outside
*_x11.c — i.e. all code that should not depend on X11 typedefs.
Window → WNativeWindow (existing typedef in WMEvent.h)
Atom → WMNativeAtom
Pixmap → WMNativePixmap
Cursor → WMNativeCursor
Drawable → WMDrawable (existing typedef)
KeySym → WMNativeKeysym
Colormap → WMNativeColormap
X11 backend files keep using the original Xlib type names because
they make Xlib API calls that take those types. All typedefs are
ultimately 'unsigned long' so values pass through opaquely between
shared code and the backend.
Public WINGs API affected: WMSelectionCallback, WMSelectionProcs,
and a handful of widget signatures that took Atom/Window arguments
now take WMNativeAtom/WNativeWindow. Source-compatible at the
binary level; consumers must rebuild.
Time and XID typedefs left for a follow-up — both are heavily used
in field/variable names that need careful auditing. Display* and
GC stay in W_Screen for now; phase δ moves them into an X11-only
sub-struct.
Both files implement X11-specific protocols (EWMH _NET_* and XDND).
They were sitting in shared src/ because they predated the backend
split; the only remaining users in shared code were now via
wm_backend-> dispatch.
To get there, four new vtable slots replace the last direct calls
from shared src/:
screen_get_head_usable_area (screen.c was calling wNETWMGetUsableArea)
window_get_icon_image (icon.c was calling get_window_image_from_x11)
netwm_set_frame_extents (window.c, winspector.c were calling wNETFrameExtents)
(window_fetch_name and window_get_icon_name extended to consult EWMH first)
Other changes:
* get_window_image_from_x11 now takes Display* explicitly so the
Wayland backend can pass wl_state.x_display for XWayland clients
instead of relying on a global (which is NULL on Wayland).
* Eight shared .c files lose their now-unused #include "wmspec.h"
or #include "xdnd.h".
* Makefile.am moves wmspec.{c,h} and xdnd.{c,h} into the backend/x11
listing.
* src/Makefile.am drops the obsolete --disable-xdnd Makefile branch
and unconditional sources list still references the new paths.
Final state: every Xlib call in the codebase lives in src/backend/x11/
or src/backend/wayland/. The only remaining "X*(" matches outside
backend/ are six XSetForeground/XDrawLine calls in src/moveres.c
inside an \#if 0 block (dead code; left for now). src/ has zero
_x11_raw references.
Remove every is_wayland / !is_wayland guard from WM policy files.
All backend-specific logic now lives exclusively in the backends:
- main.c: display_post_open vtable slot handles fatal check, visual ID,
display name, and multiHead parsing (X11) or no-ops (Wayland)
- event.c: EventLoop() unconditionally calls event_loop_run(); the X11
backend's implementation contains the WMNextEvent+inotify loop
- screen.c: screen_init_display vtable slot handles RContext/WMScreen/
color creation (each backend owns its full init path)
- monitor.c: show_crash_dialog vtable slot (X11 shows panel, Wayland
returns abort)
- startup.c: InitializeSwitchMenu called unconditionally (it's
backend-agnostic); defaults polling timer no longer guarded
- shutdown.c: wScreenSaveState called unconditionally
- window.c: client_reparent called unconditionally (Wayland no-ops);
dead frameless-window code removed
Policy code is now completely backend-agnostic. The only references to
is_wayland are the vtable field definitions in the two backend files.
Add display_default_screen, atom_intern, and event_loop_run vtable slots.
Guard all X11-only paths in startup.c/screen.c/shutdown.c/event.c/xdnd.c
with if (!dpy) so the Wayland path reaches wl_display_run() and exits
cleanly (exit 0) on SIGTERM. wl-smoke-test.sh now PASSES.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>