From 6585841a3269dc84b28adab8f5e3963290e5521f Mon Sep 17 00:00:00 2001 From: Joshua Strobl Date: Sun, 8 Dec 2024 17:39:02 +0200 Subject: [PATCH] feat: port to Wayland (#33) --- meson.build | 3 +- src/budgie_desktop_view.vala | 65 ++- src/desktop_item.vala | 4 +- src/meson.build | 6 +- src/unified_props.vala | 2 +- vapi/libxfce4windowing-0-custom.vala | 13 + vapi/libxfce4windowing-0.deps | 4 + vapi/libxfce4windowing-0.vapi | 586 +++++++++++++++++++++++++++ 8 files changed, 638 insertions(+), 45 deletions(-) create mode 100644 vapi/libxfce4windowing-0-custom.vala create mode 100644 vapi/libxfce4windowing-0.deps create mode 100644 vapi/libxfce4windowing-0.vapi diff --git a/meson.build b/meson.build index 0220a9a..d2822e9 100644 --- a/meson.build +++ b/meson.build @@ -31,9 +31,10 @@ gnome_stack = '>= 3.24.0' dep_glib = dependency('glib-2.0', version: glib_dep) dep_gio = dependency('gio-unix-2.0', version: glib_dep) dep_gdk = dependency('gdk-3.0', version: gnome_stack) -dep_gdk_x11 = dependency('gdk-x11-3.0', version: gnome_stack) dep_gtk = dependency('gtk+-3.0', version: gnome_stack) dep_vala = dependency('vapigen', version: '>= 0.48.0') +dep_gtk_layer_shell = dependency('gtk-layer-shell-0', version: '>= 0.8.0') +dep_xfce4windowing = dependency('libxfce4windowing-0', version: '>= 4.19.7') # Make gettext work add_global_arguments('-DGETTEXT_PACKAGE="budgie-desktop-view"', language: 'c') diff --git a/src/budgie_desktop_view.vala b/src/budgie_desktop_view.vala index 01bcacb..c207a41 100644 --- a/src/budgie_desktop_view.vala +++ b/src/budgie_desktop_view.vala @@ -45,9 +45,9 @@ public const string[] SUPPORTED_TERMINALS = { }; public class DesktopView : Gtk.ApplicationWindow { - Screen default_screen; - Display default_display; - Monitor primary_monitor; + libxfce4windowing.Screen default_screen; + Gdk.Display default_display; + libxfce4windowing.Monitor? primary_monitor; Rectangle? primary_monitor_geo = null; UnifiedProps shared_props; Raven? raven = null; @@ -89,6 +89,16 @@ public class DesktopView : Gtk.ApplicationWindow { type_hint: Gdk.WindowTypeHint.DESKTOP ); + GtkLayerShell.init_for_window(this); + GtkLayerShell.set_layer(this, GtkLayerShell.Layer.BACKGROUND); + GtkLayerShell.set_anchor( + this, + GtkLayerShell.Edge.TOP | GtkLayerShell.Edge.LEFT, + true + ); + GtkLayerShell.set_keyboard_mode(this, GtkLayerShell.KeyboardMode.ON_DEMAND); + GtkLayerShell.try_force_commit(this); + shared_props = new UnifiedProps(); // Create shared props shared_props.cursor_changed.connect((cursor) => { get_window().set_cursor(cursor); @@ -143,8 +153,6 @@ public class DesktopView : Gtk.ApplicationWindow { } // Window settings - set_keep_below(true); // Stay below other windows - set_position(WindowPosition.CENTER); // Don't account for anything like current pouse position show_menubar = false; desktop_menu = new DesktopMenu(); // Create our new desktop menu @@ -160,11 +168,7 @@ public class DesktopView : Gtk.ApplicationWindow { get_display_geo(); // Set our geo - default_screen.composited_changed.connect(set_window_transparent); default_screen.monitors_changed.connect(on_resolution_change); - default_screen.size_changed.connect(on_resolution_change); - - setup_root_window_event_handler(); add(flow); @@ -480,7 +484,7 @@ public class DesktopView : Gtk.ApplicationWindow { // get_all_desktop_files will get all the files in our Desktop folder and generate items for them private void get_all_desktop_files() { var c = new Cancellable(); // Create a new cancellable stack - FileEnumerator? desktop_file_enumerator = null; + FileEnumerator? desktop_file_enumerator = null; try { desktop_file_enumerator = desktop_file.enumerate_children("standard::*,standard::display-name", FileQueryInfoFlags.NONE, c); @@ -511,16 +515,16 @@ public class DesktopView : Gtk.ApplicationWindow { // get_display_geo will get or update our primary monitor workarea private void get_display_geo() { - default_screen = Screen.get_default(); // Get our current default Screen - screen = default_screen; + default_screen = libxfce4windowing.Screen.get_default(); // Get our current default Screen + primary_monitor = default_screen.get_primary_monitor(); - default_display = Display.get_default(); // Get the display related to it + default_display = default_screen.gdk_screen.get_display(); // Get the display related to it shared_props.blocked_cursor = new Cursor.from_name(default_display, "not-allowed"); shared_props.hand_cursor = new Cursor.for_display(default_display, CursorType.ARROW); shared_props.loading_cursor = new Cursor.from_name(default_display, "progress"); shared_props.launch_context = default_display.get_app_launch_context(); // Get the app launch context for the default display - shared_props.launch_context.set_screen(default_screen); // Set the screen + shared_props.launch_context.set_screen(default_screen.gdk_screen); // Set the screen shared_props.launch_context.launch_started.connect(() => { shared_props.is_launching = true; @@ -537,11 +541,9 @@ public class DesktopView : Gtk.ApplicationWindow { shared_props.current_cursor = shared_props.hand_cursor; }); - primary_monitor = default_display.get_primary_monitor(); // Get the actual primary monitor for this display - primary_monitor_geo = primary_monitor.get_workarea(); // Get the working area of this monitor - shared_props.s_factor = primary_monitor.get_scale_factor(); // Get the current scaling factor - update_window_position(); + shared_props.s_factor = primary_monitor.get_scale(); // Get the current scaling factor + update_window_sizing(); } // get_mount_uuid will get a mount UUID and return it @@ -617,8 +619,8 @@ public class DesktopView : Gtk.ApplicationWindow { } else if (event.button == 3) { // Right click dismiss_raven(); // Dismiss raven - desktop_menu.place_on_monitor(primary_monitor); // Ensure menu is on primary monitor - desktop_menu.set_screen(default_screen); // Ensure menu is on our screen + desktop_menu.place_on_monitor(primary_monitor.gdk_monitor); // Ensure menu is on primary monitor + desktop_menu.set_screen(default_screen.gdk_screen); // Ensure menu is on our screen desktop_menu.popup_at_pointer(event); // Popup where our mouse is return Gdk.EVENT_STOP; @@ -958,7 +960,7 @@ public class DesktopView : Gtk.ApplicationWindow { if (visible_setting) { show(); - update_window_position(); + update_window_sizing(); } else { hide(); } @@ -1016,22 +1018,6 @@ public class DesktopView : Gtk.ApplicationWindow { enforce_content_limit(); // Update our flowbox content limit based on icon / item sizing } - public void setup_root_window_event_handler() { - Gdk.Window root_window = default_screen.get_root_window(); - root_window.set_events(EventMask.ALL_EVENTS_MASK); - - root_window.add_filter((xevent, e) => { - X.Event xev = *((X.Event*) xevent); - - if (xev.type != X.EventType.PropertyNotify) return FilterReturn.CONTINUE; - if (xev.xproperty.atom == Gdk.X11.get_xatom_by_name("_NET_WORKAREA")) { - get_display_geo(); - } - - return FilterReturn.CONTINUE; - }); - } - // create_fileitem_sorter will create our fileitem sorter // Folders should go before files, with the values of each being collated private void create_fileitem_sorter() { @@ -1108,9 +1094,10 @@ public class DesktopView : Gtk.ApplicationWindow { } } - private void update_window_position() { + private void update_window_sizing() { set_default_size(primary_monitor_geo.width, primary_monitor_geo.height); flow.set_size_request(primary_monitor_geo.width, primary_monitor_geo.height); - move(primary_monitor_geo.x, primary_monitor_geo.y); // Move the window to the x/y of our primary monitor + get_item_size(); // Update desired item spacing + enforce_content_limit(); } } diff --git a/src/desktop_item.vala b/src/desktop_item.vala index 91cb1be..3dfb738 100644 --- a/src/desktop_item.vala +++ b/src/desktop_item.vala @@ -187,14 +187,14 @@ public class DesktopItem : FlowBoxChild { icon = ico; // Set the icon - IconInfo? icon_info = props.icon_theme.lookup_by_gicon_for_scale(icon, props.icon_size, props.s_factor, IconLookupFlags.USE_BUILTIN & IconLookupFlags.GENERIC_FALLBACK); + IconInfo? icon_info = props.icon_theme.lookup_by_gicon_for_scale(icon, props.icon_size, (int) props.s_factor, IconLookupFlags.USE_BUILTIN & IconLookupFlags.GENERIC_FALLBACK); set_icon_from_iconinfo(icon_info); } // set_icon_from_name is responsible for setting our icon based on an icon name public void set_icon_from_name(string icon_name) throws Error { try { - Pixbuf? pix = props.icon_theme.load_icon_for_scale(icon_name, props.icon_size, props.s_factor, IconLookupFlags.GENERIC_FALLBACK); + Pixbuf? pix = props.icon_theme.load_icon_for_scale(icon_name, props.icon_size, (int) props.s_factor, IconLookupFlags.GENERIC_FALLBACK); set_image_pixbuf(pix); } catch (Error e) { throw e; diff --git a/src/meson.build b/src/meson.build index 6c49c2e..8f1e22e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -14,10 +14,11 @@ desktop_view_sources = [ desktop_view_deps = [ dep_gdk, - dep_gdk_x11, dep_glib, dep_gio, - dep_gtk + dep_gtk, + dep_gtk_layer_shell, + dep_xfce4windowing ] c_flags = [] @@ -31,6 +32,7 @@ executable( '--pkg', 'gio-unix-2.0', '--pkg', 'gtk+-3.0', '--target-glib=2.64', + '--vapidir', join_paths(meson.source_root(), 'vapi'), ], install: true, install_dir: join_paths(get_option('prefix'), get_option('bindir')), diff --git a/src/unified_props.vala b/src/unified_props.vala index be9a723..12b0209 100644 --- a/src/unified_props.vala +++ b/src/unified_props.vala @@ -42,7 +42,7 @@ public class UnifiedProps : Object { public FileMenu? file_menu; public IconTheme icon_theme; public int? icon_size; - public int? s_factor; + public uint? s_factor; public signal void cursor_changed(Gdk.Cursor cursor); public signal void thumbnail_size_changed(); diff --git a/vapi/libxfce4windowing-0-custom.vala b/vapi/libxfce4windowing-0-custom.vala new file mode 100644 index 0000000..f55ef86 --- /dev/null +++ b/vapi/libxfce4windowing-0-custom.vala @@ -0,0 +1,13 @@ + namespace libxfce4windowing { + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwApplication", type_id = "xfw_application_get_type ()")] + public abstract class Application : GLib.Object { + [CCode (cname = "xfw_application_get_instance")] + public unowned libxfce4windowing.ApplicationInstance? get_instance (libxfce4windowing.Window window); + } + + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspace", type_id = "xfw_workspace_get_type ()")] + public interface Workspace : GLib.Object { + [CCode (cname = "xfw_workspace_assign_to_workspace_group")] + public bool assign_to_workspace_group (libxfce4windowing.WorkspaceGroup group) throws GLib.Error; + } + } \ No newline at end of file diff --git a/vapi/libxfce4windowing-0.deps b/vapi/libxfce4windowing-0.deps new file mode 100644 index 0000000..bfc6c09 --- /dev/null +++ b/vapi/libxfce4windowing-0.deps @@ -0,0 +1,4 @@ +gdk-3.0 +glib-2.0 +gtk+-3.0 +libwnck-3.0 diff --git a/vapi/libxfce4windowing-0.vapi b/vapi/libxfce4windowing-0.vapi new file mode 100644 index 0000000..0332093 --- /dev/null +++ b/vapi/libxfce4windowing-0.vapi @@ -0,0 +1,586 @@ +/* libxfce4windowing-0.vapi generated by vapigen, do not modify. */ + +[CCode (cprefix = "libxfce4windowing", gir_namespace = "Libxfce4windowing", gir_version = "0.0", lower_case_cprefix = "libxfce4windowing_")] +namespace libxfce4windowing { + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwApplication", type_id = "xfw_application_get_type ()")] + public abstract class Application : GLib.Object { + [CCode (has_construct_function = false)] + protected Application (); + [CCode (cname = "xfw_application_get_class_id")] + [Version (since = "4.19.3")] + public unowned string get_class_id (); + [CCode (cname = "xfw_application_get_gicon")] + [Version (since = "4.19.1")] + public unowned GLib.Icon get_gicon (); + [CCode (cname = "xfw_application_get_icon")] + public unowned Gdk.Pixbuf? get_icon (int size, int scale); + [CCode (cname = "xfw_application_get_instance")] + public unowned libxfce4windowing.ApplicationInstance? get_instance (libxfce4windowing.Window window); + [CCode (cname = "xfw_application_get_instances")] + public unowned GLib.List? get_instances (); + [CCode (cname = "xfw_application_get_name")] + public unowned string get_name (); + [CCode (cname = "xfw_application_get_windows")] + public unowned GLib.List get_windows (); + [CCode (cname = "xfw_application_icon_is_fallback")] + [Version (since = "4.19.1")] + public bool icon_is_fallback (); + [NoAccessorMethod] + [Version (since = "4.19.3")] + public string class_id { owned get; } + [NoAccessorMethod] + public GLib.Icon gicon { owned get; } + [NoAccessorMethod] + public void* instances { get; } + [NoAccessorMethod] + public string name { owned get; } + [NoAccessorMethod] + public void* windows { get; } + public signal void icon_changed (); + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwApplicationInstance", has_type_id = false)] + [Compact] + public class ApplicationInstance { + [CCode (cname = "xfw_application_instance_get_name")] + [Version (since = "4.19.1")] + public unowned string get_name (); + [CCode (cname = "xfw_application_instance_get_pid")] + [Version (since = "4.19.1")] + public int get_pid (); + [CCode (cname = "xfw_application_instance_get_windows")] + [Version (since = "4.19.1")] + public unowned GLib.List get_windows (); + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwMonitor", type_id = "xfw_monitor_get_type ()")] + public abstract class Monitor : GLib.Object { + [CCode (has_construct_function = false)] + protected Monitor (); + [CCode (cname = "xfw_monitor_get_connector")] + [Version (since = "4.19.4")] + public unowned string get_connector (); + [CCode (cname = "xfw_monitor_get_description")] + [Version (since = "4.19.4")] + public unowned string get_description (); + [CCode (cname = "xfw_monitor_get_fractional_scale")] + [Version (since = "4.19.4")] + public double get_fractional_scale (); + [CCode (cname = "xfw_monitor_get_gdk_monitor")] + [Version (since = "4.19.4")] + public unowned Gdk.Monitor get_gdk_monitor (); + [CCode (cname = "xfw_monitor_get_identifier")] + [Version (since = "4.19.4")] + public unowned string get_identifier (); + [CCode (cname = "xfw_monitor_get_logical_geometry")] + [Version (since = "4.19.4")] + public Gdk.Rectangle get_logical_geometry (); + [CCode (cname = "xfw_monitor_get_make")] + [Version (since = "4.19.4")] + public unowned string? get_make (); + [CCode (cname = "xfw_monitor_get_model")] + [Version (since = "4.19.4")] + public unowned string? get_model (); + [CCode (cname = "xfw_monitor_get_physical_geometry")] + [Version (since = "4.19.4")] + public Gdk.Rectangle get_physical_geometry (); + [CCode (cname = "xfw_monitor_get_physical_size")] + [Version (since = "4.19.4")] + public void get_physical_size (out uint width_mm, out uint height_mm); + [CCode (cname = "xfw_monitor_get_refresh")] + [Version (since = "4.19.4")] + public uint get_refresh (); + [CCode (cname = "xfw_monitor_get_scale")] + [Version (since = "4.19.4")] + public uint get_scale (); + [CCode (cname = "xfw_monitor_get_serial")] + [Version (since = "4.19.4")] + public unowned string? get_serial (); + [CCode (cname = "xfw_monitor_get_subpixel")] + [Version (since = "4.19.4")] + public libxfce4windowing.MonitorSubpixel get_subpixel (); + [CCode (cname = "xfw_monitor_get_transform")] + [Version (since = "4.19.4")] + public libxfce4windowing.MonitorTransform get_transform (); + [CCode (cname = "xfw_monitor_get_workarea")] + [Version (since = "4.19.4")] + public Gdk.Rectangle get_workarea (); + [NoAccessorMethod] + [Version (since = "4.19.4")] + public string connector { owned get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public string description { owned get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public double fractional_scale { get; } + [NoAccessorMethod] + public Gdk.Monitor gdk_monitor { owned get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public uint height_mm { get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public string identifier { owned get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public bool is_primary { get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public Gdk.Rectangle logical_geometry { owned get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public string make { owned get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public string model { owned get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public Gdk.Rectangle physical_geometry { owned get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public uint refresh { get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public uint scale { get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public string serial { owned get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public libxfce4windowing.MonitorSubpixel subpixel { get; } + [NoAccessorMethod] + public libxfce4windowing.MonitorTransform transform { get; } + [NoAccessorMethod] + [Version (since = "4.19.4")] + public uint width_mm { get; } + [NoAccessorMethod] + public Gdk.Rectangle workarea { owned get; } + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwScreen", type_id = "xfw_screen_get_type ()")] + public abstract class Screen : GLib.Object { + [CCode (has_construct_function = false)] + protected Screen (); + [CCode (cname = "xfw_screen_get_active_window")] + public unowned libxfce4windowing.Window? get_active_window (); + [CCode (cname = "xfw_screen_get_default")] + public static libxfce4windowing.Screen get_default (); + [CCode (cname = "xfw_screen_get_monitors")] + [Version (since = "4.19.4")] + public unowned GLib.List? get_monitors (); + [CCode (cname = "xfw_screen_get_primary_monitor")] + [Version (since = "4.19.4")] + public unowned libxfce4windowing.Monitor? get_primary_monitor (); + [CCode (cname = "xfw_screen_get_seats")] + public unowned GLib.List? get_seats (); + [CCode (cname = "xfw_screen_get_show_desktop")] + public bool get_show_desktop (); + [CCode (cname = "xfw_screen_get_windows")] + public unowned GLib.List? get_windows (); + [CCode (cname = "xfw_screen_get_windows_stacked")] + public unowned GLib.List? get_windows_stacked (); + [CCode (cname = "xfw_screen_get_workspace_manager")] + public unowned libxfce4windowing.WorkspaceManager get_workspace_manager (); + [CCode (cname = "xfw_screen_set_show_desktop")] + public void set_show_desktop (bool show); + [NoAccessorMethod] + public libxfce4windowing.Window active_window { owned get; } + [NoAccessorMethod] + public Gdk.Screen gdk_screen { owned get; construct; } + [NoAccessorMethod] + public bool show_desktop { get; set; } + [NoAccessorMethod] + public libxfce4windowing.WorkspaceManager workspace_manager { owned get; } + public signal void active_window_changed (libxfce4windowing.Window window); + [Version (since = "4.19.4")] + public signal void monitor_added (libxfce4windowing.Monitor monitor); + [Version (since = "4.19.4")] + public signal void monitor_removed (libxfce4windowing.Monitor monitor); + [Version (since = "4.19.4")] + public signal void monitors_changed (); + public signal void seat_added (libxfce4windowing.Seat seat); + public signal void seat_removed (libxfce4windowing.Seat seat); + public signal void window_closed (libxfce4windowing.Window window); + public signal void window_manager_changed (); + public signal void window_opened (libxfce4windowing.Window window); + public signal void window_stacking_changed (); + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwSeat", type_id = "xfw_seat_get_type ()")] + public class Seat : GLib.Object { + [CCode (has_construct_function = false)] + protected Seat (); + [CCode (cname = "xfw_seat_get_name")] + public unowned string get_name (); + [NoAccessorMethod] + public string name { owned get; construct; } + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWindow", type_id = "xfw_window_get_type ()")] + public abstract class Window : GLib.Object { + [CCode (has_construct_function = false)] + protected Window (); + [CCode (cname = "xfw_window_activate")] + public bool activate (libxfce4windowing.Seat? seat, uint64 event_timestamp) throws GLib.Error; + [CCode (cname = "xfw_window_close")] + public bool close (uint64 event_timestamp) throws GLib.Error; + [CCode (cname = "xfw_window_get_application")] + public unowned libxfce4windowing.Application get_application (); + [CCode (cname = "xfw_window_get_capabilities")] + public libxfce4windowing.WindowCapabilities get_capabilities (); + [CCode (array_length = false, array_null_terminated = true, cname = "xfw_window_get_class_ids")] + [Version (since = "4.19.3")] + public unowned string[] get_class_ids (); + [CCode (cname = "xfw_window_get_geometry")] + public unowned Gdk.Rectangle? get_geometry (); + [CCode (cname = "xfw_window_get_gicon")] + [Version (since = "4.19.1")] + public unowned GLib.Icon get_gicon (); + [CCode (cname = "xfw_window_get_icon")] + public unowned Gdk.Pixbuf? get_icon (int size, int scale); + [CCode (cname = "xfw_window_get_monitors")] + public unowned GLib.List? get_monitors (); + [CCode (cname = "xfw_window_get_name")] + public unowned string? get_name (); + [CCode (cname = "xfw_window_get_screen")] + public unowned libxfce4windowing.Screen get_screen (); + [CCode (cname = "xfw_window_get_state")] + public libxfce4windowing.WindowState get_state (); + [CCode (cname = "xfw_window_get_window_type")] + public libxfce4windowing.WindowType get_window_type (); + [CCode (cname = "xfw_window_get_workspace")] + public unowned libxfce4windowing.Workspace? get_workspace (); + [CCode (cname = "xfw_window_icon_is_fallback")] + [Version (since = "4.19.1")] + public bool icon_is_fallback (); + [CCode (cname = "xfw_window_is_above")] + public bool is_above (); + [CCode (cname = "xfw_window_is_active")] + public bool is_active (); + [CCode (cname = "xfw_window_is_below")] + public bool is_below (); + [CCode (cname = "xfw_window_is_fullscreen")] + public bool is_fullscreen (); + [CCode (cname = "xfw_window_is_in_viewport")] + public bool is_in_viewport (libxfce4windowing.Workspace workspace); + [CCode (cname = "xfw_window_is_maximized")] + public bool is_maximized (); + [CCode (cname = "xfw_window_is_minimized")] + public bool is_minimized (); + [CCode (cname = "xfw_window_is_on_workspace")] + public bool is_on_workspace (libxfce4windowing.Workspace workspace); + [CCode (cname = "xfw_window_is_pinned")] + public bool is_pinned (); + [CCode (cname = "xfw_window_is_shaded")] + public bool is_shaded (); + [CCode (cname = "xfw_window_is_skip_pager")] + public bool is_skip_pager (); + [CCode (cname = "xfw_window_is_skip_tasklist")] + public bool is_skip_tasklist (); + [CCode (cname = "xfw_window_is_urgent")] + public bool is_urgent (); + [CCode (cname = "xfw_window_move_to_workspace")] + public bool move_to_workspace (libxfce4windowing.Workspace workspace) throws GLib.Error; + [CCode (cname = "xfw_window_set_above")] + public bool set_above (bool is_above) throws GLib.Error; + [CCode (cname = "xfw_window_set_below")] + public bool set_below (bool is_below) throws GLib.Error; + [CCode (cname = "xfw_window_set_button_geometry")] + public bool set_button_geometry (Gdk.Window relative_to, Gdk.Rectangle rect) throws GLib.Error; + [CCode (cname = "xfw_window_set_fullscreen")] + public bool set_fullscreen (bool is_fullscreen) throws GLib.Error; + [CCode (cname = "xfw_window_set_geometry")] + public bool set_geometry (Gdk.Rectangle rect) throws GLib.Error; + [CCode (cname = "xfw_window_set_maximized")] + public bool set_maximized (bool is_maximized) throws GLib.Error; + [CCode (cname = "xfw_window_set_minimized")] + public bool set_minimized (bool is_minimized) throws GLib.Error; + [CCode (cname = "xfw_window_set_pinned")] + public bool set_pinned (bool is_pinned) throws GLib.Error; + [CCode (cname = "xfw_window_set_shaded")] + public bool set_shaded (bool is_shaded) throws GLib.Error; + [CCode (cname = "xfw_window_set_skip_pager")] + public bool set_skip_pager (bool is_skip_pager) throws GLib.Error; + [CCode (cname = "xfw_window_set_skip_tasklist")] + public bool set_skip_tasklist (bool is_skip_tasklist) throws GLib.Error; + [CCode (cname = "xfw_window_start_move")] + public bool start_move () throws GLib.Error; + [CCode (cname = "xfw_window_start_resize")] + public bool start_resize () throws GLib.Error; + [CCode (cname = "xfw_window_x11_get_xid")] + public X.Window x11_get_xid (); + [NoAccessorMethod] + public libxfce4windowing.Application application { owned get; } + [NoAccessorMethod] + public libxfce4windowing.WindowCapabilities capabilities { get; } + [CCode (array_length = false, array_null_terminated = true)] + [NoAccessorMethod] + [Version (since = "4.19.3")] + public string[] class_ids { owned get; } + [NoAccessorMethod] + public GLib.Icon gicon { owned get; } + [NoAccessorMethod] + public void* monitors { get; } + [NoAccessorMethod] + public string name { owned get; } + [NoAccessorMethod] + public libxfce4windowing.Screen screen { owned get; construct; } + [NoAccessorMethod] + public libxfce4windowing.WindowState state { get; } + [NoAccessorMethod] + public libxfce4windowing.WindowType type { get; } + [NoAccessorMethod] + public libxfce4windowing.Workspace workspace { owned get; } + public signal void capabilities_changed (libxfce4windowing.WindowCapabilities changed_mask, libxfce4windowing.WindowCapabilities new_state); + [Version (since = "4.19.3")] + public signal void class_changed (); + public signal void closed (); + public signal void geometry_changed (); + public signal void icon_changed (); + public signal void name_changed (); + public signal void state_changed (libxfce4windowing.WindowState changed_mask, libxfce4windowing.WindowState new_state); + public signal void type_changed (libxfce4windowing.WindowType old_type); + public signal void workspace_changed (); + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspaceGroupInterface", has_type_id = false)] + [Compact] + public class WorkspaceGroupInterface { + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspaceInterface", has_type_id = false)] + [Compact] + public class WorkspaceInterface { + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspaceManagerInterface", has_type_id = false)] + [Compact] + public class WorkspaceManagerInterface { + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspace", type_id = "xfw_workspace_get_type ()")] + public interface Workspace : GLib.Object { + [CCode (cname = "xfw_workspace_activate")] + public bool activate () throws GLib.Error; + [CCode (cname = "xfw_workspace_assign_to_workspace_group")] + public bool assign_to_workspace_group (libxfce4windowing.WorkspaceGroup group) throws GLib.Error; + [CCode (cname = "xfw_workspace_get_capabilities")] + public libxfce4windowing.WorkspaceCapabilities get_capabilities (); + [CCode (cname = "xfw_workspace_get_geometry")] + public unowned Gdk.Rectangle? get_geometry (); + [CCode (cname = "xfw_workspace_get_id")] + public unowned string get_id (); + [CCode (cname = "xfw_workspace_get_layout_column")] + public int get_layout_column (); + [CCode (cname = "xfw_workspace_get_layout_row")] + public int get_layout_row (); + [CCode (cname = "xfw_workspace_get_name")] + public unowned string get_name (); + [CCode (cname = "xfw_workspace_get_neighbor")] + public unowned libxfce4windowing.Workspace? get_neighbor (libxfce4windowing.Direction direction); + [CCode (cname = "xfw_workspace_get_number")] + public uint get_number (); + [CCode (cname = "xfw_workspace_get_state")] + public libxfce4windowing.WorkspaceState get_state (); + [CCode (cname = "xfw_workspace_get_workspace_group")] + public unowned libxfce4windowing.WorkspaceGroup? get_workspace_group (); + [CCode (cname = "xfw_workspace_remove")] + public bool remove () throws GLib.Error; + [NoAccessorMethod] + public abstract libxfce4windowing.WorkspaceCapabilities capabilities { get; set construct; } + [NoAccessorMethod] + public abstract libxfce4windowing.WorkspaceGroup group { owned get; } + [NoAccessorMethod] + public abstract string id { owned get; } + [NoAccessorMethod] + public abstract int layout_column { get; } + [NoAccessorMethod] + public abstract int layout_row { get; } + [NoAccessorMethod] + public abstract string name { owned get; set construct; } + [NoAccessorMethod] + public abstract uint number { get; construct; } + [NoAccessorMethod] + public abstract libxfce4windowing.WorkspaceState state { get; set construct; } + public signal void capabilities_changed (libxfce4windowing.WorkspaceCapabilities changed_mask, libxfce4windowing.WorkspaceCapabilities new_capabilities); + public signal void group_changed (libxfce4windowing.WorkspaceGroup previous_group); + public signal void name_changed (); + public signal void state_changed (libxfce4windowing.WorkspaceState changed_mask, libxfce4windowing.WorkspaceState new_state); + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspaceGroup", type_id = "xfw_workspace_group_get_type ()")] + public interface WorkspaceGroup : GLib.Object { + [CCode (cname = "xfw_workspace_group_create_workspace")] + public bool create_workspace (string name) throws GLib.Error; + [CCode (cname = "xfw_workspace_group_get_active_workspace")] + public unowned libxfce4windowing.Workspace? get_active_workspace (); + [CCode (cname = "xfw_workspace_group_get_capabilities")] + public libxfce4windowing.WorkspaceGroupCapabilities get_capabilities (); + [CCode (cname = "xfw_workspace_group_get_monitors")] + public unowned GLib.List? get_monitors (); + [CCode (cname = "xfw_workspace_group_get_workspace_count")] + public uint get_workspace_count (); + [CCode (cname = "xfw_workspace_group_get_workspace_manager")] + public unowned libxfce4windowing.WorkspaceManager get_workspace_manager (); + [CCode (cname = "xfw_workspace_group_list_workspaces")] + public unowned GLib.List? list_workspaces (); + [CCode (cname = "xfw_workspace_group_move_viewport")] + public bool move_viewport (int x, int y) throws GLib.Error; + [CCode (cname = "xfw_workspace_group_set_layout")] + public bool set_layout (int rows, int columns) throws GLib.Error; + [NoAccessorMethod] + public abstract libxfce4windowing.Workspace active_workspace { owned get; } + [NoAccessorMethod] + public abstract void* monitors { get; } + [NoAccessorMethod] + public abstract libxfce4windowing.Screen screen { owned get; construct; } + [NoAccessorMethod] + public abstract libxfce4windowing.WorkspaceManager workspace_manager { owned get; construct; } + [NoAccessorMethod] + public abstract void* workspaces { get; } + public signal void active_workspace_changed (libxfce4windowing.Workspace? previously_active_workspace); + public signal void capabilities_changed (libxfce4windowing.WorkspaceGroupCapabilities changed_mask, libxfce4windowing.WorkspaceGroupCapabilities new_capabilities); + public signal void monitor_added (libxfce4windowing.Monitor monitor); + public signal void monitor_removed (libxfce4windowing.Monitor monitor); + public signal void monitors_changed (); + public signal void viewports_changed (); + public signal void workspace_added (libxfce4windowing.Workspace workspace); + public signal void workspace_removed (libxfce4windowing.Workspace workspace); + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspaceManager", type_id = "xfw_workspace_manager_get_type ()")] + public interface WorkspaceManager : GLib.Object { + [CCode (cname = "xfw_workspace_manager_list_workspace_groups")] + public unowned GLib.List? list_workspace_groups (); + [CCode (cname = "xfw_workspace_manager_list_workspaces")] + public unowned GLib.List? list_workspaces (); + [NoAccessorMethod] + public abstract libxfce4windowing.Screen screen { owned get; construct; } + public signal void workspace_created (libxfce4windowing.Workspace workspace); + public signal void workspace_destroyed (libxfce4windowing.Workspace workspace); + public signal void workspace_group_created (libxfce4windowing.WorkspaceGroup group); + public signal void workspace_group_destroyed (libxfce4windowing.WorkspaceGroup group); + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwClientType", cprefix = "XFW_CLIENT_TYPE_", has_type_id = false)] + [Version (since = "4.19.3")] + public enum ClientType { + APPLICATION, + PAGER + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwDirection", cprefix = "XFW_DIRECTION_", type_id = "xfw_direction_get_type ()")] + public enum Direction { + UP, + DOWN, + LEFT, + RIGHT + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwMonitorSubpixel", cprefix = "XFW_MONITOR_SUBPIXEL_", type_id = "xfw_monitor_subpixel_get_type ()")] + [Version (since = "4.19.4")] + public enum MonitorSubpixel { + UNKNOWN, + NONE, + HRGB, + HBGR, + VRGB, + VBGR + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwMonitorTransform", cprefix = "XFW_MONITOR_TRANSFORM_", type_id = "xfw_monitor_transform_get_type ()")] + [Version (since = "4.19.4")] + public enum MonitorTransform { + NORMAL, + @90, + @180, + @270, + FLIPPED, + FLIPPED_90, + FLIPPED_180, + FLIPPED_270 + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWindowCapabilities", cprefix = "XFW_WINDOW_CAPABILITIES_", type_id = "xfw_window_capabilities_get_type ()")] + [Flags] + public enum WindowCapabilities { + NONE, + CAN_MINIMIZE, + CAN_UNMINIMIZE, + CAN_MAXIMIZE, + CAN_UNMAXIMIZE, + CAN_FULLSCREEN, + CAN_UNFULLSCREEN, + CAN_SHADE, + CAN_UNSHADE, + CAN_MOVE, + CAN_RESIZE, + CAN_PLACE_ABOVE, + CAN_UNPLACE_ABOVE, + CAN_PLACE_BELOW, + CAN_UNPLACE_BELOW, + CAN_CHANGE_WORKSPACE + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWindowState", cprefix = "XFW_WINDOW_STATE_", type_id = "xfw_window_state_get_type ()")] + [Flags] + public enum WindowState { + NONE, + ACTIVE, + MINIMIZED, + MAXIMIZED, + FULLSCREEN, + SKIP_PAGER, + SKIP_TASKLIST, + PINNED, + SHADED, + ABOVE, + BELOW, + URGENT + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWindowType", cprefix = "XFW_WINDOW_TYPE_", type_id = "xfw_window_type_get_type ()")] + public enum WindowType { + NORMAL, + DESKTOP, + DOCK, + DIALOG, + TOOLBAR, + MENU, + UTILITY, + SPLASHSCREEN + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWindowing", cprefix = "XFW_WINDOWING_", has_type_id = false)] + public enum Windowing { + UNKNOWN, + X11, + WAYLAND + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspaceCapabilities", cprefix = "XFW_WORKSPACE_CAPABILITIES_", type_id = "xfw_workspace_capabilities_get_type ()")] + [Flags] + public enum WorkspaceCapabilities { + NONE, + ACTIVATE, + REMOVE + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspaceGroupCapabilities", cprefix = "XFW_WORKSPACE_GROUP_CAPABILITIES_", type_id = "xfw_workspace_group_capabilities_get_type ()")] + [Flags] + public enum WorkspaceGroupCapabilities { + NONE, + CREATE_WORKSPACE, + MOVE_VIEWPORT, + SET_LAYOUT + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwWorkspaceState", cprefix = "XFW_WORKSPACE_STATE_", type_id = "xfw_workspace_state_get_type ()")] + [Flags] + public enum WorkspaceState { + NONE, + ACTIVE, + URGENT, + HIDDEN, + VIRTUAL + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "XfwError", cprefix = "XFW_ERROR_", has_type_id = false)] + public errordomain Error { + UNSUPPORTED, + INTERNAL + } + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "LIBXFCE4WINDOWING_MAJOR_VERSION")] + public const int MAJOR_VERSION; + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "LIBXFCE4WINDOWING_MICRO_VERSION")] + public const int MICRO_VERSION; + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "LIBXFCE4WINDOWING_MINOR_VERSION")] + public const int MINOR_VERSION; + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h")] + public static unowned string? check_version (uint required_major, uint required_minor, uint required_micro); + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "xfw_error_quark")] + public static GLib.Quark error_quark (); + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "xfw_set_client_type")] + [Version (since = "4.19.3")] + public static void set_client_type (libxfce4windowing.ClientType client_type); + [CCode (cheader_filename = "libxfce4windowing/libxfce4windowing.h", cname = "xfw_windowing_get")] + public static libxfce4windowing.Windowing windowing_get (); +}