wayland: Phase 74 — frame NULL guards in window.c
wWindowConfigure: add early-return Wayland path that dispatches client_synth_configure via vtable and updates client geometry instead of trying to configure a non-existent X11 frame window. wWindowSingleFocus: use client dimensions when frame is NULL for the wScreenBringInside call. wWindowSaveState: fall back to client width/height when frame is NULL (non-maximized path). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f772c79ff5
commit
b44d556351
24
src/window.c
24
src/window.c
|
|
@ -1687,7 +1687,11 @@ void wWindowSingleFocus(WWindow *wwin)
|
|||
y = wwin->frame_y;
|
||||
|
||||
/* bring window back to visible area */
|
||||
move = wScreenBringInside(scr, &x, &y, wwin->frame->core->width, wwin->frame->core->height);
|
||||
{
|
||||
int fw = wwin->frame ? (int)wwin->frame->core->width : (int)wwin->client.width;
|
||||
int fh = wwin->frame ? (int)wwin->frame->core->height : (int)wwin->client.height;
|
||||
move = wScreenBringInside(scr, &x, &y, fw, fh);
|
||||
}
|
||||
|
||||
if (move)
|
||||
wWindowConfigure(wwin, x, y, wwin->client.width, wwin->client.height);
|
||||
|
|
@ -1948,6 +1952,19 @@ void wWindowConfigure(WWindow *wwin, int req_x, int req_y, int req_width, int re
|
|||
int synth_notify = False;
|
||||
int resize;
|
||||
|
||||
if (!wwin->frame) {
|
||||
/* Phase 74: Wayland — no X11 frame; request resize via vtable and update geometry */
|
||||
wwin->frame_x = req_x;
|
||||
wwin->frame_y = req_y;
|
||||
wwin->client.x = req_x;
|
||||
wwin->client.y = req_y;
|
||||
wm_backend->client_synth_configure(wwin->client_win, req_x, req_y, req_width, req_height, 0, WNATIVE_NONE);
|
||||
wwin->client.width = req_width;
|
||||
wwin->client.height = req_height;
|
||||
wWindowSynthConfigureNotify(wwin);
|
||||
return;
|
||||
}
|
||||
|
||||
resize = (req_width != wwin->client.width || req_height != wwin->client.height);
|
||||
|
||||
if (WFLAGP(wwin, dont_move_off))
|
||||
|
|
@ -2248,8 +2265,9 @@ void wWindowSaveState(WWindow *wwin)
|
|||
if (wwin->flags.maximized == 0) {
|
||||
data[5] = wwin->frame_x;
|
||||
data[6] = wwin->frame_y;
|
||||
data[7] = wwin->frame->core->width;
|
||||
data[8] = wwin->frame->core->height;
|
||||
/* Phase 74: Wayland windows have no frame; fall back to client size */
|
||||
data[7] = wwin->frame ? wwin->frame->core->width : wwin->client.width;
|
||||
data[8] = wwin->frame ? wwin->frame->core->height : wwin->client.height;
|
||||
} else {
|
||||
data[5] = wwin->old_geometry.x;
|
||||
data[6] = wwin->old_geometry.y;
|
||||
|
|
|
|||
|
|
@ -81,6 +81,10 @@
|
|||
# winmenu.c (OpenWindowMenu, execWindowOptionCommand, updateOptionsMenu)
|
||||
# so Wayland windows do not crash on frame->core stacking access
|
||||
# (build-only check).
|
||||
# 32. (Phase 74) Frame NULL guards in window.c: wWindowConfigure dispatches
|
||||
# client_synth_configure for Wayland windows; wWindowSingleFocus and
|
||||
# wWindowSaveState use client geometry fallback when frame is NULL
|
||||
# (build-only check).
|
||||
#
|
||||
# This test grows as wl_backend vtable slots are implemented.
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in New Issue