windowmaker-wl/src
Window Maker 23f0bb320e wm core: shared src/ is now X11-free at the source level
Audit: every "X11 in src/" hit outside src/backend/x11/ and
src/backend/wayland/ is now either:
  - a comment mentioning X11 by name, or
  - a backend-neutral macro/type alias (WM_STATE_*, CW*, P*, etc.)
    whose numeric value happens to match the X11 protocol value.

Zero <X11/...> includes in shared headers/sources.
Zero X11 type uses (XColor/XContext/XEvent/XFontStruct/XGCValues/
XWindowAttributes/XSetWindowAttributes/XErrorEvent etc.).
Zero X11 symbol references in compiled shared object files
(verified: `nm src/*.o | awk '$1=="U"' | grep '^X[A-Z][a-z]'`
returns empty).

Real architectural fixes:

src/backend/backend_types.h — added the missing backend-neutral
constants/types so shared code never names an X11 macro:
  - WM_STATE_WITHDRAWN/NORMAL/ICONIC (ICCCM values 0/1/3).
  - WContextID (typedef int) — XContext analogue.
  - WMColorRGB (XColor-layout-compatible struct).
  - CWX..CWStackMode (ConfigureWindow value-mask bits).
  - ForgetGravity..StaticGravity (ICCCM win_gravity values).
  - PMinSize..PWinGravity (XSizeHints flags) as WNH_* aliases.
  - NoSymbol, NoEventMask, ColormapInstalled/Uninstalled.
  - BitmapSuccess..BitmapNoMemory.
All guarded by #ifndef so the X11 backend's <X11/X.h> include
overrides them with the real X11 values when present.

src/screen.h — w_visual is now `void *` (was `Visual *`).  Added
w_visual_id / w_visual_class so dialog.c's crash panel can read
visual info without dereferencing a Visual struct.  tech_draw_font
is also `void *` with companion tech_draw_font_ascent/descent ints
populated by the backend (X11 from XFontStruct->ascent, Wayland
from a hard-coded bitmap-font metric).

src/WindowMaker.h — XContext fields → WContextID, X11 includes
removed, Time → WMNativeTime.

src/dialog.c — wShowCrashingDialogPanel now uses WMOpenScreen +
WMScreenWidth/Height instead of DefaultScreen()/ScreenOfDisplay()/
WidthOfScreen() so it works in either backend.

Dead-code cleanup found while auditing:

src/event.c — handleUnmapNotify and handleEnterNotify both built
an uninitialized `XEvent ev` and ran it through x11_translate_event
on a peeked queue event.  The translation always read stack garbage
(the local was never populated).  Replaced with the correct flow:
  - unmap handler: skip wUnmanageWindow if a Destroy is already
    queued, the Destroy handler will run it next iteration.
  - enter handler: skip if a Leave for the same window is queued,
    no need to inspect mode/detail (was always reading garbage).
Also dropped the now-unused x11_compat.h / x11_event.h includes
from event.c, dock.c, window.c.

src/misc.c — eatExpose's `XEvent event, foo` were never used; the
function delegates to wm_backend->event_flush_type(WME_EXPOSE).

src/wsmap.c — workspace_map_destroy built an XEvent ClientMessage
but never sent it; the actual notify path is switchpanel_send_enter.
Pass the real root_win argument (was passing literal 0) and drop
the dead XEvent.

src/icon.c — set_dockapp_in_icon's `XWindowAttributes attr` and
cycleColor's `XGCValues gcv` were unused.

src/window.c — windowLanguageClick had a function-signature
mismatch with framewin.h's on_click_language (XEvent* vs WMEvent*).
The framewin code passes a WMEvent.  Fixed the parameter type and
its single use of event->xbutton.button.

src/moveres.c — already-disabled `#if 0` block in showPosition
that called XDrawLine / XSetForeground on the root window: removed.
Replaced tech_draw_font->ascent/descent dereferences with the new
flat int fields.

src/xutil.h — removed declarations of FormatXError (moved to X11
backend long ago) and Request/GetSelection (never implemented).

Mass renames in shared src/:
  IconicState/NormalState/WithdrawnState → WM_STATE_ICONIC/NORMAL/
                                            WITHDRAWN
  IconWindowHint/InputHint/StateHint/IconPixmapHint/IconMaskHint/
  IconPositionHint/WindowGroupHint/UrgencyHint
                                          → WMH_*_HINT
  XColor (in struct fields and locals)    → WMColorRGB
  XContext (in screen.context.{...})      → WContextID
  XPoint                                  → WMShortPoint
  XRectangle                              → WMShortRect
  XFontStruct *                           → void *

Backends translate at the boundary:
  src/backend/x11/x11_backend.c keeps its native XColor/XContext/
  XFontStruct internally and casts to the backend-neutral types
  at the public-API surface (memcpy works because WMColorRGB has
  XColor's exact layout).
  src/backend/wayland/wl_backend.c populates the same fields
  directly without any X11 indirection.

Verified:
  Default build: `Window Maker 0.96.0` runs.
  Shared src/ object files: `nm | grep '^X[A-Z][a-z]'` is empty.
  All shared X11 macro names (CW*, P*, ICCCM hint flags) are
  defined locally in backend_types.h, no X11 dep needed.

Out of scope (separate refactor): wmaker compositor binary itself
still links libX11 because src/backend/x11/* and the XWayland
integration in src/backend/wayland/wl_backend.c need real X11
types.  Both are below the vtable, so shared code is unaffected.
2026-05-24 12:52:31 +02:00
..
backend wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
GNUstep.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
Makefile.am arch: move wmspec.c (EWMH) and xdnd.c (XDND) into src/backend/x11/ 2026-05-24 09:16:39 +02:00
WindowMaker.h wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
actions.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
actions.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
appicon.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
appicon.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
application.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
application.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
appmenu.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
appmenu.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
balloon.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
balloon.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
client.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
client.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
colormap.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
colormap.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
cycling.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
cycling.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
def_pixmaps.h WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00
defaults.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
defaults.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
dialog.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
dialog.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
dock.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
dock.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
dockedapp.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
dockedapp.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
event.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
event.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
extend_pixmaps.h WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00
framewin.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
framewin.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
geom.c Wayland backend abstraction: WMBackend vtable (Phases 0–30) 2026-03-27 19:20:00 +01:00
geom.h Wayland backend abstraction: WMBackend vtable (Phases 0–30) 2026-03-27 19:20:00 +01:00
geomview.c wings: phase α.2 — rename X11 event masks to WM_EVMASK_* 2026-05-24 10:43:23 +02:00
geomview.h WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00
icon.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
icon.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
keybind.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
main.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
main.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
menu.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
menu.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
misc.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
misc.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
monitor.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
monitor.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
motif.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
motif.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
moveres.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
osdep.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
osdep_bsd.c WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00
osdep_darwin.c WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00
osdep_linux.c WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00
osdep_stub.c WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00
pixmap.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
pixmap.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
placement.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
placement.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
properties.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
properties.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
resources.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
resources.h wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
rootmenu.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
rootmenu.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
screen.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
screen.h wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
session.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
session.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
shutdown.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
shutdown.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
stacking.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
stacking.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
startup.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
startup.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
superfluous.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
superfluous.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
switchmenu.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
switchmenu.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
switchpanel.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
switchpanel.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
texture.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
texture.h wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
usermenu.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
usermenu.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
wconfig.h wings: phase γ (widgets.c) — split Xlib calls into widgets_x11.c 2026-05-24 10:55:30 +02:00
wconfig.h.in Wayland backend abstraction: WMBackend vtable (Phases 0–30) 2026-03-27 19:20:00 +01:00
wcore.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
wcore.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
wdefaults.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
wdefaults.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
window.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
window.h wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
winmenu.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
winmenu.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
winspector.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
winspector.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
workspace.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
workspace.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
wsmap.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
wsmap.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
xdg-shell-protocol.h wayland: Phase 35 — advertise core Wayland protocol globals 2026-03-27 23:09:39 +01:00
xinerama.c wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
xinerama.h wings: revert accidental WNativeWindow rename in strings/comments 2026-05-24 11:42:37 +02:00
xmodifier.c wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00
xmodifier.h arch: move X11 modifier-keymap discovery into X11 backend 2026-05-24 08:43:32 +02:00
xutil.c wings: phase β — rename X11 typedefs in shared/Wayland code 2026-05-24 10:49:47 +02:00
xutil.h wm core: shared src/ is now X11-free at the source level 2026-05-24 12:52:31 +02:00