- wl_map: set mapped=1 before calling wl_redisplay (was bailing because
mapped flag wasn't set yet)
- wl_view_commit_backing_impl: enable scene node when content is committed
(frame_buf was created disabled, never enabled before frame was mapped)
- fake_leader_create: return a real frame_buf ID (was returning 0)
- client_reparent: handle frame_buf-to-frame_buf reparenting
- client_reparent: get WINGs view size from view table
- window_map: enable grandchildren (dialog content is grandchild of frame)
- window_move: move grandchildren when parent moves
- dialog.c: guard scr->w_visual for Wayland mode in Info panel
All WINGs render backend functions (draw_line, draw_rect, fill_rect,
pixmap_copy, composite_pixmap) now use resolve_drawable() to handle
WINGs view IDs (0x20000000+) by looking up the backing pixman image.
Also fixes:
- wfont_wl.c: resolve view IDs in draw_string/draw_image_string
- wtextfield.c paintCursor: use render backend draw_line (not XDrawLine)
- dialog.c wShowInfoPanel: guard scr->w_visual for Wayland mode
- wl_client_reparent: create child frame_buf for WINGs views, connect
backing pixman image so widgets paint into the scene graph
- View lookup table: map synthetic IDs to W_View* for event dispatch
- render_wl_pixmap_copy: detect view IDs and copy into backing image
- W_ViewCommitBacking callback: commit frame_buf after WINGs paint
- WMHandleEvent: use view table in Wayland mode (was always NULL)
- wtextfield.c paintCursor: use render backend draw_line instead of
XDrawLine (crash fix for Run dialog)
- wl_draw_string: remove ascent subtraction, y is TOP position (matches
X11 Pango behavior where pango_xft_render_layout takes top-left)
- Menu entry text: pass top position (y+3) not baseline (y+3+fh-1)
- Icon title: pass y=0 (top) not y=fh (baseline)
- frame_paint_titlebar: pass centered top not baseline
- frame_configure: compute absolute position from parent for children
(was setting absolute pos to relative coords, warping to 0,0)
- Titlebar buffer: always render full frame width, resize if needed
- Frame scene node: disable when no resizebar (transparent, not needed)
- Always call frame_paint after show/hide button (TS_NEW was skipping it)
wFrameWindowShowButton was only calling updateTitlebar (not frame_paint)
when new_style==TS_NEW. Now always calls frame_paint so the close button
icon is rendered into the frame buffer after pinning a menu.
frame_buf_at was returning the parent frame instead of child windows
(titlebar, content area) because the parent was later in the list.
Now prefers children (frame_bufs with parent_id set) over parents.
This fixes menu titlebar click detection — clicking the titlebar now
dispatches to titlebarMouseDown/menuTitleMouseDown instead of
menuMouseDown, enabling menu pinning and drag-to-move.
On SIGINT/SIGTERM:
- signalfd handler sets terminate flag and exits the event loop
- After loop exit, remove wlroots pointer listeners to prevent
assertion failure in wlr_pointer_finish
- Reset SIGTERM/SIGINT/SIGHUP to SIG_DFL after signalfd takes over
to prevent the old handleExitSig from competing
handleKeyPress passed event->_x11_raw (NULL in Wayland mode) to
wRootMenuPerformShortcut which dereferences it immediately. Skip
the call when _x11_raw is NULL.
When a menu entry triggers a WINGs dialog (e.g. 'Run...'), the
realizeObserver notification calls realizeWindow which does X11 calls
(XSetClassHint, XAllocWMHints). In Wayland mode scr->display is NULL,
causing a segfault. Skip the entire function when display is NULL.
pointer_get_position was a noop returning (0,0), causing findMenu to
always return NULL. This made the menu close on every button release
regardless of pointer position. Now returns wl_state.pointer_x/y which
are updated on every pointer motion event.
With this fix, the root menu stays open when the pointer is over it on
release (matching X11 behavior), allowing entry selection or titlebar
pinning.
findMenu was returning y relative to the frame top (including titlebar).
getEntryAt expects y relative to the content area. Subtracting top_width
means pointer in titlebar gives y<0 → entry_no=-1 (no selection), which
is correct behavior matching the X11 path.
Add wl_frame_paint_button which renders button icons from XPM data
into the parent frame buffer. Called both from the vtable slot and
from wl_frame_paint during titlebar rendering. Uses PRED_CLOSE_XPM
and PRED_ICONIFY_XPM parsed lazily via RGetImageFromXPMData.
Also removes XEvent from all WFrameWindow callbacks (on_click_left,
on_click_right, on_dblclick_right, on_mousedown_resizebar) — they
now take WMEvent*.
wl_window_unmap now disables child scene nodes when the parent is
hidden. This fixes the menu entries staying visible after the menu
frame (titlebar) was unmapped. The entire menu now disappears
together, matching X11 behavior where the brother menu closes on
button release.
The root menu uses a 'brother' copy for the live instance. findMenu
was only checking the original, not the brother, so it returned NULL
when the pointer was over the active menu copy. This caused the menu
to close immediately on button release (closeCascade triggered by
!smenu condition).
All WFrameWindow callbacks (on_mousedown_titlebar, on_dblclick_titlebar,
on_mousedown_resizebar, on_click_left, on_click_right, on_dblclick_right)
now take WMEvent* instead of XEvent*. This fixes the crash when clicking
the menu titlebar in Wayland mode (_x11_raw was NULL).
Affected files: framewin.h, framewin.c, menu.c, window.c, dialog.c,
winspector.c. All verified X11-free with nm.
findMenu always returned NULL because the refactored code set win=0
then checked 'if (win == None) return NULL'. Replace with geometric
bounds checking against mapped menus. This fixes the menu disappearing
on button release (closeCascade was called because smenu was NULL).
The menu frame was created at 1x1 and resized via wFrameWindowResize
which calls window_resize. But wl_window_resize didn't handle
frame_bufs — it only handled toplevel views. Now it reallocates the
pixman image when dimensions change, so the frame has the correct
size when wl_frame_paint renders the title bar.
- Entry separators: light line on top, dark line on bottom between entries
- Left/right bevel edges on each entry
- Cascade arrow (triangle) for submenu entries
- Paint menu frame title bar (wl_frame_paint) when menu is shown
- Matches X11 menu_draw_frame behavior
All dock/clip/appicon mouse handlers now use WMEvent directly:
- openDockMenu, iconDblClick, handleDockMove, handleClipChangeWorkspace
- wHandleAppIconMove (appicon.c)
- Removed x11_translate_event hack in dock menu forwarding
- dock.o and appicon.o verified X11-free with nm
In X11, child windows are only visible when the parent is mapped.
In Wayland, all frame_bufs are independent scene nodes. The menu
content window was being mapped at creation time (wMenuCreate),
making it visible even though the parent frame was offscreen/hidden.
Fix: wl_window_map skips enabling a child node if its parent's
scene node is not yet enabled.
Child windows (menu content area, titlebar, resizebar) need their own
pixman buffers for painting. Previously frame_create_child returned a
bare synthetic ID with no buffer, so menu_paint_entry found nothing.
Also add parent-child tracking: when a parent frame moves or maps,
all children are repositioned/enabled automatically. Children store
their relative offset and parent ID.
In X11, mapping a window triggers Expose which causes repainting.
In Wayland there are no Expose events, so wMenuPaint must be called
explicitly after the menu is mapped in wMenuMapAt.
The deadlock: frame_timer_cb called WMHandleEvent which entered
menuMouseDown's modal WMMaskEvent loop. That blocked inside
wl_event_loop_dispatch (reentrant), preventing new events.
Fix:
1. Replace wl_display_run() with custom loop that drains WINGs
events BETWEEN wl_event_loop_dispatch calls (not inside timer)
2. Make WINGs wl_flush() pump wlroots (call dispatch_fn) so
WMMaskEvent modal loops get new events without reentrancy
3. Fix wBalloonHide NULL dereference (scr->balloon not allocated)
4. Remove XEvent dependency from wSelectWindows (takes x,y now)
5. Remove debug traces
Right-click on background now opens the root menu.
- frame_buf_at(): hit-test finds which WM frame_buf is under pointer
- Button/motion events set window field to frame_buf ID or root_win
- Root window gets synthetic ID (0x0FFFFFFF) in Wayland mode
- Right-click on background → handleButtonPress → OpenRootMenu path
- wSelectWindows: remove XEvent dependency, take (x, y) coordinates
- Zero X11 symbols in event.o and moveres.o (verified with nm)
Text rendering uses the existing WINGs PangoFT2 backend — WMDrawString
renders directly into the frame buffer's pixman_image_t.
- Menu entries: real text via PangoFT2 (entry text + shortcut labels)
- Dock/clip icon titles: rendered with icon_title_font
- Frame titlebar: solid background + centered title text
- Frame resizebar: beveled grey bar
All text is anti-aliased (PangoFT2 alpha compositing onto pixman).
- Clip/drawer icons: reuse wl_appicon_paint (tile rendering)
- Menu entries: solid background fill (grey normal, blue selected)
with placeholder text line. Full text rendering TODO.
- Menu frame: beveled border (light top/left, dark bottom/right)
- All rendering commits to scene graph via wlr_scene_buffer_set_buffer
XWayland was started eagerly (at compositor init) which caused a
segfault when XWayland couldn't connect back to the Wayland socket
(race condition in nested mode). Since the WM UI is now pure Wayland
(no X11 rendering), XWayland is only needed for X11 client apps.
Switch to lazy mode: XWayland starts only when the first X11 client
connects. This eliminates the startup wait loop and the associated
crash. Also set xwayland_ready=true in the server destroy handler
as a safety net.
wraster.h is generated from wraster.h.in — the declaration was only
in the generated file, not the template. Also includes the Wayland
no-op for RConvertImage/RConvertImageMask (context->dpy == NULL).
- wl_appicon_paint: renders dock icons by compositing the icon tile
(RImage) with the app image, then blitting RGBA→ARGB32 into the
frame buffer's pixman image and committing to the scene graph.
- Color parser: add grayNN/greyNN pattern support (gray0-gray100)
and rgb:RR/GG/BB X11 color format. All default textures now parse.
- Dock paint trigger: add explicit dockIconPaint calls at end of
wDockCreate and wDockRestoreState since Wayland has no Expose
events on window map.
The dock icon tile is now visible in the compositor window.
Three root causes fixed:
1. RCreateContext crash: wScreenInit called RCreateContext(dpy=NULL).
Fix: add RCreateContextWayland() to wrlib — creates a minimal 32-bit
ARGB context without X11. Wayland path in screen.c now always taken
when is_wayland (removed incorrect XWayland fallthrough).
2. Color parsing: parse_color and get_color_for_colormap were no-ops.
Fix: implement real color parser in wl_backend supporting #RGB,
#RRGGBB, #RRRRGGGGBBBB, rgb:RR/GG/BB, and common named colors.
Texture creation (solid, gradient) now works in Wayland mode.
3. RConvertImage crash: wrlib tried XCreateImage with NULL display.
Fix: RConvertImage/RConvertImageMask return success with pixmap=0
when context->dpy is NULL. Callers don't use pixmaps in Wayland
mode (rendering goes through vtable slots to pixman buffers).
4. Workspace crash: Wayland path skipped wWorkspaceNew(), so
workspace_count=0 when menu tried to access workspace entries.
Fix: add wWorkspaceNew + netwm_init to Wayland screen init path.
Result: compositor starts, event loop runs, window is visible.
WMAKER_USE_WAYLAND=1 wmaker now shows a compositor window.
- wmspec.c, xdnd.c, xmodifier.c: pure X11 mechanism code now compiled
as part of x11_backend.o (included via #include in x11_backend.c).
Removed from main link (Makefile modified).
- Policy file calls to NETWM/XDND functions replaced with vtable dispatch:
netwm_process_client_message, xdnd_process_client_message,
xdnd_process_selection, xdnd_make_awareness,
netwm_check_client_hint_change, netwm_position_splash,
netwm_check_initial_frame_state
- x11_prop_get_check_property now returns wfree-able memory (callers
use wfree instead of XFree)
RESULT: nm -u *.o | grep ' U X' returns ZERO for all non-backend .o files.
The backend abstraction is architecturally complete.
- motif.c: wGetMWMHints moved entirely to x11_backend.c (inlined into
x11_motif_get_hints)
- colormap.c: wColormapInstallForWindow inlined into x11_colormap_install;
policy file now contains only vtable dispatch stubs
- resources.c: wGetColorForColormap and wFreeColor now dispatch through
vtable; X11 implementation inlined into x11_backend.c
- xmodifier.c: wXModifierInitialize now called from x11_extensions_init
(removed from main.c)
motif.o, colormap.o, resources.o verified X11-free with nm.
xmodifier.o retains X11 symbols (mechanism code, only reached through
X11 backend — candidate for physical move to backend/ directory).