Skip to content

Commit

Permalink
Allow focusing window via DesktopIntegration
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Jan 2, 2024
1 parent 7de779c commit 01f699f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/DesktopIntegration.vala
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,15 @@ public class Gala.DesktopIntegration : GLib.Object {

return (owned) returned_windows;
}

public void focus_window (uint64 uid) throws GLib.DBusError, GLib.IOError {
var apps = Gala.AppSystem.get_default ().get_running_apps ();
foreach (unowned var app in apps) {
foreach (weak Meta.Window window in app.get_windows ()) {
if (window.get_id () == uid) {
window.activate (wm.get_display ().get_current_time ());
}
}
}
}
}

0 comments on commit 01f699f

Please sign in to comment.