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

View File

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

View File

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

View File

@ -357,20 +357,11 @@ namespace Gala {
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, () => {
if (window_overview.is_opened ()) {
window_overview.close ();
} else {
var hints = new HashTable<string,Variant> (str_hash, str_equal);
hints.@set ("all-windows", true);
window_overview.open (hints);
window_overview.open ();
}
});
@ -982,24 +973,26 @@ namespace Gala {
}
break;
case ActionType.WINDOW_OVERVIEW:
if (window_overview == null)
if (window_overview == null) {
break;
}
if (window_overview.is_opened ())
if (window_overview.is_opened ()) {
window_overview.close ();
else
} else {
window_overview.open ();
}
critical ("Window overview is deprecated");
break;
case ActionType.WINDOW_OVERVIEW_ALL:
if (window_overview == null)
if (window_overview == null) {
break;
}
if (window_overview.is_opened ())
if (window_overview.is_opened ()) {
window_overview.close ();
else {
var hints = new HashTable<string,Variant> (str_hash, str_equal);
hints.@set ("all-windows", true);
window_overview.open (hints);
} else {
window_overview.open ();
}
break;
case ActionType.SWITCH_TO_WORKSPACE_LAST: