frame_buf_at was preferring parent frame_bufs over smaller children
(buttons), so clicks on the close/iconify button area were dispatched
to the titlebar instead. Fix by preferring the smallest frame_buf
that contains the pointer position.
wl_window_move for frame_bufs was setting absolute x,y instead of
updating rel_x/rel_y and computing absolute position from parent.
This caused the close button to stay at its old position when the
frame was resized (e.g. on maximize).
Fix: set rel_x/rel_y and compute absolute position from parent,
matching the logic in wl_frame_configure.
frame_paint was never called after wWindowConfigure during maximize
because the X11 path relies on expose events to trigger repaints.
In Wayland there are no expose events, so explicitly call frame_paint
after wWindowConfigure in wMaximizeWindow and wUnmaximizeWindow.
Also:
- Guard client scene_node repositioning in frame_configure (NULL check)
- Move dispatch+flush+frame_done into wl_window_resize with reentrancy
guard and output frame listener disabled to avoid nested render crashes
- Remove debug wwarnings
- Send frame_done after configure so clients can render at new size
- Set activated state on toplevel configure
- Dispatch idle callbacks to flush configure immediately
- Add client_set_maximized vtable entry for XDG toplevel state
- Re-enable frame_buf scene node on unshade
- Raise client scene node on window_map (fixes unshade visibility)
- Reposition client and children in frame_configure
- Schedule output frame after frame_paint
- Remove debug wwarnings from wl_window_resize
This fixes:
- Window shade/unshade (resizebar + client surface visibility)
- Client surface receiving configure events and rendering
- Frame decoration updates on resize/maximize
On shade, the client scene node was lowered and disabled, and the
frame_buf scene node was disabled. On unshade, the frame_buf node
was not re-enabled, and the client node was enabled but remained
behind the frame (at bottom of Z-order from stacking_lower).
Fix: re-enable frame_buf node when show_resizebar is true, and
raise the client scene node to top on window_map so it's above
the frame background.
On Wayland, scene buffer nodes are independently composited and not
clipped to their parent frame bounds. When shading collapses the frame
to titlebar height, the resizebar scene node remained visible because
nothing disabled it.
Two changes:
1. wl_frame_paint: skip resizebar rendering and disable both the
resizebar own scene node and the main frame scene buffer when the
frame height is <= the titlebar height (shaded). Re-enable both
when unshaded.
2. actions.c: call wm_backend->frame_paint() after wFrameWindowResize
in both wShadeWindow and wUnshadeWindow. This triggers the scene
graph update on Wayland and is a harmless decoration refresh on X11.
x11_fake_leader_create() creates a 10x10 parent window, but the
original code created each parent at the correct pwidth x pheight.
When the WINGs panel is reparented into a 10x10 parent, X11 clips
child windows to parent bounds, making dialog contents invisible.
wWindowConfigure never resizes the client because client.width is
pre-set to the correct value, so resize evaluates to false.
Add wm_backend->window_resize() on the parent immediately after
fake_leader_create in all 9 callers that reparent content into it:
dialog.c (7), winspector.c (1), dockedapp.c (1).
The window.c group-leader caller is unaffected (size irrelevant).
WMHandleEvent is the middle layer — it must not contain any
backend-specific code. Move view lookup to _view_target field
set by each event backend during fetch. Move XRefreshKeyboardMapping
and XFilterEvent into x11_fetch. Selection and DND handling removed
from middle layer (handled by extraEventHandler in the WM layer).
The _x11_raw field remains in WMEvent for now (used by src/event.c
and other WM-layer code that still needs the raw XEvent), but the
middle layer no longer touches it.
When raising a frame_buf, also raise its children (titlebar,
resizebar) and the client surface inside it. When raising a
client surface, also raise its containing frame. This ensures
click-on-titlebar raises the entire window assembly.
findMenu only checked root_menu and switch_menu, so the window
menu (right-click titlebar) was never found during mouse tracking.
Add window_menu and its cascades to the search.
Don't add ascent offset — pango_ft2_render_layout renders from the
top of the layout, not from the baseline. The extra ascent was
pushing text below the visible area of the text field.
Read XKB_DEFAULT_LAYOUT, XKB_DEFAULT_VARIANT, XKB_DEFAULT_OPTIONS,
XKB_DEFAULT_MODEL, and XKB_DEFAULT_RULES from environment when
creating the default keymap. Set these to match your layout
(e.g. XKB_DEFAULT_LAYOUT=us XKB_DEFAULT_VARIANT=dvorak).
When the session resumes after a VT switch, wlroots may destroy and
recreate input devices. Remove old listeners before adding new ones
to avoid assertion failure in wlr_keyboard_finish. Initialize all
listener links at startup so the first remove is safe.
- Store wlr_session from wlr_backend_autocreate.
- Skip frame commit when session is inactive (VT switched away).
- Wire ptr->events.motion (relative) for libinput devices so cursor
moves in standalone DRM/KMS mode.
- Use wlr_backend_autocreate for standalone mode (from TTY) instead of
headless-only. Gives real DRM/KMS output + libinput.
- wl_update_pointer_focus: skip client surface focus when pointer is
over an internal frame_buf (menu, titlebar). Prevents client from
stealing cursor/events from WM chrome.
- wl_focus_set: ensure seat keyboard is set and flush clients before
sending keyboard.enter so client has processed wl_seat.capabilities.
- Renderer and allocator use the autocreated backend in standalone mode.
Widget pixmaps (checkbox, radio, arrows, etc.) were created inside
W_X11PlatformInit, so they were NULL in Wayland mode. Since
makePixmap now uses RImage+RConvertImage (backend-neutral), move
all makePixmap calls to common init after platform_init.
Replace X11 XDrawPoint pixel rendering with RImage construction
and RConvertImage, which dispatches through the backend vtable.
Fixes checkbox/radio button images not appearing in Wayland mode.
The top-level was composited into root before children had painted
into its backing image, resulting in a blank dialog. Now we
composite the top-level a second time after wl_map_subviews so
the final image includes all child content.
Add flush() to W_ViewBackend. X11 backend calls XFlush,
Wayland backend is a no-op (compositing happens at frame
boundaries). wbutton.c WMPerformButtonClick now uses the vtable.
All three handleKeyPress functions in wpanel.c were dereferencing
event->_x11_raw (NULL in Wayland mode) to call XLookupString.
Use event->u.key.keysym directly — it's already translated by
the backend.
Replace XClearWindow with render backend fill_rect.
Remove X11 region-based clip masking around relief drawing —
the title is drawn on top afterward, making the clip unnecessary.
Eliminates WMColorGC/XCreateGC crash in Wayland mode.
RConvertImage and RConvertImageMask now dispatch through function
pointers on RContext, set during context creation:
- RCreateContext sets x11_convert_image/x11_convert_image_mask
- RCreateContextWayland sets wl_convert_image/wl_convert_image_mask
The Wayland backend creates pixman_image_t from RImage RGBA data
instead of returning NULL pixmaps, fixing the SIGSEGV in the exit
dialog when compositing the application icon.
X11 code moved to convert_x11.c, Wayland code in convert_wl.c.
No dpy guards in the middle layer.
- Add selection_acquire, selection_release, platform_init to
W_ViewBackend struct (were used but not declared).
- Add lookup_string to W_FontBackend struct (same issue).
- Guard selection_acquire call with NULL check in selection.c.
- Remove pixman_image_unref in wl_frame_configure resize path —
wlroots manages the buffer lifecycle via scene refcounting.
LSan confirms no leak.
- Remove #include of wmspec.c/xdnd.c/xmodifier.c from x11_backend.c
— they are already compiled as standalone objects, causing
multiple-definition linker errors on clean builds.
wMouseMoveWindow and wMouseResizeWindow took XEvent* but were
being passed WMEvent* via casts. The XEvent union layout differs
completely from WMEvent, so ev->xmotion.x_root read garbage —
causing the window to jump to a wrong position and the move to
become uncontrollable.
Changed both functions to take WMEvent*, accessing ev->u.button
fields directly. Removes all XEvent references from the core
policy layer (zero backend-specific types in the middle).
When a client (e.g. foot) sets its own cursor surface via
wl_pointer.set_cursor, the cursor disappears once the pointer
moves off the client surface because nobody resets it. Now
wl_update_pointer_focus resets to left_ptr when the pointer
leaves all surfaces or enters a new one (before the client
gets a chance to override via request_set_cursor).
Three issues fixed:
1. Frame and client surface moved independently during interactive
window move. The client surface (wl_toplevel_view) and frame
decorations (wl_frame_buf) are independent scene graph nodes —
unlike X11 where reparenting creates an implicit parent-child
relationship. Added frame_id/frame_rel_x/frame_rel_y to
wl_toplevel_view so wl_window_move keeps them in sync.
2. window_move(client_win, x, y) treated coordinates as absolute,
but the WM core passes relative-to-frame coordinates (matching
X11 child window semantics). Now detected via frame_id and
converted to absolute scene positions.
3. Titlebar scene node was offset by left_button_width because
updateTitlebar() configures it for X11 layout (separate
overlapping windows). Since the Wayland backend composites
buttons directly into the titlebar buffer, override the
titlebar position to frame origin during wl_frame_paint.
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.
- Create WM frames (titlebar, buttons, resizebar) for native XDG
toplevels — remove the is_wayland guard that skipped frame creation
- Set decoration mode to SERVER_SIDE so clients don't draw their own
titlebar (CSD)
- Skip client_reparent for Wayland (no X11 reparenting needed; the
client scene node is independent of the frame scene buffers)
- Set frame_border_width=0 in wl_screen_create_internals (Wayland has
no X11-style window border; the frame_buf renders all decoration)
- Use wlr_scene_subsurface_tree_create for client surface (avoids XDG
geometry offset issues)
Known issue: transient size mismatch on initial map when saved session
state or size constraints differ from the client's committed buffer.
Resolves after the client processes the configure event.
- Add wlr_subcompositor global (required by all modern Wayland clients)
- Switch from xdg_shell new_surface to new_toplevel signal (wlroots 0.19
fires new_surface with role=NONE before get_toplevel assigns the role)
- Defer initial xdg_surface configure to first client commit via
surface->events.commit listener (surface must be initialized first)
- Defer xdg_decoration set_mode to first commit (set_mode internally
calls schedule_configure which asserts initialized)
- Wire destroy_listener to toplevel->events.destroy instead of
xdg_surface->events.destroy (wlroots asserts toplevel event lists
are empty before the toplevel is freed)
- Log DISPLAY and WAYLAND_DISPLAY env vars at startup
- Add WAYLAND_ROADMAP.md
Native Wayland clients (foot, etc.) can now connect, render, and
disconnect without crashing the compositor.
Was calling redisplay then map_subviews separately, with background
overwriting children. Now calls vb->map which does background first,
then children composite on top, with final commit showing everything.
- Only apply default XKB keymap as fallback when the host compositor
hasn't provided one yet (kb->xkb_state == NULL)
- The nested backend receives the host's keymap (Dvorak, etc.) via
wl_keyboard.keymap — don't overwrite it with QWERTY default
wlr_seat_keyboard_notify_key was being called unconditionally, which
caused re-entrancy that consumed WINGs events from the queue before
the modal loop could fetch them. Now only forwards to the seat when
there's an actual focused client surface.
Also use 16ms timeout in wl_flush so keyboard events from the nested
compositor are actually received during modal loop dispatch.
Eliminated the separate Wayland/X11 code paths. Now ONE path:
1. Backend selection (based on WMAKER_USE_WAYLAND)
2. Backend init
3. Common init (colors, fonts, antialiasedText)
4. viewBackend->platform_init() — X11 does GCs, atoms, cursors,
cut buffers, modifier masks, pixmaps, IM, W_InitApplication.
Wayland is NULL (no platform-specific late init needed).
5. rootView, balloon, return
All X11-specific screen setup moved to W_X11PlatformInit() called
through the view backend vtable. No if-guards, no early returns,
no separate paths.
- WINGsP.h: add selection_acquire/release slots to W_ViewBackend
- wview_x11.c: implement via XSetSelectionOwner/XGetSelectionOwner
- wview_wl.c: stub that returns True (TODO: wl_data_device)
- selection.c: use vtable instead of direct X11 calls
In X11, the server delivers events to the deepest child window.
In Wayland, all widgets share one frame_buf. WMHandleEvent now
does hit-testing within the view tree to find the correct child
widget for button press/release/motion events.
After WMHandleEvent processes a key press, the text field repaints
into its backing image. The modal loop now re-composites the view tree
and commits to the scene graph so changes are visible immediately.
Warn and drop the event rather than silently swallowing it. This makes
the root cause visible — key events arriving before keyboard is fully
initialized.
wl_map was calling wl_map_subviews (children) then wl_redisplay (bg fill),
overwriting children with the background. Reversed order so background
is filled first, then children composite on top.
- window.c: always call frame_paint for internal windows (title=NULL
skipped wFrameWindowChangeTitle which was the only paint trigger)
- wview_wl.c: fill view backing with background color before expose
(X11 server fills background automatically, Wayland needs explicit fill)
When fake_leader is reparented into the frame, its children (the WINGs
view frame_buf) weren't being repositioned. Now cascades position
updates to children of the reparented frame_buf.
Children were painted during panel creation (before frame_buf backing
was connected). Now wl_map triggers wl_map_subviews when a top-level
view is mapped, re-painting all children into the correct backing image.
wl_map was calling wl_redisplay on every view map, including internal
widgets during startup. This caused crashes when non-dialog views
received expose events before being fully set up.