Repository navigation
feat(window): delegate interactive move and resize to the compositor - #91
Merged
sudoevolve merged 2 commits intoOct 10, 2026
Merged
Conversation
Undecorated-window drags built on per-frame glfwSetWindowPos arrive at the window manager as ConfigureRequests and get clamped into the workarea (Mutter constrain_fully_onscreen), and cannot work at all on native Wayland. Expose beginWindowMove/beginWindowResize, which send the EWMH _NET_WM_MOVERESIZE message (libX11 via dlopen) so the WM runs the interactive move: partial off-screen placement and native snapping included. Platforms without support return false so callers keep their programmatic fallback. Issue: sudoevolve#89
The helper lives in core::window::detail; unqualified calls only resolved by accident of branch layout and broke consumer builds that compile the library with stricter flags (gnu++17, -fno-exceptions).
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
.decorated(false)应用按常规方式实现标题栏拖动(按下记录原点、拖动中每帧glfwSetWindowPos),窗口跟随指针但到达任意屏幕边缘就被卡住,永远无法像原生标题栏拖动那样拖出屏幕;同样的循环在原生 Wayland GLFW 构建下完全无效。XMoveWindow以客户端 ConfigureRequest 到达 WM,Mutter 的constrain_fully_onscreen(PRIORITY_ENTIRELY_VISIBLE_ON_WORKAREA)只豁免is_user_action的交互式移动,把程序化定位推回工作区;Wayland 下客户端定位被协议禁止(_glfwSetWindowPosWayland是 no-op)。缺失的是把交互式拖动交给合成器的能力。修改
core::window新增beginWindowMove(Handle)/beginWindowResize(Handle, WindowResizeEdge),经include/eui/window.h暴露。X11 上发送 EWMH_NET_WM_MOVERESIZE(direction 8 = MOVE;WindowResizeEdge枚举值与 EWMH SIZE_* 0-7 一致;source indication 1 = application;指针根坐标用XQueryPointer获取,发送前按规范XUngrabPointer释放隐式 grab)。libX11 经 dlopen 加载(函数级静态缓存),与后端既有 X11 探测方式一致,所有构建配置不新增链接依赖。GLFW 分支仅在运行平台为 X11 时启用(GLFW 3.4 的glfwGetPlatform();3.3 头缺失该 API 时按编译期平台假定 X11);SDL2 分支经SDL_SysWMinfo取 display/window。其余平台/后端返回false,调用方保留原有程序化回退。window_controls_viewerfixture 新增 "Compositor move / Resize left / Resize bottom right" 按钮即可交互验证。影响
core/window/x11_moveresize.h)本机环境
-std=gnu++17 -Os -fno-exceptions -fno-rtti消费者配置编译)验证
ctest -L unit25/25,DISPLAY=:0 ctest -L probe8/8)SDL_SysWMinfo取句柄 + 同一 helper,待 CI 覆盖)window_controls_viewer新增按钮;真机 GNOME 会话手动点击验证按钮反馈与状态文案)备注
_NET_WM_STATE等根窗口消息生效),因此_NET_WM_MOVERESIZE的真实鼠标端到端行为请维护者以真机拖动自绘标题栏验收;该协议路径即 GTK/Chromium CSD 的标准做法。glfwGetX11Display()为无参 API(bundled GLFW 3.4),返回库全局 display。