@@ -126,14 +126,6 @@ public class Gala.WorkspaceClone : ActorTarget {
126126 */
127127 public signal void window_selected (Meta .Window window );
128128
129- /**
130- * The background has been selected. Switch to that workspace.
131- *
132- * @param close_view If the MultitaskingView should also consider closing itself
133- * after switching.
134- */
135- public signal void selected (bool close_view );
136-
137129 public WindowManager wm { get ; construct; }
138130 public Meta . Workspace workspace { get ; construct; }
139131 public IconGroup icon_group { get ; private set ; }
@@ -170,9 +162,7 @@ public class Gala.WorkspaceClone : ActorTarget {
170162 var monitor_geometry = display. get_monitor_geometry (primary_monitor);
171163
172164 var background_click_action = new Clutter .ClickAction ();
173- background_click_action. clicked. connect (() = > {
174- selected (true );
175- });
165+ background_click_action. clicked. connect (() = > activate (true ));
176166 background = new FramedBackground (display);
177167 background. add_action (background_click_action);
178168
@@ -181,10 +171,10 @@ public class Gala.WorkspaceClone : ActorTarget {
181171 height = monitor_geometry. height,
182172 };
183173 window_container. window_selected. connect ((w) = > { window_selected (w); });
184- window_container. requested_close. connect (() = > selected (true ));
174+ window_container. requested_close. connect (() = > activate (true ));
185175
186176 icon_group = new IconGroup (display, workspace, scale_factor);
187- icon_group. selected. connect (() = > selected (true ));
177+ icon_group. selected. connect (() = > activate (true ));
188178
189179 var icons_drop_action = new DragDropAction (DragDropActionType . DESTINATION , " multitaskingview-window" );
190180 icon_group. add_action (icons_drop_action);
@@ -200,7 +190,7 @@ public class Gala.WorkspaceClone : ActorTarget {
200190
201191 if (hovered && hover_activate_timeout == 0 ) {
202192 hover_activate_timeout = Timeout . add (HOVER_ACTIVATE_DELAY , () = > {
203- selected (false );
193+ activate (false );
204194 hover_activate_timeout = 0 ;
205195 return false ;
206196 });
@@ -333,4 +323,12 @@ public class Gala.WorkspaceClone : ActorTarget {
333323 icon_group. backdrop_opacity = 1 - (float ) (workspace. index () + progress). abs (). clamp (0 , 1 );
334324 }
335325 }
326+
327+ private void activate (bool close_view ) {
328+ if (close_view && workspace. active) {
329+ wm. perform_action (SHOW_MULTITASKING_VIEW );
330+ } else {
331+ workspace. activate (Meta . CURRENT_TIME );
332+ }
333+ }
336334}
0 commit comments