window: Propagate stickyness across modal dialog chains

While marking a parent window as sticky or non-sticky always propagates
to the children, also propagate to the parents if the dialog in question
is modal.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3870>
This commit is contained in:
Jonas Ådahl
2024-07-16 11:44:58 +02:00
committed by Marge Bot
parent c079e2696d
commit 288d57f6a5
4 changed files with 122 additions and 0 deletions

View File

@ -737,6 +737,8 @@ stacking_tests = [
'sloppy-focus-pointer-rest',
'sloppy-focus-auto-raise',
'sticky',
'sticky-modals',
'sticky-transients',
'strut-monitor-changes'
]

View File

@ -0,0 +1,63 @@
new_client w wayland
create w/1
create w/2
create w/3
create w/4
create w/5
set_parent w/2 1
set_parent w/3 2
set_modal w/3
set_parent w/4 3
set_modal w/4
set_parent w/5 3
show w/1
show w/2
show w/3
show w/4
show w/5
assert_stacking w/1 w/2 w/3 w/4 w/5
assert_sticky w/1 false
assert_sticky w/2 false
assert_sticky w/3 false
assert_sticky w/4 false
assert_sticky w/5 false
# Marking root as sticky propagates to all children
stick w/1
assert_sticky w/1 true
assert_sticky w/2 true
assert_sticky w/3 true
assert_sticky w/4 true
assert_sticky w/5 true
# Marking a non-modal child as sticky does not propaget
unstick w/5
assert_sticky w/1 true
assert_sticky w/2 true
assert_sticky w/3 true
assert_sticky w/4 true
assert_sticky w/5 false
# Marking a modal as sticky propagates to all modal ancestors
unstick w/4
assert_sticky w/1 true
assert_sticky w/2 false
assert_sticky w/3 false
assert_sticky w/4 false
assert_sticky w/5 false
# Marking a modal as sticky propagates to modal ancestors, and all children
stick w/3
assert_sticky w/1 true
assert_sticky w/2 true
assert_sticky w/3 true
assert_sticky w/4 true
assert_sticky w/5 true
destroy w/5
destroy w/4
destroy w/3
destroy w/2
destroy w/1

View File

@ -0,0 +1,34 @@
new_client w wayland
create w/1
create w/2
create w/3
set_parent w/2 1
set_parent w/3 2
show w/1
show w/2
show w/3
assert_stacking w/1 w/2 w/3
assert_sticky w/1 false
assert_sticky w/2 false
assert_sticky w/3 false
stick w/1
assert_sticky w/1 true
assert_sticky w/2 true
assert_sticky w/3 true
unstick w/2
assert_sticky w/1 true
assert_sticky w/2 false
assert_sticky w/3 false
stick w/3
assert_sticky w/1 true
assert_sticky w/2 false
assert_sticky w/3 true
destroy w/3
destroy w/2
destroy w/1