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

Integrate with gala window spread #210

Merged
merged 1 commit into from
Jan 21, 2024
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