Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove expose-windows shortcut #1795

Merged
merged 4 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if changing the value here will mess up system settings? It seems odd that the value is a number here tbh. But might need to preserve the numbers for now even though there would be a missing option just to not break things

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this enum is used only in hotcorners key, and settings plug set the value using string and not actual enum value. So it shouldn't break anything.

<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">
lenemter marked this conversation as resolved.
Show resolved Hide resolved
<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