Skip to content

Commit

Permalink
Integrate with gala window spread (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Jan 21, 2024
1 parent 6eb560a commit d38c0df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/DesktopIntegration.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ public interface Dock.DesktopIntegration : GLib.Object {

public abstract RunningApplication[] get_running_applications () throws GLib.DBusError, GLib.IOError;
public abstract Window[] get_windows () throws GLib.DBusError, GLib.IOError;
public abstract void show_windows_for (string app_id) throws GLib.DBusError, GLib.IOError;
}
4 changes: 3 additions & 1 deletion src/Launcher.vala
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ public class Dock.Launcher : Gtk.Button {

if (action != null) {
app_info.launch_action (action, context);
} else {
} else if (windows.length () <= 1) {
app_info.launch (null, context);
} else if (LauncherManager.get_default ().desktop_integration != null) {
LauncherManager.get_default ().desktop_integration.show_windows_for (app_info.get_id ());
}
} catch (Error e) {
critical (e.message);
Expand Down
2 changes: 1 addition & 1 deletion src/LauncherManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
}

public Launcher? added_launcher { get; set; default = null; }
public Dock.DesktopIntegration? desktop_integration { get; private set; }

private List<Launcher> launchers; //Only used to keep track of launcher indices
private Dock.DesktopIntegration desktop_integration;
private GLib.HashTable<unowned string, Dock.Launcher> app_to_launcher;

static construct {
Expand Down

0 comments on commit d38c0df

Please sign in to comment.