Accept root-window button-presses when received for a source-window (child) that is ours.

In d5230923, mouse-grabbing was changed to bind to the actual managed
window instead of the parent window (cf. that commit for the details),
but this caused all button-presses on window decorations to become
ignored, and float groups to effectively stop working (at least as far
as moving and resizing are concerned).

This is a workaround for that problem that receives the button-press
when it is propagated to the root-window instead, as indicated by the
event child-window being our decoration window, translating the
coordinates as required.
This commit is contained in:
Fredrik Tolf 2022-12-29 15:06:50 +01:00
parent 9b5e0cfd19
commit 3b6c32deaf

View file

@ -649,7 +649,13 @@ the window in it's frame."
((setf win (find-window-by-parent window (top-windows)))
;; The click happened on the parent window, so the coordinates are
;; correct.
))
)
((and child (setf win (find-window-by-parent child (top-windows))))
;; The click happened on the parent window but was received by
;; the root window, since the parent window does not grab
;; buttons (see commit d5230923 for details).
(setf x (- x (xlib:drawable-x child))
y (- y (xlib:drawable-y child)))))
(cond
((and screen (not child))
(group-button-press (screen-current-group screen) button x y :root)