Skip to content

Commit d5cc5df

Browse files
authored
Plugin: disallow overriding window overview (#2753)
No one was using it anyway
1 parent 6a76238 commit d5cc5df

File tree

4 files changed

+7
-23
lines changed

4 files changed

+7
-23
lines changed

lib/Plugin.vala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
namespace Gala {
1919
public enum PluginFunction {
2020
ADDITION,
21-
WINDOW_SWITCHER,
22-
WINDOW_OVERVIEW
21+
WINDOW_SWITCHER
2322
}
2423

2524
public enum LoadPriority {

src/DesktopIntegration.vala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,6 @@ public class Gala.DesktopIntegration : GLib.Object {
242242
}
243243

244244
public void show_windows_for (string app_id) throws IOError, DBusError {
245-
if (wm.window_overview == null) {
246-
throw new IOError.FAILED ("Window overview not provided by window manager");
247-
}
248-
249245
App app;
250246
if ((app = AppSystem.get_default ().lookup_app (app_id)) == null) {
251247
throw new IOError.NOT_FOUND ("App not found");

src/PluginManager.vala

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public class Gala.PluginManager : Object {
2222
}
2323

2424
public string? window_switcher_provider { get; private set; default = null; }
25-
public string? window_overview_provider { get; private set; default = null; }
2625

2726
private HashTable<string,Plugin> plugins;
2827
private File plugin_dir;
@@ -125,18 +124,12 @@ public class Gala.PluginManager : Object {
125124
private bool check_provides (string name, PluginFunction provides) {
126125
var message = "Plugins %s and %s both provide %s functionality, using first one only";
127126
switch (provides) {
128-
case PluginFunction.WINDOW_OVERVIEW:
129-
if (window_overview_provider != null) {
130-
warning (message, window_overview_provider, name, "window overview");
131-
return false;
132-
}
133-
window_overview_provider = name;
134-
return true;
135127
case PluginFunction.WINDOW_SWITCHER:
136128
if (window_switcher_provider != null) {
137129
warning (message, window_switcher_provider, name, "window switcher");
138130
return false;
139131
}
132+
140133
window_switcher_provider = name;
141134
return true;
142135
default:

src/WindowManager.vala

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace Gala {
7777

7878
private WindowSwitcher? window_switcher = null;
7979

80-
public ActivatableComponent? window_overview { get; private set; }
80+
public WindowOverview window_overview { get; private set; }
8181

8282
public ScreenSaverManager? screensaver { get; private set; }
8383

@@ -290,12 +290,8 @@ namespace Gala {
290290
Meta.KeyBinding.set_custom_handler ("switch-group-backward", window_switcher.handle_switch_windows);
291291
}
292292

293-
if (plugin_manager.window_overview_provider == null
294-
|| (window_overview = (plugin_manager.get_plugin (plugin_manager.window_overview_provider) as ActivatableComponent)) == null
295-
) {
296-
window_overview = new WindowOverview (this);
297-
ui_group.add_child ((Clutter.Actor) window_overview);
298-
}
293+
window_overview = new WindowOverview (this);
294+
ui_group.add_child (window_overview);
299295

300296
// Add the remaining components that should be on top
301297
shell_group = new Clutter.Actor ();
@@ -884,7 +880,7 @@ namespace Gala {
884880
launch_action (ActionKeys.PANEL_MAIN_MENU_ACTION);
885881
break;
886882
case ActionType.WINDOW_OVERVIEW:
887-
if (window_overview == null || filter_action (WINDOW_OVERVIEW)) {
883+
if (filter_action (WINDOW_OVERVIEW)) {
888884
break;
889885
}
890886

@@ -896,7 +892,7 @@ namespace Gala {
896892
critical ("Window overview is deprecated");
897893
break;
898894
case ActionType.WINDOW_OVERVIEW_ALL:
899-
if (window_overview == null || filter_action (WINDOW_OVERVIEW)) {
895+
if (filter_action (WINDOW_OVERVIEW)) {
900896
break;
901897
}
902898

0 commit comments

Comments
 (0)