Remove expose-windows shortcut (#1795)

This commit is contained in:
Leo 2023-11-10 06:49:22 +09:00 committed by GitHub
parent 0cc9a049ae
commit f5391aee9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 38 deletions

View File

@ -7,11 +7,10 @@
<value nick="minimize-current" value="3" /> <value nick="minimize-current" value="3" />
<value nick="open-launcher" value="4" /> <value nick="open-launcher" value="4" />
<value nick="custom-command" value="5" /> <value nick="custom-command" value="5" />
<value nick="window-overview" value="6" /> <value nick="window-overview-all" value="6" />
<value nick="window-overview-all" value="7" /> <value nick="switch-to-workspace-previous" value="7" />
<value nick="switch-to-workspace-previous" value="8" /> <value nick="switch-to-workspace-next" value="8" />
<value nick="switch-to-workspace-next" value="9" /> <value nick="switch-to-workspace-last" value="9" />
<value nick="switch-to-workspace-last" value="10" />
</enum> </enum>
<enum id="GalaWindowOverviewType"> <enum id="GalaWindowOverviewType">
<value nick='grid' value='0'/> <value nick='grid' value='0'/>
@ -148,8 +147,8 @@
<summary>Zoom out</summary> <summary>Zoom out</summary>
</key> </key>
<key type="as" name="expose-windows"> <key type="as" name="expose-windows">
<default><![CDATA[['<Super>w']]]></default> <default><![CDATA[['']]]></default>
<summary>Shortcut to open the window overview</summary> <summary>DEPRECATED: This key is deprecated and ignored</summary>
<description></description> <description></description>
</key> </key>
<key type="as" name="expose-all-windows"> <key type="as" name="expose-all-windows">

View File

@ -27,8 +27,7 @@ namespace Gala {
* The component was requested to be opened. * The component was requested to be opened.
* *
* @param hints The hashmap may contain special parameters that are useful * @param hints The hashmap may contain special parameters that are useful
* to the component. Currently, the only one implemented is the * to the component.
* 'all-windows' hint to the windowoverview.
*/ */
public abstract void open (HashTable<string,Variant>? hints = null); public abstract void open (HashTable<string,Variant>? hints = null);

View File

@ -67,19 +67,12 @@ public class Gala.WindowOverview : Clutter.Actor, ActivatableComponent {
/** /**
* {@inheritDoc} * {@inheritDoc}
* You may specify 'all-windows' in hints to expose all windows
*/ */
public void open (HashTable<string,Variant>? hints = null) { public void open (HashTable<string,Variant>? hints = null) {
var all_windows = hints != null && "all-windows" in hints;
workspaces = new List<Meta.Workspace> (); workspaces = new List<Meta.Workspace> ();
unowned var manager = wm.get_display ().get_workspace_manager (); unowned var manager = wm.get_display ().get_workspace_manager ();
if (all_windows) { foreach (unowned var workspace in manager.get_workspaces ()) {
foreach (unowned var workspace in manager.get_workspaces ()) { workspaces.append (workspace);
workspaces.append (workspace);
}
} else {
workspaces.append (manager.get_active_workspace ());
} }
var windows = new List<Meta.Window> (); var windows = new List<Meta.Window> ();
@ -172,7 +165,6 @@ public class Gala.WindowOverview : Clutter.Actor, ActivatableComponent {
} }
switch (binding.get_name ()) { switch (binding.get_name ()) {
case "expose-windows":
case "expose-all-windows": case "expose-all-windows":
case "zoom-in": case "zoom-in":
case "zoom-out": case "zoom-out":

View File

@ -357,20 +357,11 @@ namespace Gala {
ui_group.add_child (screen_shield); ui_group.add_child (screen_shield);
display.add_keybinding ("expose-windows", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, () => {
if (window_overview.is_opened ()) {
window_overview.close ();
} else {
window_overview.open ();
}
});
display.add_keybinding ("expose-all-windows", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, () => { display.add_keybinding ("expose-all-windows", keybinding_settings, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, () => {
if (window_overview.is_opened ()) { if (window_overview.is_opened ()) {
window_overview.close (); window_overview.close ();
} else { } else {
var hints = new HashTable<string,Variant> (str_hash, str_equal); window_overview.open ();
hints.@set ("all-windows", true);
window_overview.open (hints);
} }
}); });
@ -982,24 +973,26 @@ namespace Gala {
} }
break; break;
case ActionType.WINDOW_OVERVIEW: case ActionType.WINDOW_OVERVIEW:
if (window_overview == null) if (window_overview == null) {
break; break;
}
if (window_overview.is_opened ()) if (window_overview.is_opened ()) {
window_overview.close (); window_overview.close ();
else } else {
window_overview.open (); window_overview.open ();
}
critical ("Window overview is deprecated");
break; break;
case ActionType.WINDOW_OVERVIEW_ALL: case ActionType.WINDOW_OVERVIEW_ALL:
if (window_overview == null) if (window_overview == null) {
break; break;
}
if (window_overview.is_opened ()) if (window_overview.is_opened ()) {
window_overview.close (); window_overview.close ();
else { } else {
var hints = new HashTable<string,Variant> (str_hash, str_equal); window_overview.open ();
hints.@set ("all-windows", true);
window_overview.open (hints);
} }
break; break;
case ActionType.SWITCH_TO_WORKSPACE_LAST: case ActionType.SWITCH_TO_WORKSPACE_LAST: