]> git.mdlowis.com Git - proto/labwc.git/commit
xwayland: notify correct window stacking order to xwayland
authortokyo4j <hrak1529@gmail.com>
Tue, 25 Mar 2025 07:01:54 +0000 (16:01 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Tue, 1 Apr 2025 07:48:40 +0000 (16:48 +0900)
commit81204b053782b064b6dbd690cdf825d105835637
tree35b5eb508c737d0a8dcc23f519edba054cfbfe27
parentde49054d75aea8754fcedd2d9710d633cebce584
xwayland: notify correct window stacking order to xwayland

Before this commit, when a normal window is raised, xwayland thought it's
above always-on-top (AOT) windows even though it's actually below AOT
windows in the scene. This means mouse scroll events may be unexpectedly
sent to normal windows below AOT windows even when the cursor is hovering
over a AOT window.

So this commit fixes it by notifying the correct stacking order (where AOT
windows are placed above normal windows) to xwayland every time the
stacking order is updated.

Other benefits of this commit are:
- It makes the code more readable and predictable by aggregating logic
  about stacking order management in xwayland (e.g. shaded windows or
  windows in other workspaces should be notified to xwayland as being
  placed at the bottom).
- As server->last_raised_view is removed in the previous commit, we were
  notifying the stacking order to xwayland every time a window with dialog
  windows is clicked (not when clicking a topmost window without dialogs,
  due to some optimization in wlroots). This commit fixes this by caching
  the window stacking order in xwayland_view->stacking_order and notifying
  it to xwayland only when it's updated.
include/view-impl-common.h
include/view.h
include/xwayland.h
src/view-impl-common.c
src/view.c
src/xdg.c
src/xwayland.c