Skip to content

Commit

Permalink
ShellClients: Don't make centered clients docks but allow their short…
Browse files Browse the repository at this point in the history
…cut inhibition without dialog (#1995)
  • Loading branch information
leolost2605 authored Aug 8, 2024
1 parent 1800c07 commit 31b8939
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 0 additions & 4 deletions data/io.elementary.desktop.wm.shell
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
launch-on-x=true
args=io.elementary.wingpanel

[io.elementary.desktop.agent-polkit]
launch-on-x=true
args=/usr/libexec/policykit-1-pantheon/io.elementary.desktop.agent-polkit

[io.elementary.dock]
launch-on-x=true
args=io.elementary.dock
5 changes: 3 additions & 2 deletions src/Dialogs.vala
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ namespace Gala {
return;
}

// Naive check to always allow inhibiting by our settings app. This is needed for setting custom shortcuts
if (app.id == "io.elementary.settings.desktop") {
if (app.id == "io.elementary.settings.desktop" || // Naive check to always allow inhibiting by our settings app. This is needed for setting custom shortcuts
ShellClientsManager.get_instance ().is_positioned_window (window) // Certain windows (e.g. centered ones) may want to disable move via super + drag
) {
on_response (0);
return;
}
Expand Down
15 changes: 13 additions & 2 deletions src/ShellClients/ShellClientsManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,22 @@ public class Gala.ShellClientsManager : Object {
return;
}

make_dock (window);

centered_windows[window] = new CenteredWindow (wm, window);
}

public bool is_positioned_window (Meta.Window window) {
bool positioned = (window in centered_windows) || (window in windows);
window.foreach_ancestor ((ancestor) => {
if (ancestor in centered_windows || ancestor in windows) {
positioned = true;
}

return !positioned;
});

return positioned;
}

//X11 only
private void parse_mutter_hints (Meta.Window window) requires (!Meta.Util.is_wayland_compositor ()) {
if (window.mutter_hints == null) {
Expand Down
4 changes: 4 additions & 0 deletions src/WindowStateSaver.vala
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public class Gala.WindowStateSaver : GLib.Object {
return;
}

if (ShellClientsManager.get_instance ().is_positioned_window (window)) {
return;
}

if (!(app_id in app_windows)) {
app_windows[app_id] = new GLib.Array<Meta.Window?> ();
}
Expand Down

0 comments on commit 31b8939

Please sign in to comment.