mirror of
https://github.com/elementary/gala.git
synced 2024-12-25 18:24:05 +03:00
Allow focusing a window via DesktopIntegration (#1817)
Co-authored-by: Leo <lenemter@gmail.com>
This commit is contained in:
parent
2f4fe15ed2
commit
0a2d54f600
@ -100,6 +100,17 @@ 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 ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void show_windows_for (string app_id) throws IOError, DBusError {
|
||||
if (wm.window_overview == null) {
|
||||
throw new IOError.FAILED ("Window overview not provided by window manager");
|
||||
|
Loading…
Reference in New Issue
Block a user