Commit Graph

319 Commits

Author SHA1 Message Date
Ollie ae980e66e9 fix: resize wireframe animation on Wayland (overlay flush per draw)
The overlay drawing functions (wl_overlay_draw_rect, wl_overlay_draw_line) write XOR pixels to a client-side pixman buffer but never flushed it to the scene graph. On X11, each XDrawRectangle is immediately processed server-side, so the wireframe appears in real-time. On Wayland, the overlay buffer was only flushed in wl_server_ungrab() at the END of the resize operation. Added overlay_flush() after each draw call so each XOR batch is pushed to wlr_scene_buf and rendered immediately.
2026-05-30 11:41:48 +02:00
Ollie 1bf64c26c9 fix: resize/move indicator (gview) not updating on Wayland
Two bugs in geomview.c: (1) Missing backing commit on Wayland - paint() wrote to pixman backing but never pushed to scene graph. Added W_RedisplayView() after paint() in both WSetGeometryViewShownPosition and WSetGeometryViewShownSize. (2) Expose event handler used case Expose: (X11 constant value 12) instead of case WME_EXPOSE: (WINGs enum value 8) - harmless on X11 where Pixmap content is server-persistent, but broke Wayland where the expose handler is the re-draw mechanism after wl_redisplay fills the backing with bg color.
2026-05-30 11:37:51 +02:00
Window Maker fd6e972bbf wl_backend: fix W_ViewSceneNodeSetEnabledFn never wired — gview scene buffer stayed on after unmap
The blue position indicator (gview — geometry view with blue-gray background,
white coordinate text) was visible during window move, but never disappeared
when the move ended.

Root cause: W_ViewSceneNodeSetEnabledFn was declared in wview_wl.c and
called by wl_unmap() to disable the view's scene buffer node, but
wl_backend.c never wired it up — the pointer was NULL.

Also: add auto-create of frame_buf for WINGs toplevel views not explicitly
reparented (switch panel, menus, gview), sync position from WINGs view on
commit, auto-realize children in wl_map/wl_map_subviews, and guard scene
node enablement against unmapped views.
2026-05-30 11:17:10 +02:00
Ollie 39ba8d6794 wl_backend: fix cursor reverting to arrow during opaque window drag 2026-05-30 09:07:57 +02:00
Ollie da9a62bf23 wl_backend: cursor reset only on pointer leave (no enter reset) — fixes move cursor, no I-beam leak 2026-05-29 17:19:14 +02:00
Ollie fd7a760ce3 wl_backend: restore cursor reset on enter/leave with grab guard — fixes stuck cursor 2026-05-29 17:12:39 +02:00
Ollie 1fed9a1a3e wl_backend: stop resetting cursor on pointer leave too — let cursor stay during appicon drags 2026-05-29 17:10:35 +02:00
Ollie 26ea32a28b wl_backend: reset cursor to left_ptr on ungrab — same logic as dock/clip drags 2026-05-29 17:09:11 +02:00
Ollie 7fcfb0870d wl_backend: stop resetting cursor to left_ptr on every surface enter — let clients set their own cursor 2026-05-29 08:39:36 +02:00
Ollie 9592cf295e wl_backend: guard cursor reset in wl_update_pointer_focus during grabs; add WCUR_WAIT 2026-05-29 08:38:07 +02:00
Ollie c5a90f4c9c debug: wl_set_cursor_image trace to find what resets cursor during grab 2026-05-29 08:35:38 +02:00
Ollie 87ed6976a5 wl_backend: use correct cursor in wl_pointer_grab (not always left_ptr) 2026-05-29 08:26:28 +02:00
Ollie 2577050f44 wl_backend: implement pointer_change_grab — update cursor during move/resize 2026-05-29 08:00:28 +02:00
Ollie 8a4e3954a0 wl_backend: implement client_snapshot via buffer read (XWayland: XGetImage, native: wlr_buffer) 2026-05-28 22:56:39 +02:00
Ollie 0642bcb92c xwayland: eager mode (start at init, not on first X11 client) — eliminates 3-5s lag 2026-05-28 22:43:39 +02:00
Ollie a721f1333a wl_backend: display_get_name returns XWayland display instead of wayland-0 (fixes X11 child DISPLAY) 2026-05-28 22:40:23 +02:00
Ollie 8a9e400fd5 session: remove debug prints from wl_prop_get_wm_class 2026-05-28 22:36:06 +02:00
Ollie a117a9e437 session: debug prints in wl_prop_get_wm_class to diagnose xterm save failure 2026-05-28 22:34:36 +02:00
Ollie 0a03ff03d7 wl_backend: fix prop_get_wm_class return value (0=fail, 1=success) — broke session save 2026-05-28 22:18:37 +02:00
Ollie 0abaf1fefa session: save/restore window state for Wayland native clients (match by app_id) 2026-05-28 22:14:32 +02:00
Ollie 1bcd815001 clipboard: make store idempotent to avoid re-init of in-use data source 2026-05-28 21:32:10 +02:00
Ollie adf79141b2 dnd: cross-client motion/drop handler with MIME type routing 2026-05-28 20:29:26 +02:00
Ollie 39b63a8184 DND: compositor-internal drag icon overlay + cursor feedback + cross-client wiring 2026-05-28 19:35:41 +02:00
Window Maker b714cb783d x11: fix menu rendering, balloon tooltips, clip arrows, and event handling
Menu entry painting:
- Add drawFrame() calls for 3D beveled entries (WTEX_SOLID)
- Add menu_text_clearance to text Y positioning
- Add left-side indicator drawing (radio/check/snap pixmaps)
- Add indicator X offset (MENU_INDICATOR_SPACE)
- Fix disabled+selected text color
- Fix texture-aware background clearing
- Add cascade arrow for submenu entries

Balloon tooltips:
- Implement x11_balloon_show() with text and mini-preview rendering
- Previously was a no-op stub

Clip arrows:
- Draw workspace-switching triangles on clip icon
- Previously stubbed out

Event handling:
- Add MapRequest, ConfigureRequest, ReparentNotify translation to
  xev_to_wme() in WINGs/wevent_x11.c
- These WM-critical events were silently dropped, preventing new X
  clients (e.g. xterm) from being managed
2026-05-25 17:04:30 +02:00
Window Maker fe2ec1fb9e wayland: pump client display in main loop for close button support
In-process WINGs clients have their own wl_display connection that
needs to be dispatched for xdg_toplevel.close to be received. Add
W_WLClientDispatchPending() and call it each main loop iteration
so protocol events reach the client-side handlers promptly.
2026-05-25 13:32:59 +02:00
Window Maker 94157394d7 wayland: fix close button for WINGs clients by flushing after send_close 2026-05-25 13:31:38 +02:00
Window Maker d5bc733842 wayland: directly synthesize close event for in-process WINGs clients
The xdg_toplevel.close protocol message requires the client to dispatch
its wl_display, but in-process WINGs clients may not do so promptly.
Directly enqueue the WME_CLIENT_MESSAGE/deleteWindowAtom event from
wl_client_close so the closeAction fires on the next WINGs event drain.
2026-05-25 13:05:42 +02:00
Window Maker 4442380d50 wayland: derive menu colors from appearance preferences
Menu background colors were hardcoded. Now uses:
- scr->select_color for selected item background
- scr->menu_item_texture->normal for unselected background
- scr->menu_item_texture->dim/light/dark for cascade arrow

Text colors already used scr->select_text_color, mtext_color, dtext_color.
2026-05-25 13:01:14 +02:00
Window Maker 40295223c6 wayland: match X11 cascade arrow style with 3D shaded lines
Replace the filled triangle with three lines matching the upstream X11
implementation: a dim top edge, light bottom edge, and dark left edge,
forming a 3D right-pointing triangle indicator for submenu entries.
2026-05-25 12:59:35 +02:00
Window Maker 95c4101ed3 wayland: fix submenu cascade arrow to point right
The triangle was drawn with increasing width from left to right,
making it point left. Reverse the vertical span so the widest part
is on the left and it tapers to a point on the right.
2026-05-25 12:58:39 +02:00
Window Maker b79f699a35 wayland: call W_CheckTimerHandlers in event loop for workspace fade
WINGs timers (used by workspace name fade animation) were never firing
because the compositor event loop never called W_CheckTimerHandlers.
This function is normally invoked by WMNextEvent, but the compositor
uses a custom loop. Add the call so timers fire each iteration.
2026-05-25 12:57:12 +02:00
Window Maker 7ea6a7ac88 wayland: workspace name badge with transparent background and fade
The workspace name display was rendering with an opaque black background
and never fading out. Fix by:
- Using transparent (alpha=0) background instead of black
- Returning RGBA images from badge_render and badge_get_background
- Preserving alpha channel in badge_update instead of hardcoding 0xFF

This allows the fade animation (RCombineImagesWithOpaqueness) to work
correctly, blending text with decreasing opacity over a transparent
background until the badge disappears.
2026-05-25 12:55:38 +02:00
Window Maker 172e226947 wayland: fix NULL dereference in wl_pointer_query_full
wWorkspaceForceChange passes NULL for root_x/root_y when it only needs
the child window. Add NULL checks before dereferencing these pointers.
2026-05-25 12:51:47 +02:00
Window Maker f1ded24294 WPrefs/wayland: fix icon preview one-click-behind with extra dispatch
WINGs button callbacks trigger wl_redisplay which commits the client
surface, but the compositor only processes that commit on the next
wl_event_loop_dispatch. Add a zero-timeout dispatch after handling
WINGs events so client commits are processed immediately, making
the next scheduled frame render the updated content.

Also revert posF redisplay back to posVF (posF caused gray flash).
2026-05-25 12:49:00 +02:00
Window Maker 69db74b3a6 wayland: fix frame pacing regression, schedule frame after dispatch
The extra wlr_scene_output_commit broke frame pacing in nested mode by
consuming the host frame callback. Instead, move wlr_output_schedule_frame
to after wl_event_loop_dispatch so client commits processed during
dispatch are rendered on the next frame event.
2026-05-25 12:45:25 +02:00
Window Maker ee434b024a wayland: commit scene after dispatch to fix one-frame-behind rendering
Client surface commits arrive during wl_event_loop_dispatch but may be
processed after the frame event has already rendered the old state. Add
an additional wlr_scene_output_commit after dispatch to immediately
pick up any new client content, fixing the one-interaction-behind
visual update issue in WINGs clients like WPrefs.
2026-05-25 12:43:55 +02:00
Window Maker b94bc2ce95 WPrefs: drop SIGUSR2, rely on inotify for defaults reload
SIGUSR2 is fundamentally unsafe in a multi-threaded compositor: library
threads (pango fontconfig) created after pthread_sigmask receive the
signal and crash. The Wayland event loop already has inotify watching
the defaults directory, so file changes are detected automatically
without any explicit signaling.

The early pthread_sigmask(SIG_BLOCK, SIGUSR2) is retained as a safety
measure to prevent stray SIGUSR2 from terminating the compositor.
2026-05-25 12:02:26 +02:00
Window Maker d8592f3b57 wayland: block SIGUSR2 early so library threads inherit the mask
SIGUSR2 was being delivered to pango fontconfig threads instead of the
signalfd because those threads were created before the signal mask was
set in wl_event_loop_run. Block SIGUSR2 at the very start of real_main
so all threads (including library-spawned ones) inherit the blocked
mask and the signalfd is the sole recipient.
2026-05-25 12:00:13 +02:00
Window Maker 8630a5ce95 wayland: handle SIGUSR2 via signalfd to reload defaults without dying
SIGUSR2 was not in the signalfd set, so it was delivered asynchronously
to the old signal handler which set WSTATE_NEED_REREAD. But the Wayland
event loop never checked that state flag, and the signal delivery itself
could crash the compositor.

Add SIGUSR2 to the signalfd set and handle it synchronously within the
event loop by calling wDefaultsCheckDomains directly.
2026-05-25 11:58:14 +02:00
Window Maker 9dee4f7a65 WPrefs: fix SIGUSR2 targeting wmaker instead of parent shell
The previous getppid() approach sent SIGUSR2 to the terminal process
(foot) rather than wmaker, killing the shell. Now wmaker exports
WMAKER_PID at startup and wl_send_wm_command reads it to signal the
correct process.
2026-05-25 11:55:14 +02:00
Window Maker 9a4438fb65 cursor: respect XCURSOR_THEME and XCURSOR_SIZE environment variables
The xcursor manager was hardcoded to NULL theme with size 24. Now reads
XCURSOR_THEME and XCURSOR_SIZE from the environment, matching the
behavior of other Wayland compositors like Sway.
2026-05-25 11:48:23 +02:00
Window Maker 703872bcca xwayland: route keyboard events via wlr_seat_keyboard_notify_enter
The XWayland focus path only called wlr_xwayland_surface_activate (X11
focus) but did not notify the wlr_seat about keyboard focus. Without
wlr_seat_keyboard_notify_enter, key events were never forwarded to the
XWayland surface via the Wayland transport.

Now wl_focus_set for XWayland surfaces sets the seat keyboard and calls
wlr_seat_keyboard_notify_enter, matching the XDG toplevel path.
2026-05-25 11:45:47 +02:00
Window Maker 5bff28efcd xwayland: fix rendering by switching from map_request to associate+surface.map
The map_request signal was never firing for managed XWayland surfaces,
preventing scene node creation and window management. Switch to the
standard wlroots 0.19 lifecycle: listen for associate (surface attached),
then hook surface->events.map (content committed) before creating the
scene node and calling wManageWindow.

Also fix wl_window_get_client_attrs to report VIEWABLE based on surface
existence rather than surface->mapped, since X11 geometry (xw->width/height)
is available before the wlr_surface maps.
2026-05-25 11:43:18 +02:00
Window Maker 9bb2d02254 debug: trace xwayland scene node creation 2026-05-25 10:35:07 +02:00
Window Maker b67d3a04fb wl_backend: send 640x480 configure for xwayland surfaces with tiny initial size
xterm starts with a 10x17 pixel window. The initial configure was
sending that size back (since > 0), so xterm rendered at 10x17.
Now use 640x480 default when the initial size is < 64px.
2026-05-25 10:33:18 +02:00
Window Maker d4d5240426 wl_backend: raise xwayland minimum size threshold to 64px
xterm's initial xw_surface size is 10x17 which passed the > 1 check.
Use >= 64 as the threshold for falling back to 640x480 default.
2026-05-25 10:09:49 +02:00
Window Maker 1733e3449c wl_backend: use map_request signal instead of associate for xwayland
The associate signal fires when a wlr_surface is linked to the
xwayland surface, but this can happen before or during new_surface
processing. map_request fires when the X11 client actually sends
MapRequest — at which point WM_CLASS is set and the client is ready
to be managed and shown.
2026-05-25 09:53:19 +02:00
Window Maker 72a592a402 wl_backend: handle already-associated xwayland surfaces
If the xwayland surface already has a wlr_surface when we register
listeners (associate event already fired), trigger the map handler
directly. This fixes xterm and other X11 clients that associate
their surface before the new_surface handler runs.
2026-05-25 09:48:42 +02:00
Window Maker 044a5b3486 wl_backend: use minimum 640x480 for xwayland surfaces with tiny initial size
xterm and other X11 clients create a small initial window then resize.
At map time, xw_surface->width/height may still be the initial tiny
value (e.g. 10x17). wManageWindow reads this and creates a tiny frame.
Use 640x480 as fallback when width/height <= 1.
2026-05-25 09:13:42 +02:00
Window Maker c243ac22ab wl_backend: don't skip XWayland surfaces without initial class/title
X11 clients (like xterm) create their window first, then set WM_CLASS
before mapping. The previous code skipped surfaces that had no class
AND no title at new_surface time, marking them override_redirect. This
prevented xterm and other well-behaved X11 apps from ever being managed.

Fix: log a warning but continue registering listeners. The surface will
be managed when it maps (associate signal) at which point WM_CLASS is
typically set.
2026-05-25 09:06:25 +02:00