Skip to content

Commit

Permalink
Remove expose-windows shortcut (#1795)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenemter authored Nov 9, 2023
1 parent 0cc9a04 commit f5391ae
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 38 deletions.
13 changes: 6 additions & 7 deletions data/gala.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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'/>
Expand Down Expand Up @@ -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">
Expand Down
3 changes: 1 addition & 2 deletions lib/ActivatableComponent.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 2 additions & 10 deletions src/Widgets/WindowOverview.vala
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,12 @@ 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 ());
foreach (unowned var workspace in manager.get_workspaces ()) {
workspaces.append (workspace);
}

var windows = new List<Meta.Window> ();
Expand Down Expand Up @@ -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":
Expand Down
31 changes: 12 additions & 19 deletions src/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
}
});

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f5391ae

Please sign in to comment.