Commit Graph

3 Commits

Author SHA1 Message Date
Levi Neely 6f1c499b03 Phase 80k: clean X11 from startup.c
- getOffendingModifiers (XGetModifierMapping/XFreeModifiermap) ->
  setup_modifier_lock_masks vtable slot
- wHackedGrabKey (XGrabKey with NumLock/ScrollLock combos) ->
  key_grab_hacked vtable slot
- wHackedGrabButton (XGrabButton with lock combos) ->
  button_grab_hacked vtable slot
- XUniqueContext calls -> context_init vtable slot
- XQueryTree/XFree in wManageAllWindows -> query_tree vtable slot
  (returns wfree-able array)
- XGetWindowAttributes in wScreenForWindow -> screen_for_window vtable
- _NumLockMask/_ScrollLockMask made non-static (needed by x11_backend)

New vtable slots: setup_modifier_lock_masks, key_grab_hacked,
button_grab_hacked, context_init, query_tree, screen_for_window.
startup.o verified X11-free with nm.
2026-05-13 11:24:45 +02:00
Levi Neely 553d2ca0ba Phase 80: eliminate all 43 if(!dpy) return guards via vtable dispatch
Remove every 'if (!dpy) return' guard from policy files by moving
X11 mechanism code behind WMBackend vtable slots. Call sites now
dispatch through wm_backend->slot(), the X11 backend implements the
mechanism, and the Wayland backend provides no-ops or Wayland-native
implementations.

New vtable slots added to backend.h:
- Frame: frame_alloc_border_pixel, frame_update_texture, frame_paint_button
- NETWM: netwm_init, netwm_cleanup, netwm_update_desktop,
  netwm_get_current_desktop, netwm_update_opacity, netwm_update_actions,
  netwm_check_client_hints, netwm_check_initial_state, netwm_get_pid,
  netwm_cleanup_frame_extents
- Properties: prop_get_protocols, prop_get_check_property,
  prop_set_wmaker_protocols, prop_set_icon_tile, prop_cleanup
- Client: client_restore, client_set_state, client_send_protocol,
  client_kill, client_get_colormap_windows
- Misc: eat_expose, move_window, slide_windows, get_text_selection,
  get_shortcut_string, get_command_for_window
- Icon: icon_update_pixmap, icon_paint
- AppIcon: appicon_show, appicon_paint, appicon_bounce
- Shutdown: restore_desktop, wipe_desktop
- Resources: get_color_for_colormap, free_color, colormap_install
- Protocol: xdnd_init, motif_get_hints
- Startup: manage_all_windows
- Event: event_handle_signal_exit

Structural changes:
- MWMHints moved from motif.c local typedef to motif.h
- WProtocols given struct tag for forward declaration
- Static functions made non-static: wGetTextSelection, wGetCommandForWindow,
  wGetMWMHints, wWipeDesktop, wManageAllWindows, wNETWMUpdateWindowOpacity

Verification: grep -rn 'if (!dpy)' src/*.c returns zero results.
nm wl_backend.o confirms no new X11 symbols in Wayland path.
2026-05-13 10:01:57 +02:00
Levi Neely fcee811b99 WindowMaker 0.96.0 upstream source 2026-03-26 15:38:49 +01:00