Skip to content

Commit d38c0df

Browse files
authored
Integrate with gala window spread (#210)
1 parent 6eb560a commit d38c0df

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/DesktopIntegration.vala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ public interface Dock.DesktopIntegration : GLib.Object {
2323

2424
public abstract RunningApplication[] get_running_applications () throws GLib.DBusError, GLib.IOError;
2525
public abstract Window[] get_windows () throws GLib.DBusError, GLib.IOError;
26+
public abstract void show_windows_for (string app_id) throws GLib.DBusError, GLib.IOError;
2627
}

src/Launcher.vala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,10 @@ public class Dock.Launcher : Gtk.Button {
239239

240240
if (action != null) {
241241
app_info.launch_action (action, context);
242-
} else {
242+
} else if (windows.length () <= 1) {
243243
app_info.launch (null, context);
244+
} else if (LauncherManager.get_default ().desktop_integration != null) {
245+
LauncherManager.get_default ().desktop_integration.show_windows_for (app_info.get_id ());
244246
}
245247
} catch (Error e) {
246248
critical (e.message);

src/LauncherManager.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
}
1313

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

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

2020
static construct {

0 commit comments

Comments
 (0)