diff options
Diffstat (limited to 'lib/astal/gtk4/src/widget')
-rw-r--r-- | lib/astal/gtk4/src/widget/window.vala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/astal/gtk4/src/widget/window.vala b/lib/astal/gtk4/src/widget/window.vala index 0cf3d11..3b0d113 100644 --- a/lib/astal/gtk4/src/widget/window.vala +++ b/lib/astal/gtk4/src/widget/window.vala @@ -47,6 +47,13 @@ public enum Astal.Keymode { * Subclass of [[email protected]] which integrates GtkLayerShell as class fields. */ public class Astal.Window : Gtk.Window { + /** + * Get the current [[email protected]] this window resides in. + */ + public Gdk.Monitor get_current_monitor() { + return Gdk.Display.get_default().get_monitor_at_surface(base.get_surface()); + } + private bool check(string action) { if (!is_supported()) { critical(@"can not $action on window: layer shell not supported"); |