diff --git a/src/DesktopIntegration.vala b/src/DesktopIntegration.vala index bfff84552..793290965 100644 --- a/src/DesktopIntegration.vala +++ b/src/DesktopIntegration.vala @@ -244,4 +244,18 @@ public class Gala.DesktopIntegration : GLib.Object { wm.window_overview.open (hints); } + + public void close_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.delete (Meta.CURRENT_TIME); + return; + } + } + } + + throw new GLib.IOError.NOT_FOUND ("Window not found"); + } }