88public class Gala.PanelClone : Object {
99 private const int ANIMATION_DURATION = 250 ;
1010
11- public WindowManager wm { get ; construct; }
11+ public WindowManagerGala wm { get ; construct; }
1212 public unowned PanelWindow panel { get ; construct; }
1313
1414 public Pantheon . Desktop . HideMode hide_mode {
@@ -41,17 +41,20 @@ public class Gala.PanelClone : Object {
4141
4242 private HideTracker ? hide_tracker;
4343
44- public PanelClone (WindowManager wm , PanelWindow panel ) {
44+ public PanelClone (WindowManagerGala wm , PanelWindow panel ) {
4545 Object (wm: wm, panel: panel);
4646 }
4747
4848 construct {
4949 default_gesture_tracker = new GestureTracker (ANIMATION_DURATION , ANIMATION_DURATION );
5050
5151 clone = new SafeWindowClone (panel. window, true );
52- wm. ui_group . add_child (clone);
52+ wm. shell_group . add_child (clone);
5353
5454 actor = (Meta . WindowActor ) panel. window. get_compositor_private ();
55+ actor. get_parent (). remove_child (actor);
56+ wm. shell_group. add_child (actor);
57+
5558 // WindowActor position and Window position aren't necessarily the same.
5659 // The clone needs the actor position
5760 actor. notify[" x" ]. connect (update_clone_position);
@@ -69,10 +72,6 @@ public class Gala.PanelClone : Object {
6972 }
7073 });
7174
72- // Make sure the actor is visible once it's focused FIXME: better event not only focused
73- // https://github.com/elementary/gala/issues/2080
74- panel. window. focused. connect (update_visible);
75-
7675 update_visible ();
7776 update_clone_position ();
7877
@@ -87,12 +86,6 @@ public class Gala.PanelClone : Object {
8786
8887 private void update_visible () {
8988 actor. visible = ! panel_hidden;
90-
91- if (actor. visible && ! wm. get_display (). get_monitor_in_fullscreen (panel. window. get_monitor ())) {
92- // The actor has just been revealed, make sure it's at the top
93- // https://github.com/elementary/gala/issues/2080
94- actor. get_parent (). set_child_above_sibling (actor, null );
95- }
9689 }
9790
9891 private void update_clone_position () {
@@ -144,7 +137,9 @@ public class Gala.PanelClone : Object {
144137 }
145138
146139 private void show (GestureTracker gesture_tracker , bool with_gesture ) {
147- if (! panel_hidden || force_hide || last_gesture_tracker != null && last_gesture_tracker. recognizing) {
140+ if (! panel_hidden || force_hide || last_gesture_tracker != null && last_gesture_tracker. recognizing
141+ || (wm. get_display (). get_monitor_in_fullscreen (panel. window. get_monitor ()) && ! panel. window. has_focus ())
142+ ) {
148143 return ;
149144 }
150145
@@ -162,15 +157,19 @@ public class Gala.PanelClone : Object {
162157 });
163158 }
164159
165- public void set_force_hide (bool force_hide , GestureTracker gesture_tracker , bool with_gesture ) {
166- this . force_hide = force_hide;
167-
168- if (force_hide) {
160+ private void check_hide (bool should_hide , GestureTracker gesture_tracker , bool with_gesture ) {
161+ if (should_hide) {
169162 hide (gesture_tracker, with_gesture);
170- } else if (hide_mode == NEVER ) {
171- show (gesture_tracker, with_gesture);
172- } else {
163+ } else if (hide_tracker != null ) {
173164 hide_tracker. update_overlap (gesture_tracker, with_gesture);
165+ } else {
166+ show (gesture_tracker, with_gesture);
174167 }
175168 }
169+
170+ public void set_force_hide (bool force_hide , GestureTracker gesture_tracker , bool with_gesture ) {
171+ this . force_hide = force_hide;
172+
173+ check_hide (force_hide, gesture_tracker, with_gesture);
174+ }
176175}
0 commit comments