From 4ce902f94800a00b2b39de91ed61d0c5b32db271 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 24 Nov 2026 12:23:00 -0300 Subject: gui: a window's size is its own view's: the session's window posts it to its own view, compared with that view, and a client window posts it when its own size changes, compared with what it posted last, never with a frame: the user's "resizing feels very slow" and "contents cut" with several clients (2026-11-24); RUN FIRST (an instrumented client in --client-resize-real, a stack at each frame of another size): the client drew its own view (views.drawOne, its view live) at the SESSION WINDOW's size, 70x21 in a 56x17 window: the session's pollFrame made its own view live only when that view's size differed from the window's (`due`), then resized the LIVE view by the window (updateCoreResize compares core.view()): after a client's input its view is live, so the session window sized the client's view to its own; the client, comparing its window with that frame (Client.own, g.facts), posted its own size again, the session sized it back, a unit and a rollback each way, on and on after the drag ended (the hunt: 246 to 1308 inputs, 228 rollbacks for 30 sizes, the frames cut, pictures placed past the target: the scissor assertion); a detached session has no window to do it (25 inputs); now the window's size (windowSize: its cells, their pixels, its rows' metrics, as Event.resize carries them) goes to the session's own view through Input.post (which makes that view live), when that view is not that size (sizedTo); updateCoreResize is gone, and the font's two refits post nothing (the pump's pollFrame posts the new cells the same pump); a client posts its size when the window's own size differs from what it posted last (`posted`, reset at a join), never by a frame (a frame is its view as the session had it then: a rollback's drew an older size); a terminal client posts its size on SIGWINCH against its last (winched), the same rule already; --client-resize-real asserts a size a configure at most and as many rollbacks at most: 20 inputs besides 11 pointer motions, 15 rollbacks, 0 assertions (main 425 to 1308 inputs, 228 rollbacks; with the motions merged alone 90 and 106 inputs); real windows on the user's display, moved away at once, closed after; load 3.3 Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/daemon.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/daemon.py b/test/daemon.py index 9c846369..06458ff4 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -54,7 +54,7 @@ private HOME and runtime directory: python3 -B test/daemon.py --client-resize-real a client window showing a PDF resized 30 times in a second by the real compositor (driftwm), the caller's display: no SDL assertion, - the last size taken, a few inputs a size + the last size taken, an input a size at most """ import fcntl import json @@ -2285,7 +2285,11 @@ def client_resize_real(binary, gui_binary): is drawn into placed the page's scissor past it: `SDL_SetGPUScissor`'s release assertion, whose dialog blocks the window's thread: the window frozen at its old size, cut, and nothing opened after shows in it), it - takes the last size, and its inputs are a few a size. Real windows: the + takes the last size, it posts a size a configure at most and is rolled + back as often at most (on main the session's own window sized the + client's view to its own size, the client posted its own again, on and + on: 425 to 1308 inputs, 228 rollbacks, its frames drawn at the session + window's size, cut). Real windows: the caller's display and runtime directory reach the compositor; the session's runtime directory is the test's own; skipped without driftwm.""" real_runtime = os.environ.get('XDG_RUNTIME_DIR', '') @@ -2377,11 +2381,16 @@ def client_resize_real(binary, gui_binary): # moved away) is motion's, --client-motion's: not counted here. motions = said.count('SDL_EVENT_MOUSE_MOTION') sent -= motions + # Its own inputs rolled back by the session's units between them. + rollbacks = int(line[line.index('foreign') + 1]) if 'foreign' in line else -1 print(f'daemon: a client window resized {steps} times in a second by the compositor: {asserted} SDL assertions, ' - f'its size {size} (asked {list(last)}), {sent} inputs besides {motions} pointer motions') + f'its size {size} (asked {list(last)}), {sent} inputs besides {motions} pointer motions, {rollbacks} rollbacks') assert asserted == 0, ('a client window drew past its target while resized', said[-600:]) assert abs(size[0] - last[0]) <= 2 and abs(size[1] - last[1]) <= 40, ('the client window did not take the last size', size, last) - assert 0 < sent <= 3 * steps, ('a client window resized posted its size again and again', sent) + # A size a configure at most (the window's own, compared with what it + # posted last: none after the last). + assert sent <= steps, ('a client window resized posted its size again and again', sent) + assert 0 <= rollbacks <= steps + motions, ('a client window resized was rolled back again and again', rollbacks) exit_session(nine, pane) sess.wait(timeout=60) nine.socket.close() -- cgit v1.3