8
8
public class Gala.PanelClone : Object {
9
9
private const int ANIMATION_DURATION = 250 ;
10
10
11
- public WindowManager wm { get ; construct; }
11
+ public WindowManagerGala wm { get ; construct; }
12
12
public unowned PanelWindow panel { get ; construct; }
13
13
14
14
public Pantheon . Desktop . HideMode hide_mode {
@@ -41,17 +41,20 @@ public class Gala.PanelClone : Object {
41
41
42
42
private HideTracker ? hide_tracker;
43
43
44
- public PanelClone (WindowManager wm , PanelWindow panel ) {
44
+ public PanelClone (WindowManagerGala wm , PanelWindow panel ) {
45
45
Object (wm: wm, panel: panel);
46
46
}
47
47
48
48
construct {
49
49
default_gesture_tracker = new GestureTracker (ANIMATION_DURATION , ANIMATION_DURATION );
50
50
51
51
clone = new SafeWindowClone (panel. window, true );
52
- wm. ui_group . add_child (clone);
52
+ wm. shell_group . add_child (clone);
53
53
54
54
actor = (Meta . WindowActor ) panel. window. get_compositor_private ();
55
+ actor. get_parent (). remove_child (actor);
56
+ wm. shell_group. add_child (actor);
57
+
55
58
// WindowActor position and Window position aren't necessarily the same.
56
59
// The clone needs the actor position
57
60
actor. notify[" x" ]. connect (update_clone_position);
@@ -69,10 +72,6 @@ public class Gala.PanelClone : Object {
69
72
}
70
73
});
71
74
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
-
76
75
update_visible ();
77
76
update_clone_position ();
78
77
@@ -87,12 +86,6 @@ public class Gala.PanelClone : Object {
87
86
88
87
private void update_visible () {
89
88
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
- }
96
89
}
97
90
98
91
private void update_clone_position () {
@@ -144,7 +137,9 @@ public class Gala.PanelClone : Object {
144
137
}
145
138
146
139
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
+ ) {
148
143
return ;
149
144
}
150
145
@@ -162,15 +157,19 @@ public class Gala.PanelClone : Object {
162
157
});
163
158
}
164
159
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) {
169
162
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 ) {
173
164
hide_tracker. update_overlap (gesture_tracker, with_gesture);
165
+ } else {
166
+ show (gesture_tracker, with_gesture);
174
167
}
175
168
}
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
+ }
176
175
}
0 commit comments