Skip to content

Commit e4c469e

Browse files
authored
Simplify multitasking view type (#2303)
1 parent c5b6451 commit e4c469e

File tree

5 files changed

+16
-37
lines changed

5 files changed

+16
-37
lines changed

daemon/DBus.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
public enum Gala.ActionType {
77
NONE = 0,
8-
SHOW_WORKSPACE_VIEW,
8+
SHOW_MULTITASKING_VIEW,
99
MAXIMIZE_CURRENT,
1010
HIDE_CURRENT,
1111
OPEN_LAUNCHER,

lib/Plugin.vala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ namespace Gala {
1919
public enum PluginFunction {
2020
ADDITION,
2121
WINDOW_SWITCHER,
22-
WORKSPACE_VIEW,
2322
WINDOW_OVERVIEW
2423
}
2524

lib/WindowManager.vala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
namespace Gala {
1919
public enum ActionType {
2020
NONE = 0,
21-
SHOW_WORKSPACE_VIEW,
21+
SHOW_MULTITASKING_VIEW,
2222
MAXIMIZE_CURRENT,
2323
HIDE_CURRENT,
2424
OPEN_LAUNCHER,
@@ -118,11 +118,6 @@ namespace Gala {
118118
*/
119119
public abstract Meta.BackgroundGroup background_group { get; protected set; }
120120

121-
/**
122-
* View that allows to see and manage all your windows and desktops.
123-
*/
124-
public abstract Gala.ActivatableComponent workspace_view { get; protected set; }
125-
126121
/**
127122
* Enters the modal mode, which means that all events are directed to the stage instead
128123
* of the windows. This is the only way to receive keyboard events besides shortcut listeners.

src/PluginManager.vala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class Gala.PluginManager : Object {
2626

2727
public string? window_switcher_provider { get; private set; default = null; }
2828
public string? window_overview_provider { get; private set; default = null; }
29-
public string? workspace_view_provider { get; private set; default = null; }
3029

3130
private HashTable<string,Plugin> plugins;
3231
private File plugin_dir;
@@ -129,13 +128,6 @@ public class Gala.PluginManager : Object {
129128
private bool check_provides (string name, PluginFunction provides) {
130129
var message = "Plugins %s and %s both provide %s functionality, using first one only";
131130
switch (provides) {
132-
case PluginFunction.WORKSPACE_VIEW:
133-
if (workspace_view_provider != null) {
134-
warning (message, workspace_view_provider, name, "workspace view");
135-
return false;
136-
}
137-
workspace_view_provider = name;
138-
return true;
139131
case PluginFunction.WINDOW_OVERVIEW:
140132
if (window_overview_provider != null) {
141133
warning (message, window_overview_provider, name, "window overview");

src/WindowManager.vala

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ namespace Gala {
5252
public Meta.BackgroundGroup background_group { get; protected set; }
5353

5454
/**
55-
* {@inheritDoc}
55+
* View that allows to see and manage all your windows and desktops.
5656
*/
57-
public Gala.ActivatableComponent workspace_view { get; protected set; }
57+
public MultitaskingView multitasking_view { get; protected set; }
5858

5959
public PointerLocator pointer_locator { get; private set; }
6060

@@ -243,12 +243,8 @@ namespace Gala {
243243
plugin_manager.initialize (this);
244244
plugin_manager.regions_changed.connect (update_input_area);
245245

246-
if (plugin_manager.workspace_view_provider == null
247-
|| (workspace_view = (plugin_manager.get_plugin (plugin_manager.workspace_view_provider) as ActivatableComponent)) == null
248-
) {
249-
workspace_view = new MultitaskingView (this);
250-
ui_group.add_child ((Clutter.Actor) workspace_view);
251-
}
246+
multitasking_view = new MultitaskingView (this);
247+
ui_group.add_child (multitasking_view);
252248

253249
if (plugin_manager.window_switcher_provider == null) {
254250
window_switcher = new WindowSwitcher (this);
@@ -334,10 +330,10 @@ namespace Gala {
334330
});
335331

336332
Meta.KeyBinding.set_custom_handler ("show-desktop", () => {
337-
if (workspace_view.is_opened ()) {
338-
workspace_view.close ();
333+
if (multitasking_view.is_opened ()) {
334+
multitasking_view.close ();
339335
} else {
340-
workspace_view.open ();
336+
multitasking_view.open ();
341337
}
342338
});
343339

@@ -565,7 +561,7 @@ namespace Gala {
565561
* {@inheritDoc}
566562
*/
567563
public void switch_to_next_workspace (Meta.MotionDirection direction, uint32 timestamp) {
568-
((MultitaskingView) workspace_view).switch_to_next_workspace (direction);
564+
multitasking_view.switch_to_next_workspace (direction);
569565
}
570566

571567
private void update_input_area () {
@@ -698,7 +694,7 @@ namespace Gala {
698694
return;
699695
}
700696

701-
((MultitaskingView) workspace_view).move_window (window, workspace);
697+
multitasking_view.move_window (window, workspace);
702698
}
703699

704700
/**
@@ -820,14 +816,11 @@ namespace Gala {
820816
unowned var current = display.get_focus_window ();
821817

822818
switch (type) {
823-
case ActionType.SHOW_WORKSPACE_VIEW:
824-
if (workspace_view == null)
825-
break;
826-
827-
if (workspace_view.is_opened ())
828-
workspace_view.close ();
819+
case ActionType.SHOW_MULTITASKING_VIEW:
820+
if (multitasking_view.is_opened ())
821+
multitasking_view.close ();
829822
else
830-
workspace_view.open ();
823+
multitasking_view.open ();
831824
break;
832825
case ActionType.MAXIMIZE_CURRENT:
833826
if (current == null || current.window_type != Meta.WindowType.NORMAL || !current.can_maximize ())
@@ -1743,7 +1736,7 @@ namespace Gala {
17431736
}
17441737

17451738
public override void kill_switch_workspace () {
1746-
((MultitaskingView) workspace_view).kill_switch_workspace ();
1739+
multitasking_view.kill_switch_workspace ();
17471740
}
17481741

17491742
public override void locate_pointer () {

0 commit comments

Comments
 (0)