Commit Graph

278 Commits

Author SHA1 Message Date
Window Maker 1c1f261fb2 arch: eliminate _x11_raw escapes from event.c
Five _x11_raw accesses in shared event.c (the worst architectural leak)
removed by widening vtable signatures and moving X11-only logic into
the X11 backend:

  WME_SELECTION_REQUEST / WME_SELECTION_CLEAR
    * handle_selection_request/clear functions deleted from event.c
    * Reimplemented in x11_backend.c as x11_handle_selection_request/clear
      where they read _x11_raw internally and call XChangeProperty etc.
    * New vtable slots handle_selection_request / handle_selection_clear
      (WMEvent*).  Wayland: no-ops (wmaker UI does not own a WM_Sn
      selection on the X server).

  WME_CONFIGURE
    * event_randr_update vtable widened to (WMEvent*).
    * Root-window check (DefaultRootWindow) moved into x11 impl.

  WME_MAPPING
    * Dropped the if (xev) guard — keyboard_mapping_refresh already
      took WMEvent*.

  WME_SELECTION
    * xdnd_process_selection vtable widened to (WMEvent*).

Net: event.c is X11-free except for DefaultRootWindow uses elsewhere
that will be cleaned up in subsequent tasks.
2026-05-24 08:37:50 +02:00
Window Maker f2e49a8b67 menu: fix infinite recursion in findMenuWalk via brother
A WMenu's brother is a parallel copy of the same menu used when the
menu is torn off / buttoned.  The brother shares cascade pointers
that reference back into the original tree, so recursing into both
m->brother and m->cascades[i] cycled (brother->cascades[i] == m's
own cascade entry, which has its own brother, etc.) and overflowed
the stack on any cascaded menu.

Inline the brother hit-test instead of recursing into it.  Cascades
themselves are walked recursively as before so sub-sub-menus remain
reachable.
2026-05-24 08:25:14 +02:00
Window Maker 3fb9f3925f menu: recursive findMenu so sub-sub-menus respond to mouse
The previous implementation only checked one level of cascades —
scr->root_menu and scr->root_menu->cascades[i].  Sub-sub-menus
(cascade->cascade->...) were never checked, so hovering over a
sub-sub-menu's entries did not return the menu, and selectEntry
therefore could not open the next-level cascade or react to clicks.

Replace with a recursive walk over each top-level menu's full
cascade tree.  Pick the deepest mapped menu that contains the
pointer (deeper cascades render on top in the scene graph and
should win the hit-test).

X11 sidesteps this with XQueryPointer + XFindContext, which finds
any menu window via the X server's hit-test regardless of nesting.
2026-05-24 08:23:42 +02:00
Window Maker 31576e4b25 wayland: use set_buffer_with_damage for all in-place paints
wlr_scene_buffer_set_buffer treats same-pointer assignment as a
no-op — pixel updates to fb->image are not picked up.  Every paint
function in the backend mutates fb->image (or s->wlr_buf) in place
and then commits with the same pointer, so wlroots never re-rendered
the changed contents.

Convert all 15 sites to wlr_scene_buffer_set_buffer_with_damage(...,
NULL) which forces a full rerender.  This restores the menu paint
fix to its proper general form and addresses the clip workspace
number/title not appearing at startup, as well as latent staleness
in dock/drawer icon and balloon paint paths.
2026-05-24 08:13:57 +02:00
Window Maker e973406d95 framewin: guard handleButtonExpose against unset descriptor parent
wFrameWindowUpdateBorders calls wFrameWindowResize at line 356,
which (since commit f88dfac) calls frame_paint.  On X11,
frame_paint dispatches to wFrameWindowPaint which iterates
button descriptors and calls handleButtonExpose.  But the
descriptors' parent field is set later in wFrameWindowUpdateBorders
(after the resize call) — so during this first paint, fwin
(desc->parent) is NULL and the function segfaults at the
left_button comparison.

The Wayland backend skips wFrameWindowPaint via wl_frame_paint
returning 1, so it never hit this path.
2026-05-23 22:12:53 +02:00
Window Maker a1d9fdf9f1 wayland: fix orphan menu titlebars at startup
Top-level frame trees were enabled by default at creation. When
framewin.c then called wm_backend->window_map_raised(titlebar) at
frame creation time (necessary for X11 decoration semantics), the
titlebar's scene_buf became enabled. Combined with the always-enabled
tree, this made the titlebar visually rendered at the frame's
default spawn position — even for menus and dialogs that had not
been logically mapped yet. The visible orphan reflected whichever
submenu titlebar was painted last (e.g. 'Multimedia').

Fix: top-level frame trees now start DISABLED. wl_window_map and
wl_window_map_raised explicitly enable the tree when called on a
top-level frame_buf. This matches X11 semantics where a child window
is only visible if its parent window is mapped. Decoration children
(titlebar, buttons) being individually 'mapped' no longer produces
orphan visibility because the parent frame's tree gates their
visibility.
2026-05-23 22:07:41 +02:00
Window Maker ce5cea8679 wayland: destroy fb->tree in wl_frame_destroy
Frame_bufs that owned a wlr_scene_tree (top-level frames and the
fake_leader for dialogs) leaked their tree on destroy.  The scene_buf
was destroyed but the tree remained in the scene graph as an orphan,
causing stale rendering — most visibly as ghost titlebars near the
clip after closing a menu, since the leaked menu frame trees stayed
in the scene.
2026-05-23 21:29:38 +02:00
Window Maker c7e2b7ba88 wayland: fix dialog/menu hit-testing and parenting
Several related fixes for WINGs dialogs and menus that depend on
correct scene graph parenting and hit-testing:

1. fake_leader_create: now creates a wlr_scene_tree (not just a
   scene_buf). When the fake_leader is reparented into a WMaker frame,
   any content inside it (e.g. WINGs panel) is reparented as part of
   the tree, so it follows the WMaker frame's position when moved.

2. wl_client_reparent (frame_buf path): if the source frame_buf has
   a tree, reparent the tree (with all its children) instead of the
   bare scene_buf.

3. frame_buf_update_children_abs: new recursive helper to walk the
   entire descendant tree updating fb->x/y absolute tracking. Used
   by wl_window_move, wl_frame_configure, and wl_client_reparent.
   Without this, grandchildren (e.g. WINGs panel inside a fake_leader
   inside a WMaker frame) had stale fb->x/y after the WMaker frame
   was moved, causing click coordinate translation to be wrong and
   buttons to stop responding after dragging the dialog.

4. frame_buf_button_at: now walks up the scene tree checking ancestor
   enabled state. A frame_buf's scene_buf may be flagged enabled even
   when an ancestor tree is disabled (e.g. menu unmapped). Without this
   check, clicks could be incorrectly routed to ghost frame_bufs from
   recently-unmapped menus, causing root-menu reopen to require
   multiple clicks.
2026-05-23 21:27:19 +02:00
Window Maker bc25aa4b8a wayland: fix click delay after shade and modal dialog parenting
After shading a window, clicks on the lower titlebar would be routed to
the resizebar handler, requiring multiple clicks before one landed in
a region where frame_buf_button_at didn't return the (disabled) resizebar.

Two related bugs:

1. frame_buf_button_at iterated all child frame_bufs without checking
   enabled state. The shaded resizebar's bounds still recorded in
   fb->x/y/width/height but its scene_buf was disabled. Since the
   shaded resizebar was repositioned ON TOP of the titlebar, clicks
   in the overlapping region returned the (smaller, disabled)
   resizebar instead of the titlebar. Added an enabled-state check.

2. wlroots scene graph caches buffer dimensions for hit-testing.
   Mutating fb->base.width/height directly leaves stale bounds. Use
   wlr_scene_buffer_set_dest_size() whenever the buffer is resized.

Also fixes:
- WINGs dialog content was placed in WL_LAYER_FLOATING instead of
  under the parent frame's tree, so the content didn't follow the
  WM-managed decorations on move. Now parented under the frame tree
  and positioned at relative offset.
- wl_window_map called wlr_scene_node_raise_to_top on the client
  scene_node, which raised it above the titlebar within the frame
  tree. After unshade this hid the titlebar. Removed.
- xdg_activation focus path: raise the frame tree, not the client
  scene_node, for the same reason.
2026-05-23 21:08:19 +02:00
Window Maker 13101c53c3 wayland: fix resize by refactoring scene graph to relative coordinates
The scene graph was using absolute coordinates for all nodes with the
frame tree at (0,0). This caused the resizebar to be detached from the
window frame and resize to break because child nodes (titlebar, client
surface, resizebar) had to be manually repositioned on every move/resize.

Refactor to the correct wlroots model:
- Frame tree positioned at (frame_x, frame_y)
- All children use local offsets relative to the tree
- Moving the tree moves everything automatically

Additionally fix interactive resize:
- handle_toplevel_commit now syncs the WM frame to the client's actual
  committed buffer size, ensuring frame and client stay in lockstep
- Ensure client scene_node is always parented under the frame tree
- Simplify wl_window_resize to just send xdg_toplevel.set_size without
  blocking event loop dispatch
- Properly free old pixman images and detach stale buffers on resize
2026-05-23 20:13:07 +02:00
Ollie 2d5c80f332 wl_backend: fix resizebar texture and client frame_rel update on resize
1. Resizebar: wl_frame_paint_resizebar was painting a flat color buffer
   over the textured resizebar rendered by wl_frame_paint. Make it a
   no-op since the parent frame buffer has the correct texture.

2. Resize gap: client_synth_configure updates the client scene_node
   position but was not updating frame_rel_x/y. When frame_configure
   ran next (e.g. on subsequent move), it would recompute the client
   position using stale frame_rel values, causing the surface to jump.
   Now updates frame_rel_x/y from the new absolute position.
2026-05-23 19:34:56 +02:00
Ollie f88dfac8b9 framewin: repaint frame after configure/resize
On X11, resizing a frame triggers an Expose event which repaints the
decorations. On Wayland, no such event is generated, so the frame
(titlebar, resizebar) was never repainted after resize — leaving
stale decorations at the old width.

Call frame_paint after reconfigure in both wFrameWindowConfigure
and wFrameWindowResize.
2026-05-23 19:22:56 +02:00
Ollie 4f70ab6df5 wl_backend: fix resizebar click detection
frame_buf_button_at had a size threshold (width>30 || height>30) that
skipped resizebar frame_bufs during hit-testing. The resizebar is wide
but short (~8px), so it was always skipped. Clicks in the resizebar
area fell through to the parent frame, preventing resize.

Remove the size threshold. The smallest-area heuristic already ensures
buttons (small) are preferred over resizebars (large) when both match.
2026-05-23 19:20:18 +02:00
Ollie 4b338d11d0 wl_backend: fix client surface rendering with proper scene output commit
Client surfaces (e.g. foot terminal) were not updating after initial
map. Two issues:

1. wlr_scene_output_commit(scene_output, NULL) in wlroots 0.19 may
   skip rendering if it determines no damage is pending, even when
   client surfaces have committed new buffers.

2. Frame scheduling was dependent on host compositor timing.

Fix: Replace wlr_scene_output_commit with explicit build_state +
commit_state cycle which properly tracks damage. Also schedule a
frame unconditionally every loop iteration to ensure continuous
rendering in nested mode.
2026-05-23 19:14:57 +02:00
Ollie a438713b92 WINGs/wview_wl: implement internal DnD for Wayland
Implement wl_drag_begin as a simple internal drag-and-drop state machine
for WINGs-to-WINGs drag operations (color wells, text widgets).

On button press, waits for motion to confirm drag intent, then enters
a drag loop tracking the cursor. On release, finds the view under the
cursor and if it has drag destination procs + matching types, fetches
data from the source and calls performDragOperation on the destination.

This handles same-process DnD without needing wl_data_device protocol.
2026-05-23 19:07:54 +02:00
Ollie 1c96a93ac8 menu: add dock/clip/dock-position menus to findMenu lookup
findMenu() only checked root_menu, switch_menu, and window_menu.
Dock and clip menus were never found, so pointer motion over them
could not highlight entries or activate on release.

Add CHECK_MENU calls for scr->dock->menu, scr->clip_menu, and
scr->dock_pos_menu.
2026-05-23 19:04:17 +02:00
Ollie 5558a1edf0 WINGs/wfont_wl: remove stale text comparison in wl_text_width
The optimization that skipped pango_layout_set_text when the text
matched the previous layout content used pango_layout_get_text()
which returns an internal pointer. This pointer comparison with
arbitrary input text could read freed memory or trigger heap
corruption in Pango internals when the layout state was stale.

Always call pango_layout_set_text unconditionally. The cost is
negligible (Pango internally short-circuits if text is identical).
2026-05-23 16:41:44 +02:00
Ollie 3acf2f6b2b WINGs: implement Wayland selection fetch (middle-click paste)
Add selection_fetch vtable slot for synchronous selection retrieval.
On Wayland, WMRequestSelection uses this to fetch clipboard/primary
selection data directly (via W_ClipboardFetchFn -> seat pipe read)
and calls the callback immediately. On X11, the async path
(selection_request -> SelectionNotify event) is unchanged.

This makes middle-click paste work in WINGs text widgets on Wayland.
2026-05-23 16:37:58 +02:00
Ollie 130fd760b5 docs: mark Phase D complete, add src/ audit results
Phase D (WINGs widget X11 elimination) is complete with 7 commits.
The src/ core audit confirms all X11 is already routed through
wm_backend-> dispatch. The entire codebase has zero X11 executing
on the Wayland path.
2026-05-23 16:31:45 +02:00
Ollie 7077e00d12 WINGs: remove dead X11 code from wtext.c and wmisc.c
- wtext.c: remove unused XEvent variable
- wmisc.c: remove dead #ifndef DOUBLE_BUFFER branches (XClearWindow)
  DOUBLE_BUFFER is always defined; these were unreachable.
2026-05-23 16:19:48 +02:00
Ollie 1ab108f7aa WINGs/wevent: fix NULL toplevel crash on Wayland expose dispatch
W_TopLevelOfView returns NULL for views without a topLevel ancestor
(e.g. geometry display widgets parented directly to root). On X11 this
never triggered because expose events only arrived for mapped windows
with proper widget hierarchy. On Wayland, wl_redisplay synthesizes
expose events for any view, exposing the NULL case.

Fix: fall back to the view itself when no topLevel ancestor exists.
2026-05-23 16:17:18 +02:00
Ollie 8ec338016a WINGs/wcolorpanel: gate magnifier via vtable callback dispatch
The magnifier is X11-backend-specific (screen capture). Instead of a
disguised is_x11 check, the view backend provides the callback directly:
- X11: .magnify_callback = W_ColorPanelMagnify (the magnifier impl)
- Wayland: .magnify_callback = NULL (button does nothing)

The button wiring uses the vtable value as the action callback.
No conditionals, no capability flags, pure vtable dispatch.

Also removes the screen_grab_image vtable slot that was a disguised check.
2026-05-23 16:15:03 +02:00
Ollie 0e26aa878c WINGs/wcolorpanel: replace pixmap/copy/fill X11 calls with render backend
Converts 60 X11 calls (XCreatePixmap, XFreePixmap, XCopyArea,
XFillRectangle) to render backend vtable dispatch. Remaining 40
calls are all in the magnifier feature (screen capture, inherently
platform-specific) and will be handled separately.
2026-05-23 16:09:10 +02:00
Ollie 9ccfd33971 WINGs: route selection acquire/release/request through vtable
- WMDeleteSelectionHandler: X11 grab/release replaced with selection_release vtable
- WMRequestSelection: XGetSelectionOwner+XConvertSelection replaced with selection_request vtable
- x11_selection_release: now properly releases ownership (was no-op)
- x11_selection_request: new vtable impl for X11 selection conversion
- Wayland selection_request: NULL (no-op, returns False)
2026-05-23 16:02:11 +02:00
Ollie 2dce45432d WINGs: route XOR drawing through vtable, remove X11 from wtextfield/wsplitview
- wsplitview.c: XFillRectangle+ixorGC replaced with xor_fill_rect vtable call
- wtextfield.c: removed Display *dpy and XRotateBuffers (cut buffer is dead)
- Added xor_fill_rect to W_ViewBackend (X11 impl, Wayland NULL/no-op)
2026-05-23 15:53:16 +02:00
Window Maker 9eecb2511c WINGs Phase D: port wballoon, wpopupbutton, wtext to vtable
New vtable slots: pointer_grab, pointer_ungrab, bell, balloon_draw, text_init
All implemented in X11 backend, no-ops in Wayland backend.

wballoon.c: XTranslateCoordinates -> get_screen_position, showText -> balloon_draw
wpopupbutton.c: all 7 Xlib calls replaced (grabs, coords, flush)
wtext.c: XMapWindow, XBell, XGrabPointer, XUngrabPointer, cursor, GC init all ported
2026-05-23 15:26:48 +02:00
Window Maker 264679a2d1 WINGs: port wwindow.c to vtable dispatch (Phase D)
Removes all direct Xlib calls from wwindow.c (25 calls eliminated).
ICCM/EWMH property setting dispatched through W_ViewBackend slots:
- window_set_title, window_set_icon_title, window_set_icon_image
- window_realize (WM_CLASS, WM_HINTS, WM_PROTOCOLS, transient-for)
- window_set_geometry (WM_NORMAL_HINTS)
- window_withdraw (XWithdrawWindow)

X11 backend implements full property setting.
Wayland backend is no-op (compositor-internal windows).
Struct moved to wwindow_p.h for backend access.
2026-05-23 15:19:52 +02:00
Window Maker 11c5625d1e WINGs: add Phase D vtable slots, port wballoon.c
Adds window_set_title, window_realize, window_set_geometry,
window_withdraw, pointer_grab, pointer_ungrab, bell, balloon_draw
slots to W_ViewBackend.

Ports wballoon.c:
- XTranslateCoordinates replaced with get_screen_position vtable
- showText replaced with balloon_draw vtable dispatch
- X11 backend calls existing rendering code
- Wayland backend is no-op (WM-level balloon handles dock tooltips)
2026-05-23 15:13:38 +02:00
Window Maker eeda48d24e Fix clipboard free mismatch: XFree -> wfree
x11_clipboard_fetch now returns wmalloc copy (XFree internally).
Callers use wfree uniformly on both backends. Prevents X11 regression
where XFree was called on wmalloc memory or vice versa.
2026-05-23 15:04:15 +02:00
Window Maker 0083654d2e WINGs: route DnD through view backend vtable
Adds drag_begin slot to W_ViewBackend. WMDragImageFromView dispatches
through it. X11 backend sets NULL (falls through to existing XDND
code). Wayland backend is a no-op — prevents crash without guards.
2026-05-23 15:02:30 +02:00
Window Maker cee271f2cd WINGs: cross-client clipboard via wlr_seat selection
Bridges WINGs internal clipboard to the Wayland seat selection so
copy/paste works between compositor-internal dialogs and real
Wayland clients. Store creates a wlr_data_source and sets seat
selection. Fetch reads from foreign selection sources via pipe.
2026-05-23 14:59:42 +02:00
Window Maker 0dc7e33e4b WINGs: route clipboard through view backend vtable
Adds clipboard_store/clipboard_fetch to W_ViewBackend. Replaces
direct XFetchBuffer/XStoreBuffer calls in wtextfield.c and wtext.c
with vtable dispatch. X11 backend wraps Xlib, Wayland backend uses
an internal buffer.
2026-05-23 14:55:59 +02:00
Window Maker e7427f08db WINGs Wayland: implement view ops (move, resize, unmap, raise, lower, reparent)
Replaces all no-ops in wview_wl.c with real implementations:
- move: updates pos, triggers parent redisplay
- resize: reallocates pixman buffer, triggers redisplay
- unmap/unmap_subviews: clears mapped flag, triggers parent redisplay
- raise: moves view to end of sibling list (drawn last = on top)
- lower: moves view to front of sibling list (drawn first = on bottom)
- reparent: moves between parent children lists
2026-05-23 14:51:07 +02:00
Window Maker 4c5f07f9ec Phase C complete: balloon tooltips + window opacity
C1 (slide animations): already works - misc.c calls vtable window_move
C2 (menu scrolling): pure policy code, already works
C3 (balloon tooltips): pixman text render to wlr_scene_buffer overlay
C4 (cursor themes): wlr_xcursor_manager already in place
C5 (window opacity): read _NET_WM_WINDOW_OPACITY, apply to frame +
    child buffers + client surface via wlr_scene_buffer_set_opacity
2026-05-23 14:46:18 +02:00
Window Maker a0a27b56d5 Update ACTION_PLAN.md and WAYLAND_ROADMAP.md 2026-05-23 14:30:29 +02:00
lkn f3cb593d0f fix: button bevel colors derived from titlebar background
Hardcoded white/dark bevel looked wrong against colored titlebars.
Derive highlight and shadow colors from the actual titlebar background
color (+33% for highlight, -33% for shadow) to match the titlebar
bevel style.
2026-05-23 14:18:34 +02:00
lkn 5a4d989a78 fix: titlebar button rendering — proper colors and bevel
- Background: matches titlebar background (sampled)
- Foreground: uses title text color (the color parameter)
- Pressed state: swaps fg/bg (inverted colors)
- Border: raised bevel when normal, sunken when pushed
- Icon pixels rendered in fg color (not raw XPM colors)
2026-05-23 14:16:44 +02:00
lkn a34d8281b9 fix: raise button scene_bufs above titlebar after painting
Buttons and titlebar are siblings in the same scene tree. The titlebar
scene_buf is created after buttons, so it sits on top and occludes them.
Raise button nodes to top after enabling them in wl_frame_paint_button.
2026-05-23 14:12:34 +02:00
lkn 0cf867d548 fix: enable titlebar button scene_bufs for click and visibility
Buttons were rendered into the titlebar buffer with their own scene_buf
nodes disabled. This made them invisible to wlr_scene_node_at and
required a fragile coordinate-based hit-test (frame_buf_button_at).

Switch to rendering each button into its own frame_buf image and
enabling its scene_buf node. This makes buttons:
- Visible as independent scene nodes
- Directly hittable by wlr_scene_node_at
- Properly clickable via the normal frame_buf_at path

Update frame_buf_button_at to use a size threshold (<=30px) instead
of the disabled-node check to identify button sub-windows.
2026-05-23 14:08:34 +02:00
lkn 9ed1c19d6b B5: drawer icon renders directional arrow on Wayland
Replace the one-liner wl_drawer_icon_paint with a full implementation
that draws a filled triangle arrow pointing toward the drawer expansion
direction (left when on_right_side, right otherwise), matching X11.
2026-05-23 14:03:33 +02:00
lkn 3687ff0533 B4: clip icon renders workspace number and name on Wayland
Replace the one-liner wl_clip_icon_paint (which only painted the base
tile) with a full implementation that overlays the workspace number at
top-center and workspace name at bottom, matching the X11 behavior.

Also adds workspace.h and dock.h includes for WWorkspace/WDock types.
2026-05-23 14:02:28 +02:00
lkn 3d1008529b B2: create dock_shadow frame_buf for icon drag ghost overlay
The dock icon drag code (appicon.c, dock.c) uses scr->dock_shadow as a
visual ghost showing the target dock slot. On X11 this is an InputOutput
window; on Wayland it was never created, making all drag shadow
operations no-ops.

Create dock_shadow as a wl_frame_buf with a scene_buffer in the overlay
layer, starting disabled. All existing vtable ops (window_move, map,
unmap, set_background_pixmap, stacking_restack) already handle
frame_bufs, so no additional plumbing needed.
2026-05-23 13:58:23 +02:00
lkn 403ee93ec4 fix: WINGs dialog click-to-focus lookup
The WINGs view ID is not in the context table — only the fake leader
(parent frame_buf) is registered. Walk up to parent_id for the
context_find lookup so the WWindow is found correctly.

Also removed the ID >= 0x20000000 guard so any frame_buf click
(including WM frames without a toplevel surface) triggers focus.
2026-05-23 13:53:39 +02:00
lkn 7fe8121913 fix: clicking WINGs dialog surface now focuses the window
The click-to-focus code only checked wl_toplevel_view surfaces
(real Wayland/XWayland clients). WINGs dialogs are frame_bufs,
not toplevel views, so view_surface_at returned NULL and focus
was never set.

Add fallback: when no toplevel surface is under the pointer,
check if a WINGs dialog frame_buf (ID >= 0x20000000) was hit
and focus its associated WWindow.
2026-05-23 13:51:45 +02:00
lkn ee8489e3a1 fix: WINGs widget clicks on Wayland (child view hit-testing)
On Wayland, all WINGs child widgets composite into a single scene_buf
for the toplevel dialog. Clicks always arrived with the toplevel window
ID, so WMHandleEvent delivered them to the toplevel view which has no
ButtonPressMask handler. Child widget handlers never fired.

Fix: add W_FindViewAtPoint() to walk the view tree and find the deepest
mapped child at click coordinates. In handle_pointer_button, resolve the
child view for WINGs surfaces and pass it as the direct target to
W_WL_EnqueueEvent. WMHandleEvent then delivers directly to the widget.
2026-05-23 13:50:00 +02:00
lkn 68d4301b9f fix: modal dialogs not receiving mouse clicks on Wayland
frame_buf_at() could not find WINGs dialog frame_bufs because they
have no tree wrapper (only a bare scene_buf in WL_LAYER_FLOATING).
After the walk-up stops at the level_tree bucket, Step 4 only checks
fb->tree, missing tree-less frame_bufs entirely.

Add Step 5: match tree-less frame_bufs whose scene_buf node is a
direct child of a level_tree bucket. This resolves clicks on WINGs
modal dialogs (Run dialog, info panels, etc.).
2026-05-23 13:37:11 +02:00
lkn 8fb4083416 fix: titlebar buttons not responding to clicks on Wayland
frame_buf_button_at() used fb->scene_buf->buffer as the filter to
distinguish invisible button sub-windows from visible titlebar/resizebar
nodes. But wlr_scene_buffer_create() sets an initial buffer reference,
so scene_buf->buffer was never NULL for buttons — causing the hit-test
to skip all of them.

The correct distinguisher is node.enabled: buttons have their scene
node disabled (they are composited into the titlebar buffer by
wl_frame_paint_button), while titlebars/resizebars have enabled nodes.
2026-05-23 13:31:44 +02:00
lkn 57a6497137 B1: fix appicon_show for Wayland (was no-op, icons never placed)
The Wayland backend already had full wl_appicon_paint and wl_icon_paint
implementations (tile + image composite + text + scene commit), but
appicon_show was a no-op stub. This meant app icons were never initially
placed or mapped when applications launched.

Fix: wl_appicon_show now calls paint_app_icon() (pure policy code that
handles PlaceIcon + wAppIconMove + wLowerFrame + window_map via vtable),
identical to the X11 backend.

Also mark A7 (placement) as verified — pure policy, zero backend calls.
2026-05-23 13:29:12 +02:00
lkn 1e4caddb9f docs: mark A4 workspace switching as complete 2026-05-23 13:25:38 +02:00
lkn de0300d0fe A4: workspace switching badge for Wayland backend
Workspace switching (map/unmap) already worked via the vtable.
This commit adds the workspace name badge overlay:

- Create badge frame_buf in WL_LAYER_OVERLAY during screen init
- Implement wl_workspace_badge_render (pixman text rendering)
- Implement wl_workspace_badge_update (scene buffer refresh)
- Add workspace_badge_get_background vtable slot
- X11 backend: captures root window background (RGetXImage)
- Wayland backend: returns solid dark background
- workspace.c: replace direct RGetXImage/RCreateImageFromXImage
  with vtable call (zero backend guards in policy code)
2026-05-23 13:24:58 +02:00