Skip to content
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
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