win32 companion: floating dock panes get the size/move pause handling

Follow-up to 6c0cedc945. A floating pane is its own top-level window
with its own wndproc, so dragging or sizing one ran the same modal loop
with none of the handling: video froze stale and audio underran for the
length of the drag. Route WM_ENTER/EXITSIZEMOVE, WM_ENTER/EXITMENULOOP,
WM_TIMER, WM_CLOSE and WM_DESTROY to the same four win32_sizemove_*
functions. On WM_EXITSIZEMOVE the pause is ended before the drop is
applied, since docking the pane can destroy the floating window.

Checked: tools/mingw_syntax_check.sh, tools/companion_win32_test.sh
under Wine. Windows hardware: drag a floating pane over the companion
and drop it docked, and drop it floating; both with the main window's
video visible.
This commit is contained in:
libretroadmin committed 2026-09-10 00:26:31 +02:00
1 parent 6c0cedc945
commit 8d67323a80
1 file changed
+21
+21
View File
@@ -1945,11 +1945,32 @@ static LRESULT CALLBACK cw_float_wndproc(HWND hwnd, UINT msg,
if (w && p >= 0 && p < COMPANION_DOCK_COUNT && w->floats[p] == hwnd)
cw_float_moving(w, (enum companion_dock_id)p);
break;
/* A pane drag is a modal loop on the run loop's thread like any
* other window's: same pause handling. The drop is applied after
* the timer and audio are back, since docking the pane may take
* this window down. */
case WM_ENTERSIZEMOVE:
case WM_ENTERMENULOOP:
win32_sizemove_enter(hwnd);
break;
case WM_EXITMENULOOP:
win32_sizemove_exit(hwnd);
break;
case WM_EXITSIZEMOVE:
win32_sizemove_exit(hwnd);
if (w && p >= 0 && p < COMPANION_DOCK_COUNT && w->floats[p] == hwnd)
cw_float_moved(w, (enum companion_dock_id)p);
break;
case WM_TIMER:
if (wparam != WIN32_SIZEMOVE_TIMER_ID)
break;
win32_sizemove_tick();
return 0;
case WM_DESTROY:
win32_sizemove_abort();
break;
case WM_CLOSE:
win32_sizemove_abort();
if (w && p >= 0 && p < COMPANION_DOCK_COUNT)
cw_dock_show_pane(w, (enum companion_dock_id)p, false);
return 0;