From 34aaac89abe70b2ae4861521a9ca6f29f179f0c8 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Wed, 30 Oct 2019 12:25:07 +0100 Subject: [PATCH 1/2] add support for mutter 3.3x --- vapi/libmutter-3.deps | 1 + vapi/libmutter-3.vapi | 1 + vapi/libmutter-4.deps | 1 + vapi/libmutter-4.vapi | 1 + vapi/libmutter-5.deps | 1 + vapi/libmutter-5.vapi | 1 + vapi/libmutter-6.deps | 1 + vapi/libmutter-6.vapi | 1 + vapi/libmutter.vapi | 480 ++++++++++++++++++++- vapi/mutter-clutter-3.deps | 5 + vapi/mutter-clutter-3.vapi | 1 + vapi/mutter-clutter-4.deps | 5 + vapi/mutter-clutter-4.vapi | 1 + vapi/mutter-clutter-5.deps | 5 + vapi/mutter-clutter-5.vapi | 1 + vapi/mutter-clutter-6.deps | 5 + vapi/mutter-clutter-6.vapi | 1 + vapi/mutter-cogl-3.deps | 1 + vapi/mutter-cogl-3.vapi | 1 + vapi/mutter-cogl-4.deps | 1 + vapi/mutter-cogl-4.vapi | 1 + vapi/mutter-cogl-5.deps | 1 + vapi/mutter-cogl-5.vapi | 1 + vapi/mutter-cogl-6.deps | 1 + vapi/mutter-cogl-6.vapi | 1 + vapi/mutter-cogl-pango-3.vapi | 0 vapi/mutter-cogl-pango-4.vapi | 0 vapi/mutter-cogl-pango-5.vapi | 0 vapi/mutter-cogl-pango-6.vapi | 0 vapi/mutter-cogl-path-3.vapi | 0 vapi/mutter-cogl-path-4.vapi | 0 vapi/mutter-cogl-path-5.vapi | 0 vapi/mutter-cogl-path-6.vapi | 0 wingpanel-interface/BackgroundManager.vala | 12 + wingpanel-interface/FocusManager.vala | 36 ++ wingpanel-interface/Main.vala | 8 + wingpanel-interface/meson.build | 44 +- 37 files changed, 607 insertions(+), 13 deletions(-) create mode 120000 vapi/libmutter-3.deps create mode 120000 vapi/libmutter-3.vapi create mode 120000 vapi/libmutter-4.deps create mode 120000 vapi/libmutter-4.vapi create mode 120000 vapi/libmutter-5.deps create mode 120000 vapi/libmutter-5.vapi create mode 120000 vapi/libmutter-6.deps create mode 120000 vapi/libmutter-6.vapi create mode 100644 vapi/mutter-clutter-3.deps create mode 120000 vapi/mutter-clutter-3.vapi create mode 100644 vapi/mutter-clutter-4.deps create mode 120000 vapi/mutter-clutter-4.vapi create mode 100644 vapi/mutter-clutter-5.deps create mode 120000 vapi/mutter-clutter-5.vapi create mode 100644 vapi/mutter-clutter-6.deps create mode 120000 vapi/mutter-clutter-6.vapi create mode 120000 vapi/mutter-cogl-3.deps create mode 120000 vapi/mutter-cogl-3.vapi create mode 120000 vapi/mutter-cogl-4.deps create mode 120000 vapi/mutter-cogl-4.vapi create mode 120000 vapi/mutter-cogl-5.deps create mode 120000 vapi/mutter-cogl-5.vapi create mode 120000 vapi/mutter-cogl-6.deps create mode 120000 vapi/mutter-cogl-6.vapi create mode 100644 vapi/mutter-cogl-pango-3.vapi create mode 100644 vapi/mutter-cogl-pango-4.vapi create mode 100644 vapi/mutter-cogl-pango-5.vapi create mode 100644 vapi/mutter-cogl-pango-6.vapi create mode 100644 vapi/mutter-cogl-path-3.vapi create mode 100644 vapi/mutter-cogl-path-4.vapi create mode 100644 vapi/mutter-cogl-path-5.vapi create mode 100644 vapi/mutter-cogl-path-6.vapi diff --git a/vapi/libmutter-3.deps b/vapi/libmutter-3.deps new file mode 120000 index 00000000..efe5ad15 --- /dev/null +++ b/vapi/libmutter-3.deps @@ -0,0 +1 @@ +libmutter-2.deps \ No newline at end of file diff --git a/vapi/libmutter-3.vapi b/vapi/libmutter-3.vapi new file mode 120000 index 00000000..22cc2387 --- /dev/null +++ b/vapi/libmutter-3.vapi @@ -0,0 +1 @@ +libmutter-2.vapi \ No newline at end of file diff --git a/vapi/libmutter-4.deps b/vapi/libmutter-4.deps new file mode 120000 index 00000000..7782137a --- /dev/null +++ b/vapi/libmutter-4.deps @@ -0,0 +1 @@ +libmutter.deps \ No newline at end of file diff --git a/vapi/libmutter-4.vapi b/vapi/libmutter-4.vapi new file mode 120000 index 00000000..12f9cc52 --- /dev/null +++ b/vapi/libmutter-4.vapi @@ -0,0 +1 @@ +libmutter.vapi \ No newline at end of file diff --git a/vapi/libmutter-5.deps b/vapi/libmutter-5.deps new file mode 120000 index 00000000..1a8df7c1 --- /dev/null +++ b/vapi/libmutter-5.deps @@ -0,0 +1 @@ +libmutter-4.deps \ No newline at end of file diff --git a/vapi/libmutter-5.vapi b/vapi/libmutter-5.vapi new file mode 120000 index 00000000..0aabcb7c --- /dev/null +++ b/vapi/libmutter-5.vapi @@ -0,0 +1 @@ +libmutter-4.vapi \ No newline at end of file diff --git a/vapi/libmutter-6.deps b/vapi/libmutter-6.deps new file mode 120000 index 00000000..80eee64b --- /dev/null +++ b/vapi/libmutter-6.deps @@ -0,0 +1 @@ +libmutter-5.deps \ No newline at end of file diff --git a/vapi/libmutter-6.vapi b/vapi/libmutter-6.vapi new file mode 120000 index 00000000..87b6e919 --- /dev/null +++ b/vapi/libmutter-6.vapi @@ -0,0 +1 @@ +libmutter-5.vapi \ No newline at end of file diff --git a/vapi/libmutter.vapi b/vapi/libmutter.vapi index 1cfb7026..f01c2913 100644 --- a/vapi/libmutter.vapi +++ b/vapi/libmutter.vapi @@ -55,8 +55,10 @@ namespace Meta { public static bool get_gnome_accessibility (); [CCode (cheader_filename = "meta/prefs.h")] public static bool get_gnome_animations (); +#if !HAS_MUTTER332 [CCode (cheader_filename = "meta/prefs.h")] public static bool get_ignore_request_hide_titlebar (); +#endif [CCode (cheader_filename = "meta/prefs.h")] public static Meta.KeyBindingAction get_keybinding_action (string name); [CCode (cheader_filename = "meta/prefs.h")] @@ -83,16 +85,24 @@ namespace Meta { public static bool get_workspaces_only_on_primary (); [CCode (cheader_filename = "meta/prefs.h")] public static void init (); +#if !HAS_MUTTER330 [CCode (cheader_filename = "meta/prefs.h")] public static void override_preference_schema (string key, string schema); +#endif [CCode (cheader_filename = "meta/prefs.h")] public static void remove_listener (Meta.PrefsChangedFunc func); [CCode (cheader_filename = "meta/prefs.h")] public static void set_force_fullscreen (bool whether); +#if !HAS_MUTTER332 [CCode (cheader_filename = "meta/prefs.h")] public static void set_ignore_request_hide_titlebar (bool whether); +#endif [CCode (cheader_filename = "meta/prefs.h")] public static void set_num_workspaces (int n_workspaces); +#if HAS_MUTTER330 + [CCode (cheader_filename = "meta/prefs.h")] + public static void set_show_fallback_app_menu (bool whether); +#endif } namespace Util { [CCode (cheader_filename = "meta/main.h", cname = "meta_add_verbose_topic")] @@ -101,6 +111,14 @@ namespace Meta { public static void bug (string format, ...); [CCode (cheader_filename = "meta/main.h", cname = "meta_debug_spew_real")] public static void debug_spew_real (string format, ...); +#if HAS_MUTTER330 + [CCode (cheader_filename = "meta/main.h", cname = "meta_disable_unredirect_for_display")] + public static void disable_unredirect_for_display (Meta.Display display); + [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_empty_stage_input_region")] + public static void empty_stage_input_region (Meta.Display display); + [CCode (cheader_filename = "meta/main.h", cname = "meta_enable_unredirect_for_display")] + public static void enable_unredirect_for_display (Meta.Display display); +#else [CCode (cheader_filename = "meta/main.h", cname = "meta_disable_unredirect_for_screen")] public static void disable_unredirect_for_screen (Meta.Screen screen); [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_empty_stage_input_region")] @@ -113,6 +131,7 @@ namespace Meta { public static int error_trap_pop_with_return (Meta.Display display); [CCode (cheader_filename = "meta/main.h", cname = "meta_error_trap_push")] public static void error_trap_push (Meta.Display display); +#endif [CCode (cheader_filename = "meta/main.h", cname = "meta_external_binding_name_for_action")] public static string external_binding_name_for_action (uint keybinding_action); [CCode (cheader_filename = "meta/main.h", cname = "meta_fatal")] @@ -124,7 +143,11 @@ namespace Meta { [CCode (cheader_filename = "meta/main.h", cname = "meta_get_locale_direction")] public static Meta.LocaleDirection get_locale_direction (); [CCode (cheader_filename = "meta/main.h", cname = "meta_get_overlay_window")] +#if HAS_MUTTER330 + public static X.Window get_overlay_window (Meta.Display display); +#else public static X.Window get_overlay_window (Meta.Screen screen); +#endif [CCode (cheader_filename = "meta/main.h", cname = "meta_gravity_to_string")] public static unowned string gravity_to_string (int gravity); [CCode (cheader_filename = "meta/main.h", cname = "meta_is_debugging")] @@ -148,7 +171,11 @@ namespace Meta { [CCode (cheader_filename = "meta/main.h", cname = "meta_remove_verbose_topic")] public static void remove_verbose_topic (Meta.DebugTopic topic); [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_set_stage_input_region")] +#if HAS_MUTTER330 + public static void set_stage_input_region (Meta.Display display, X.XserverRegion region); +#else public static void set_stage_input_region (Meta.Screen screen, X.XserverRegion region); +#endif [CCode (cheader_filename = "meta/main.h", cname = "meta_show_dialog")] public static GLib.Pid show_dialog (string type, string message, string? timeout = null, string? display = null, string? ok_text = null, string? cancel_text = null, string? icon_name = null, int transient_for = 0, GLib.SList? columns = null, GLib.SList? entries = null); [CCode (cheader_filename = "meta/main.h", cname = "meta_topic_real")] @@ -161,6 +188,16 @@ namespace Meta { public static void verbose_real (string format, ...); [CCode (cheader_filename = "meta/main.h", cname = "meta_warning")] public static void warning (string format, ...); +#if HAS_MUTTER330 + [CCode (cheader_filename = "meta/main.h", cname = "meta_x11_error_trap_pop")] + public static void x11_error_trap_pop (Meta.X11Display x11_display); + [CCode (cheader_filename = "meta/main.h", cname = "meta_x11_error_trap_pop_with_return")] + public static int x11_error_trap_pop_with_return (Meta.X11Display x11_display); + [CCode (cheader_filename = "meta/main.h", cname = "meta_x11_error_trap_push")] + public static void x11_error_trap_push (Meta.X11Display x11_display); + [CCode (cheader_filename = "meta/main.h", cname = "meta_x11_init_gdk_display")] + public static bool x11_init_gdk_display () throws GLib.Error; +#endif } [CCode (cheader_filename = "meta/main.h", type_id = "meta_backend_get_type ()")] #if HAS_MUTTER322 @@ -175,10 +212,13 @@ namespace Meta { #if HAS_MUTTER324 public unowned Meta.Dnd get_dnd (); #endif - public unowned Clutter.Actor get_stage (); +#if HAS_MUTTER330 + public unowned Meta.RemoteAccessController get_remote_access_controller (); +#endif #if HAS_MUTTER326 - public int get_ui_scaling_factor (); + public unowned Meta.Settings get_settings (); #endif + public unowned Clutter.Actor get_stage (); public void lock_layout_group (uint idx); public void set_keymap (string layouts, string variants, string options); #if HAS_MUTTER322 @@ -187,35 +227,63 @@ namespace Meta { public signal void keymap_changed (); public signal void keymap_layout_group_changed (uint object); public signal void last_device_changed (int object); -#if HAS_MUTTER326 - public signal void x11_display_opened (); +#if HAS_MUTTER330 + public signal void lid_is_closed_changed (bool object); #endif } [CCode (cheader_filename = "meta/meta-background.h", type_id = "meta_background_get_type ()")] public class Background : GLib.Object { [CCode (has_construct_function = false)] +#if HAS_MUTTER330 + public Background (Meta.Display display); +#else public Background (Meta.Screen screen); +#endif public static void refresh_all (); public void set_blend (GLib.File file1, GLib.File file2, double blend_factor, GDesktop.BackgroundStyle style); public void set_color (Clutter.Color color); public void set_file (GLib.File file, GDesktop.BackgroundStyle style); public void set_gradient (GDesktop.BackgroundShading shading_direction, Clutter.Color color, Clutter.Color second_color); [NoAccessorMethod] +#if HAS_MUTTER330 + public Meta.Display meta_display { owned get; construct; } +#else public Meta.Screen meta_screen { owned get; construct; } +#endif public signal void changed (); } [CCode (cheader_filename = "meta/meta-background-actor.h", type_id = "meta_background_actor_get_type ()")] public class BackgroundActor : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { [CCode (has_construct_function = false, type = "ClutterActor*")] +#if HAS_MUTTER330 + public BackgroundActor (Meta.Display display, int monitor); +#else public BackgroundActor (Meta.Screen screen, int monitor); +#endif public void set_background (Meta.Background background); +#if HAS_MUTTER326 + public void set_gradient (bool enabled, int height, double tone_start); + public void set_monitor (int monitor); +#endif public void set_vignette (bool enabled, double brightness, double sharpness); [NoAccessorMethod] public Meta.Background background { owned get; set; } [NoAccessorMethod] public double brightness { get; set; } +#if HAS_MUTTER326 [NoAccessorMethod] + public bool gradient { get; set; } + [NoAccessorMethod] + public int gradient_height { get; set; } + [NoAccessorMethod] + public double gradient_max_darkness { get; set; } +#endif + [NoAccessorMethod] +#if HAS_MUTTER330 + public Meta.Display meta_display { owned get; construct; } +#else public Meta.Screen meta_screen { owned get; construct; } +#endif [NoAccessorMethod] public int monitor { get; construct; } [NoAccessorMethod] @@ -286,6 +354,21 @@ namespace Meta { public void add_window (Meta.Window window); public void destroy (); public bool filter_keybinding (Meta.KeyBinding binding); +#if HAS_MUTTER330 + public void flash_display (Meta.Display display); + [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_focus_stage_window")] + public static void focus_stage_window (Meta.Display display, uint32 timestamp); + [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_feedback_group_for_display")] + public static unowned Clutter.Actor get_feedback_group_for_display (Meta.Display display); + [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_stage_for_display")] + public static unowned Clutter.Actor? get_stage_for_display (Meta.Display display); + [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_top_window_group_for_display")] + public static unowned Clutter.Actor? get_top_window_group_for_display (Meta.Display display); + [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_window_actors")] + public static unowned GLib.List? get_window_actors (Meta.Display display); + [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_window_group_for_display")] + public static unowned Clutter.Actor? get_window_group_for_display (Meta.Display display); +#else public void flash_screen (Meta.Screen screen); [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_focus_stage_window")] public static void focus_stage_window (Meta.Screen screen, uint32 timestamp); @@ -299,6 +382,7 @@ namespace Meta { public static unowned GLib.List? get_window_actors (Meta.Screen screen); [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_window_group_for_screen")] public static unowned Clutter.Actor? get_window_group_for_screen (Meta.Screen screen); +#endif public void hide_tile_preview (); public void hide_window (Meta.Window window, Meta.CompEffect effect); public void manage (); @@ -311,8 +395,10 @@ namespace Meta { public void show_window_menu (Meta.Window window, Meta.WindowMenuType menu, int x, int y); public void show_window_menu_for_rect (Meta.Window window, Meta.WindowMenuType menu, Meta.Rectangle rect); public void size_change_window (Meta.Window window, Meta.SizeChange which_change, Meta.Rectangle old_frame_rect, Meta.Rectangle old_buffer_rect); +#if !HAS_MUTTER328 [CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_stage_is_focused")] public static bool stage_is_focused (Meta.Screen screen); +#endif public void switch_workspace (Meta.Workspace from, Meta.Workspace to, Meta.MotionDirection direction); public void sync_stack (GLib.List stack); public void sync_updates_frozen (Meta.Window window); @@ -326,68 +412,158 @@ namespace Meta { public class CursorTracker : GLib.Object { [CCode (has_construct_function = false)] protected CursorTracker (); +#if HAS_MUTTER330 + public static unowned Meta.CursorTracker get_for_display (Meta.Display display); +#else public static unowned Meta.CursorTracker get_for_screen (Meta.Screen screen); +#endif public void get_hot (out int x, out int y); - public void get_pointer (int x, int y, Clutter.ModifierType mods); + public void get_pointer (out int x, out int y, out Clutter.ModifierType mods); +#if HAS_MUTTER334 + public bool get_pointer_visible (); +#endif public unowned Cogl.Texture get_sprite (); public void set_pointer_visible (bool visible); public signal void cursor_changed (); +#if HAS_MUTTER332 + public signal void cursor_moved (float object, float p0); +#endif +#if HAS_MUTTER334 + public signal void visibility_changed (); +#endif + } +#if HAS_MUTTER328 && !HAS_MUTTER332 + [CCode (cheader_filename = "meta/main.h", type_id = "meta_dbus_display_config_skeleton_get_type ()")] + public class DBusDisplayConfigSkeleton : GLib.DBusInterfaceSkeleton, GLib.DBusInterface { + [CCode (has_construct_function = false)] + protected DBusDisplayConfigSkeleton (); } +#endif [CCode (cheader_filename = "meta/display.h", type_id = "meta_display_get_type ()")] public class Display : GLib.Object { [CCode (has_construct_function = false)] protected Display (); public void add_ignored_crossing_serial (ulong serial); public uint add_keybinding (string name, GLib.Settings settings, Meta.KeyBindingFlags flags, owned Meta.KeyHandlerFunc handler); +#if HAS_MUTTER330 + public bool begin_grab_op (Meta.Window window, Meta.GrabOp op, bool pointer_already_grabbed, bool frame_action, int button, ulong modmask, uint32 timestamp, int root_x, int root_y); +#else public bool begin_grab_op (Meta.Screen screen, Meta.Window window, Meta.GrabOp op, bool pointer_already_grabbed, bool frame_action, int button, ulong modmask, uint32 timestamp, int root_x, int root_y); +#endif public void clear_mouse_mode (); +#if HAS_MUTTER330 + public void close (uint32 timestamp); +#endif public void end_grab_op (uint32 timestamp); +#if HAS_MUTTER330 + public void focus_default_window (uint32 timestamp); +#else public void focus_the_no_focus_window (Meta.Screen screen, uint32 timestamp); +#endif public void freeze_keyboard (uint32 timestamp); public unowned Meta.Compositor get_compositor (); +#if HAS_MUTTER330 + public int get_current_monitor (); +#endif public uint32 get_current_time (); public uint32 get_current_time_roundtrip (); +#if !HAS_MUTTER330 public int get_damage_event_base (); +#endif public unowned Meta.Window get_focus_window (); public Meta.GrabOp get_grab_op (); public uint get_keybinding_action (uint keycode, ulong mask); public uint32 get_last_user_time (); +#if HAS_MUTTER330 + public Meta.Rectangle get_monitor_geometry (int monitor); + public bool get_monitor_in_fullscreen (int monitor); + public int get_monitor_index_for_rect (Meta.Rectangle rect); + public int get_monitor_neighbor_index (int which_monitor, Meta.DisplayDirection dir); +#if HAS_MUTTER332 + public float get_monitor_scale (int monitor); +#endif + public int get_n_monitors (); +#endif #if HAS_MUTTER322 public string get_pad_action_label (Clutter.InputDevice pad, Meta.PadActionType action_type, uint action_number); #endif +#if HAS_MUTTER330 + public int get_primary_monitor (); + public void get_size (out int width, out int height); +#if HAS_MUTTER332 + public unowned Meta.SoundPlayer get_sound_player (); + public unowned Meta.StartupNotification get_startup_notification (); +#else + public unowned GLib.SList get_startup_sequences (); +#endif +#else public int get_shape_event_base (); +#endif public unowned Meta.Window get_tab_current (Meta.TabList type, Meta.Workspace workspace); public GLib.List get_tab_list (Meta.TabList type, Meta.Workspace? workspace); public unowned Meta.Window get_tab_next (Meta.TabList type, Meta.Workspace workspace, Meta.Window? window, bool backward); +#if HAS_MUTTER330 + public unowned Meta.WorkspaceManager get_workspace_manager (); + public unowned Meta.X11Display get_x11_display (); +#else public unowned X.Display get_xdisplay (); public int get_xinput_opcode (); +#endif +#if HAS_MUTTER332 + public uint grab_accelerator (string accelerator, Meta.KeyBindingFlags flags); +#else public uint grab_accelerator (string accelerator); +#endif +#if !HAS_MUTTER330 public bool has_shape (); +#endif public bool is_pointer_emulating_sequence (Clutter.EventSequence? sequence); +#if !HAS_MUTTER330 public unowned Meta.Group lookup_group (X.Window group_leader); +#endif public bool remove_keybinding (string name); #if HAS_MUTTER322 public void request_pad_osd (Clutter.InputDevice pad, bool edition_mode); #endif +#if HAS_MUTTER330 + public void set_cursor (Meta.Cursor cursor); +#else public void set_input_focus_window (Meta.Window window, bool focus_frame, uint32 timestamp); +#endif public GLib.SList sort_windows_by_stacking (GLib.SList windows); public bool supports_extended_barriers (); public void unfreeze_keyboard (uint32 timestamp); public bool ungrab_accelerator (uint action_id); public void ungrab_keyboard (uint32 timestamp); +#if !HAS_MUTTER330 public void unmanage_screen (Meta.Screen screen, uint32 timestamp); +#endif public bool xserver_time_is_before (uint32 time1, uint32 time2); +#if !HAS_MUTTER330 public bool xwindow_is_a_no_focus_window (X.Window xwindow); +#endif public signal void accelerator_activated (uint object, uint p0, uint p1); +#if HAS_MUTTER330 + public signal void cursor_updated (); +#endif #if HAS_MUTTER322 public signal void gl_video_memory_purged (); #endif +#if HAS_MUTTER330 + public signal void grab_op_begin (Meta.Display object, Meta.Window p0, Meta.GrabOp p1); + public signal void grab_op_end (Meta.Display object, Meta.Window p0, Meta.GrabOp p1); + public signal void in_fullscreen_changed (); +#else public signal void grab_op_begin (Meta.Screen object, Meta.Window p0, Meta.GrabOp p1); public signal void grab_op_end (Meta.Screen object, Meta.Window p0, Meta.GrabOp p1); +#endif public signal bool modifiers_accelerator_activated (); public signal void overlay_key (); #if HAS_MUTTER324 public signal void pad_mode_switch (Clutter.InputDevice object, uint p0, uint p1); +#endif +#if HAS_MUTTER330 + public signal void restacked (); #endif public signal bool restart (); #if HAS_MUTTER324 @@ -398,9 +574,24 @@ namespace Meta { #endif public signal bool show_resize_popup (bool object, Meta.Rectangle p0, int p1, int p2); public signal bool show_restart_message (string? message); +#if HAS_MUTTER330 + public signal void showing_desktop_changed (); +#if !HAS_MUTTER332 + public signal void startup_sequence_changed (void* object); +#endif +#endif public signal void window_created (Meta.Window object); public signal void window_demands_attention (Meta.Window object); +#if HAS_MUTTER330 + public signal void window_entered_monitor (int object, Meta.Window p0); + public signal void window_left_monitor (int object, Meta.Window p0); +#endif public signal void window_marked_urgent (Meta.Window object); +#if HAS_MUTTER330 + public signal void workareas_changed (); + public signal void x11_display_closing (); + public signal void x11_display_opened (); +#endif } #if HAS_MUTTER324 [CCode (cheader_filename = "meta/meta-dnd.h", type_id = "meta_dnd_get_type ()")] @@ -449,26 +640,63 @@ namespace Meta { [CCode (cheader_filename = "meta/keybindings.h", cname = "meta_keybindings_set_custom_handler")] public static bool set_custom_handler (string name, owned Meta.KeyHandlerFunc? handler); } +#if HAS_MUTTER332 + [CCode (cheader_filename = "meta/main.h", type_id = "meta_launch_context_get_type ()")] + public class LaunchContext : GLib.AppLaunchContext { + [CCode (has_construct_function = false)] + protected LaunchContext (); + public void set_timestamp (uint32 timestamp); + public void set_workspace (Meta.Workspace workspace); + [NoAccessorMethod] + public Meta.Display display { owned get; construct; } + [NoAccessorMethod] + public uint timestamp { get; set; } + [NoAccessorMethod] + public Meta.Workspace workspace { owned get; set; } + } +#endif [CCode (cheader_filename = "meta/meta-monitor-manager.h", type_id = "meta_monitor_manager_get_type ()")] +#if HAS_MUTTER332 + public class MonitorManager : GLib.Object { +#elif HAS_MUTTER328 + public abstract class MonitorManager : Meta.DBusDisplayConfigSkeleton, GLib.DBusInterface { +#else public abstract class MonitorManager : GLib.DBusInterfaceSkeleton, GLib.DBusInterface { +#endif [CCode (has_construct_function = false)] protected MonitorManager (); #if HAS_MUTTER326 public bool can_switch_config (); #endif public static unowned Meta.MonitorManager @get (); +#if HAS_MUTTER326 + public static int get_display_configuration_timeout (); +#endif #if HAS_MUTTER322 public bool get_is_builtin_display_on (); #endif #if HAS_MUTTER326 public int get_monitor_for_connector (string connector); #endif +#if !HAS_MUTTER328 public int get_monitor_for_output (uint id); +#endif public signal void confirm_display_change (); #if HAS_MUTTER326 public Meta.MonitorSwitchConfigType get_switch_config (); public void switch_config (Meta.MonitorSwitchConfigType config_type); #endif +#if HAS_MUTTER328 + [NoAccessorMethod] + public Meta.Backend backend { owned get; construct; } +#if HAS_MUTTER332 + public signal void monitors_changed (); +#endif + public signal void monitors_changed_internal (); +#if HAS_MUTTER332 + public signal void power_save_mode_changed (); +#endif +#endif #if HAS_MUTTER324 && !HAS_MUTTER326 public signal void lid_is_closed_changed (); #endif @@ -484,13 +712,19 @@ namespace Meta { #if HAS_MUTTER326 [NoWrapper] public virtual unowned Meta.CloseDialog create_close_dialog (Meta.Window window); + [NoWrapper] + public virtual unowned Meta.InhibitShortcutsDialog create_inhibit_shortcuts_dialog (Meta.Window window); #endif [NoWrapper] public virtual void destroy (Meta.WindowActor actor); public void destroy_completed (Meta.WindowActor actor); public void end_modal (uint32 timestamp); public unowned Meta.PluginInfo? get_info (); +#if HAS_MUTTER330 + public unowned Meta.Display get_display (); +#else public unowned Meta.Screen get_screen (); +#endif [NoWrapper] public virtual void hide_tile_preview (); [NoWrapper] @@ -532,6 +766,21 @@ namespace Meta { [NoWrapper] public virtual bool xevent_filter (X.Event event); } +#if HAS_MUTTER330 + [CCode (cheader_filename = "meta/main.h", type_id = "meta_remote_access_controller_get_type ()")] + public class RemoteAccessController : GLib.Object { + [CCode (has_construct_function = false)] + protected RemoteAccessController (); + public signal void new_handle (Meta.RemoteAccessHandle object); + } + [CCode (cheader_filename = "meta/main.h", type_id = "meta_remote_access_handle_get_type ()")] + public class RemoteAccessHandle : GLib.Object { + [CCode (has_construct_function = false)] + protected RemoteAccessHandle (); + public virtual void stop (); + public signal void stopped (); + } +#else [CCode (cheader_filename = "meta/screen.h", type_id = "meta_screen_get_type ()")] public class Screen : GLib.Object { [CCode (has_construct_function = false)] @@ -539,6 +788,7 @@ namespace Meta { public unowned Meta.Workspace? append_new_workspace (bool activate, uint32 timestamp); public void focus_default_window (uint32 timestamp); public unowned Meta.Workspace get_active_workspace (); + public void reorder_workspace (Meta.Workspace workspace, int new_index); public int get_active_workspace_index (); public int get_current_monitor (); #if !HAS_MUTTER324 @@ -572,7 +822,9 @@ namespace Meta { public signal void workspace_added (int object); public signal void workspace_removed (int object); public signal void workspace_switched (int object, int p0, Meta.MotionDirection p1); + public signal void workspaces_reordered (); } +#endif #if HAS_MUTTER326 [CCode (cheader_filename = "meta/meta-settings.h", has_type_id = false)] [Compact] @@ -585,7 +837,11 @@ namespace Meta { [Compact] public class Shadow { public void get_bounds (int window_x, int window_y, int window_width, int window_height, Cairo.RectangleInt bounds); +#if HAS_MUTTER332 + public void paint (Cogl.Framebuffer framebuffer, int window_x, int window_y, int window_width, int window_height, uint8 opacity, Cairo.Region? clip, bool clip_strictly); +#else public void paint (int window_x, int window_y, int window_width, int window_height, uint8 opacity, Cairo.Region? clip, bool clip_strictly); +#endif public Meta.Shadow @ref (); public void unref (); } @@ -611,6 +867,63 @@ namespace Meta { public bool update_area (int x, int y, int width, int height); public signal void size_changed (); } +#if HAS_MUTTER332 + [CCode (cheader_filename = "meta/main.h", type_id = "meta_sound_player_get_type ()")] + public class SoundPlayer : GLib.Object { + [CCode (has_construct_function = false)] + protected SoundPlayer (); + public void play_from_file (GLib.File file, string description, GLib.Cancellable? cancellable = null); + public void play_from_theme (string name, string description, GLib.Cancellable? cancellable = null); + } +#endif +#if HAS_MUTTER328 + [CCode (cheader_filename = "meta/main.h", type_id = "meta_stage_get_type ()")] + public class Stage : Clutter.Stage, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { + [CCode (has_construct_function = false)] + protected Stage (); +#if HAS_MUTTER330 + public static bool is_focused (Meta.Display display); +#else + public static bool is_focused (Meta.Screen screen); +#endif +#if HAS_MUTTER332 + public signal void actors_painted (); +#endif + } +#endif +#if HAS_MUTTER332 + [CCode (cheader_filename = "meta/main.h", type_id = "meta_startup_notification_get_type ()")] + public class StartupNotification : GLib.Object { + [CCode (has_construct_function = false)] + protected StartupNotification (); + public Meta.LaunchContext create_launcher (); + [NoAccessorMethod] + public Meta.Display display { owned get; construct; } + public signal void changed (void* object); + } + [CCode (cheader_filename = "meta/main.h", type_id = "meta_startup_sequence_get_type ()")] + public class StartupSequence : GLib.Object { + [CCode (has_construct_function = false)] + protected StartupSequence (); + public unowned string get_application_id (); + public bool get_completed (); + public unowned string get_icon_name (); + public unowned string get_id (); + public unowned string get_name (); + public uint64 get_timestamp (); + public unowned string get_wmclass (); + public int get_workspace (); + public string application_id { get; construct; } + public string icon_name { get; construct; } + public string id { get; construct; } + public string name { get; construct; } + public uint64 timestamp { get; construct; } + public string wmclass { get; construct; } + public int workspace { get; construct; } + [HasEmitter] + public signal void complete (); + } +#endif [CCode (cheader_filename = "meta/theme.h", has_type_id = false)] [Compact] public class Theme { @@ -650,10 +963,13 @@ namespace Meta { #endif public Meta.Rectangle get_buffer_rect (); public unowned string get_client_machine (); +#if HAS_MUTTER332 + public Meta.WindowClientType get_client_type (); +#endif public unowned GLib.Object get_compositor_private (); public unowned string get_description (); public unowned Meta.Display get_display (); -#if HAS_MUTTER322 +#if HAS_MUTTER322 && !HAS_MUTTER328 public unowned string get_flatpak_id (); #endif public unowned Meta.Frame get_frame (); @@ -669,13 +985,21 @@ namespace Meta { public unowned string get_gtk_unique_bus_name (); public unowned string get_gtk_window_object_path (); public bool get_icon_geometry (out Meta.Rectangle rect); +#if HAS_MUTTER332 + public uint64 get_id (); +#endif public Meta.StackLayer get_layer (); public Meta.MaximizeFlags get_maximized (); public int get_monitor (); public unowned string get_mutter_hints (); public int get_pid (); public unowned string get_role (); +#if HAS_MUTTER328 + public unowned string get_sandboxed_app_id (); +#endif +#if !HAS_MUTTER330 public unowned Meta.Screen get_screen (); +#endif public uint get_stable_sequence (); public unowned string get_startup_id (); public unowned Meta.Window? get_tile_match (); @@ -779,17 +1103,26 @@ namespace Meta { public signal void focused (); public signal void position_changed (); public signal void raised (); +#if HAS_MUTTER330 + public signal void shown (); +#endif public signal void size_changed (); public signal void unmanaged (); public signal void workspace_changed (); } [CCode (cheader_filename = "meta/meta-window-actor.h", type_id = "meta_window_actor_get_type ()")] +#if HAS_MUTTER332 + public abstract class WindowActor : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { +#else public class WindowActor : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { +#endif [CCode (has_construct_function = false)] protected WindowActor (); public unowned Meta.Window get_meta_window (); public unowned Clutter.Actor get_texture (); +#if !HAS_MUTTER332 public X.Window get_x_window (); +#endif public bool is_destroyed (); #if HAS_MUTTER322 public void sync_visibility (); @@ -798,8 +1131,18 @@ namespace Meta { public string shadow_class { owned get; set; } [NoAccessorMethod] public Meta.ShadowMode shadow_mode { get; set; } +#if HAS_MUTTER330 + public signal void effects_completed (); +#endif public signal void first_frame (); } +#if HAS_MUTTER328 + [CCode (cheader_filename = "meta/main.h", type_id = "meta_window_group_get_type ()")] + public class WindowGroup : Clutter.Actor, Atk.Implementor, Clutter.Animatable, Clutter.Container, Clutter.Scriptable { + [CCode (has_construct_function = false)] + protected WindowGroup (); + } +#endif [CCode (cheader_filename = "meta/meta_window_shape.h", ref_function = "meta_window_shape_ref", type_id = "meta_window_shape_get_type ()", unref_function = "meta_window_shape_unref")] [Compact] public class WindowShape { @@ -819,12 +1162,16 @@ namespace Meta { public void activate (uint32 timestamp); public void activate_with_focus (Meta.Window focus_this, uint32 timestamp); public unowned Meta.Workspace get_neighbor (Meta.MotionDirection direction); +#if HAS_MUTTER330 + public unowned Meta.Display get_display (); +#else public unowned Meta.Screen get_screen (); +#endif public Meta.Rectangle get_work_area_all_monitors (); public Meta.Rectangle get_work_area_for_monitor (int which_monitor); public int index (); public GLib.List list_windows (); - public void set_builtin_struts (GLib.SList struts); + public void set_builtin_struts (GLib.SList struts); [NoAccessorMethod] public uint n_windows { get; } [NoAccessorMethod] @@ -832,7 +1179,65 @@ namespace Meta { public signal void window_added (Meta.Window object); public signal void window_removed (Meta.Window object); } +#if HAS_MUTTER330 + [CCode (cheader_filename = "meta/main.h", type_id = "meta_workspace_manager_get_type ()")] + public class WorkspaceManager : GLib.Object { + [CCode (has_construct_function = false)] + protected WorkspaceManager (); + public unowned Meta.Workspace append_new_workspace (bool activate, uint32 timestamp); + public unowned Meta.Workspace get_active_workspace (); + public int get_active_workspace_index (); + public int get_n_workspaces (); + public unowned Meta.Workspace get_workspace_by_index (int index); + public void override_workspace_layout (Meta.DisplayCorner starting_corner, bool vertical_layout, int n_rows, int n_columns); + public void remove_workspace (Meta.Workspace workspace, uint32 timestamp); +#if HAS_MUTTER334 + public void reorder_workspace (Meta.Workspace workspace, int new_index); +#endif + public int n_workspaces { get; } + public signal void active_workspace_changed (); + public signal void showing_desktop_changed (); + public signal void workspace_added (int object); + public signal void workspace_removed (int object); + public signal void workspace_switched (int object, int p0, Meta.MotionDirection p1); +#if HAS_MUTTER334 + public signal void workspaces_reordered (); +#endif + } + [CCode (cheader_filename = "meta/main.h", type_id = "meta_x11_display_get_type ()")] + public class X11Display : GLib.Object { + [CCode (has_construct_function = false)] + protected X11Display (); +#if HAS_MUTTER334 + public void clear_stage_input_region (); + public void set_stage_input_region (X.XserverRegion region); +#endif +#if !HAS_MUTTER334 + public void focus_the_no_focus_window (uint32 timestamp); +#endif + public int get_damage_event_base (); + public int get_screen_number (); + public int get_shape_event_base (); + public unowned X.Display get_xdisplay (); + public unowned X.Window get_xroot (); + public bool has_shape (); + public void set_cm_selection (); +#if !HAS_MUTTER334 + public void set_input_focus_window (Meta.Window window, bool focus_frame, uint32 timestamp); +#endif + public bool xwindow_is_a_no_focus_window (X.Window xwindow); + } +#endif #if HAS_MUTTER326 + [CCode (cheader_filename = "meta/main.h", type_cname = "MetaInhibitShortcutsDialogInterface", type_id = "meta_inhibit_shortcuts_dialog_get_type ()")] + public interface InhibitShortcutsDialog : GLib.Object { + public abstract void hide (); + public abstract void show (); + [NoAccessorMethod] + public abstract Meta.Window window { owned get; construct; } + [HasEmitter] + public signal void response (Meta.InhibitShortcutsDialogResponse response); + } [CCode (cheader_filename = "meta/meta-close-dialog.h", type_cname = "MetaCloseDialogInterface", type_id = "meta_close_dialog_get_type ()")] public interface CloseDialog : GLib.Object { public abstract void focus (); @@ -847,6 +1252,16 @@ namespace Meta { #endif [CCode (cheader_filename = "meta/common.h", has_type_id = false)] public struct ButtonLayout { +#if HAS_MUTTER332 + [CCode (array_length = false)] + public weak Meta.ButtonFunction left_buttons[4]; + [CCode (array_length = false)] + public weak bool left_buttons_has_spacer[4]; + [CCode (array_length = false)] + public weak Meta.ButtonFunction right_buttons[4]; + [CCode (array_length = false)] + public weak bool right_buttons_has_spacer[4]; +#else [CCode (array_length = false)] public weak Meta.ButtonFunction left_buttons[5]; [CCode (array_length = false)] @@ -855,6 +1270,7 @@ namespace Meta { public weak Meta.ButtonFunction right_buttons[5]; [CCode (array_length = false)] public weak bool right_buttons_has_spacer[5]; +#endif } [CCode (cheader_filename = "meta/boxes.h", has_type_id = false)] public struct Edge { @@ -935,7 +1351,9 @@ namespace Meta { UNABOVE, UNSTICK, #endif +#if !HAS_MUTTER332 APPMENU, +#endif LAST } #if HAS_MUTTER326 @@ -1016,6 +1434,22 @@ namespace Meta { HORIZONTAL, VERTICAL } +#if HAS_MUTTER330 + [CCode (cheader_filename = "meta/main.h", cprefix = "META_DISPLAY_", type_id = "meta_display_corner_get_type ()")] + public enum DisplayCorner { + TOPLEFT, + TOPRIGHT, + BOTTOMLEFT, + BOTTOMRIGHT + } + [CCode (cheader_filename = "meta/main.h", cprefix = "META_DISPLAY_", type_id = "meta_display_direction_get_type ()")] + public enum DisplayDirection { + UP, + DOWN, + LEFT, + RIGHT + } +#endif [CCode (cheader_filename = "meta/boxes.h", cprefix = "META_EDGE_", type_id = "meta_edge_type_get_type ()")] public enum EdgeType { WINDOW, @@ -1032,7 +1466,9 @@ namespace Meta { public enum FrameFlags { ALLOWS_DELETE, ALLOWS_MENU, +#if !HAS_MUTTER332 ALLOWS_APPMENU, +#endif ALLOWS_MINIMIZE, ALLOWS_MAXIMIZE, ALLOWS_VERTICAL_RESIZE, @@ -1044,7 +1480,9 @@ namespace Meta { ALLOWS_SHADE, ALLOWS_MOVE, FULLSCREEN, +#if !HAS_MUTTER332 IS_FLASHING, +#endif ABOVE, TILED_LEFT, TILED_RIGHT @@ -1060,7 +1498,7 @@ namespace Meta { ATTACHED, LAST; [CCode (cheader_filename = "meta/main.h")] - public static unowned string to_string (Meta.FrameType type); + public unowned string to_string (); } [CCode (cheader_filename = "meta/common.h", cprefix = "META_GRAB_OP_", type_id = "meta_grab_op_get_type ()")] public enum GrabOp { @@ -1089,6 +1527,13 @@ namespace Meta { KEYBOARD_RESIZING_SE, KEYBOARD_RESIZING_W } +#if HAS_MUTTER326 + [CCode (cheader_filename = "meta/main.h", cprefix = "META_INHIBIT_SHORTCUTS_DIALOG_RESPONSE_", type_id = "meta_inhibit_shortcuts_dialog_response_get_type ()")] + public enum InhibitShortcutsDialogResponse { + ALLOW, + DENY + } +#endif [CCode (cheader_filename = "meta/prefs.h", cprefix = "META_KEYBINDING_ACTION_", type_id = "meta_key_binding_action_get_type ()")] public enum KeyBindingAction { NONE, @@ -1192,6 +1637,12 @@ namespace Meta { NONE, PER_WINDOW, BUILTIN, +#if HAS_MUTTER326 + NON_MASKABLE, +#endif +#if HAS_MUTTER330 + IGNORE_AUTOREPEAT, +#endif IS_REVERSED } [CCode (cheader_filename = "meta/util.h", cprefix = "META_LATER_", type_id = "meta_later_type_get_type ()")] @@ -1286,8 +1737,9 @@ namespace Meta { CENTER_NEW_WINDOWS, DRAG_THRESHOLD; [CCode (cheader_filename = "meta/main.h")] - public static unowned string to_string (Meta.Preference pref); + public unowned string to_string (); } +#if !HAS_MUTTER330 [CCode (cheader_filename = "meta/screen.h", cprefix = "META_SCREEN_", type_id = "meta_screen_corner_get_type ()")] public enum ScreenCorner { TOPLEFT, @@ -1302,6 +1754,7 @@ namespace Meta { LEFT, RIGHT } +#endif [CCode (cheader_filename = "meta/meta-enum-types.h", cprefix = "META_SHADOW_MODE_", type_id = "meta_shadow_mode_get_type ()")] public enum ShadowMode { AUTO, @@ -1395,12 +1848,21 @@ namespace Meta { } [CCode (cheader_filename = "meta/meta-idle-monitor.h", instance_pos = 2.9)] public delegate void IdleMonitorWatchFunc (Meta.IdleMonitor monitor, uint watch_id); +#if HAS_MUTTER330 + [CCode (cheader_filename = "meta/prefs.h", instance_pos = 4.9)] + public delegate void KeyHandlerFunc (Meta.Display display, Meta.Window? window, Clutter.KeyEvent? event, Meta.KeyBinding binding); +#else [CCode (cheader_filename = "meta/prefs.h", instance_pos = 5.9)] public delegate void KeyHandlerFunc (Meta.Display display, Meta.Screen screen, Meta.Window? window, Clutter.KeyEvent? event, Meta.KeyBinding binding); +#endif [CCode (cheader_filename = "meta/prefs.h", instance_pos = 1.9)] public delegate void PrefsChangedFunc (Meta.Preference pref); [CCode (cheader_filename = "meta/window.h", instance_pos = 1.9)] public delegate bool WindowForeachFunc (Meta.Window window); +#if HAS_MUTTER330 + [CCode (cheader_filename = "meta/main.h", cname = "META_CURRENT_TIME")] + public const int CURRENT_TIME; +#endif [CCode (cheader_filename = "meta/main.h", cname = "META_DEFAULT_ICON_NAME")] public const string DEFAULT_ICON_NAME; [CCode (cheader_filename = "meta/main.h", cname = "META_ICON_HEIGHT")] diff --git a/vapi/mutter-clutter-3.deps b/vapi/mutter-clutter-3.deps new file mode 100644 index 00000000..687b7637 --- /dev/null +++ b/vapi/mutter-clutter-3.deps @@ -0,0 +1,5 @@ +atk +cairo +pango +json-glib-1.0 +mutter-cogl-3 diff --git a/vapi/mutter-clutter-3.vapi b/vapi/mutter-clutter-3.vapi new file mode 120000 index 00000000..cb676dc5 --- /dev/null +++ b/vapi/mutter-clutter-3.vapi @@ -0,0 +1 @@ +mutter-clutter-2.vapi \ No newline at end of file diff --git a/vapi/mutter-clutter-4.deps b/vapi/mutter-clutter-4.deps new file mode 100644 index 00000000..7b119ff7 --- /dev/null +++ b/vapi/mutter-clutter-4.deps @@ -0,0 +1,5 @@ +atk +cairo +pango +json-glib-1.0 +mutter-cogl-4 diff --git a/vapi/mutter-clutter-4.vapi b/vapi/mutter-clutter-4.vapi new file mode 120000 index 00000000..e02bf290 --- /dev/null +++ b/vapi/mutter-clutter-4.vapi @@ -0,0 +1 @@ +mutter-clutter-3.vapi \ No newline at end of file diff --git a/vapi/mutter-clutter-5.deps b/vapi/mutter-clutter-5.deps new file mode 100644 index 00000000..0dbe69cc --- /dev/null +++ b/vapi/mutter-clutter-5.deps @@ -0,0 +1,5 @@ +atk +cairo +pango +json-glib-1.0 +mutter-cogl-5 diff --git a/vapi/mutter-clutter-5.vapi b/vapi/mutter-clutter-5.vapi new file mode 120000 index 00000000..6d9f291d --- /dev/null +++ b/vapi/mutter-clutter-5.vapi @@ -0,0 +1 @@ +mutter-clutter-4.vapi \ No newline at end of file diff --git a/vapi/mutter-clutter-6.deps b/vapi/mutter-clutter-6.deps new file mode 100644 index 00000000..fb13421d --- /dev/null +++ b/vapi/mutter-clutter-6.deps @@ -0,0 +1,5 @@ +atk +cairo +pango +json-glib-1.0 +mutter-cogl-6 diff --git a/vapi/mutter-clutter-6.vapi b/vapi/mutter-clutter-6.vapi new file mode 120000 index 00000000..64317aed --- /dev/null +++ b/vapi/mutter-clutter-6.vapi @@ -0,0 +1 @@ +mutter-clutter-5.vapi \ No newline at end of file diff --git a/vapi/mutter-cogl-3.deps b/vapi/mutter-cogl-3.deps new file mode 120000 index 00000000..c6bf5dfd --- /dev/null +++ b/vapi/mutter-cogl-3.deps @@ -0,0 +1 @@ +mutter-cogl-2.deps \ No newline at end of file diff --git a/vapi/mutter-cogl-3.vapi b/vapi/mutter-cogl-3.vapi new file mode 120000 index 00000000..6cf832ec --- /dev/null +++ b/vapi/mutter-cogl-3.vapi @@ -0,0 +1 @@ +mutter-cogl-2.vapi \ No newline at end of file diff --git a/vapi/mutter-cogl-4.deps b/vapi/mutter-cogl-4.deps new file mode 120000 index 00000000..45d34164 --- /dev/null +++ b/vapi/mutter-cogl-4.deps @@ -0,0 +1 @@ +mutter-cogl-3.deps \ No newline at end of file diff --git a/vapi/mutter-cogl-4.vapi b/vapi/mutter-cogl-4.vapi new file mode 120000 index 00000000..9bba5c49 --- /dev/null +++ b/vapi/mutter-cogl-4.vapi @@ -0,0 +1 @@ +mutter-cogl-3.vapi \ No newline at end of file diff --git a/vapi/mutter-cogl-5.deps b/vapi/mutter-cogl-5.deps new file mode 120000 index 00000000..c267692f --- /dev/null +++ b/vapi/mutter-cogl-5.deps @@ -0,0 +1 @@ +mutter-cogl-4.deps \ No newline at end of file diff --git a/vapi/mutter-cogl-5.vapi b/vapi/mutter-cogl-5.vapi new file mode 120000 index 00000000..4a1fb9f4 --- /dev/null +++ b/vapi/mutter-cogl-5.vapi @@ -0,0 +1 @@ +mutter-cogl-4.vapi \ No newline at end of file diff --git a/vapi/mutter-cogl-6.deps b/vapi/mutter-cogl-6.deps new file mode 120000 index 00000000..e2f4b917 --- /dev/null +++ b/vapi/mutter-cogl-6.deps @@ -0,0 +1 @@ +mutter-cogl-5.deps \ No newline at end of file diff --git a/vapi/mutter-cogl-6.vapi b/vapi/mutter-cogl-6.vapi new file mode 120000 index 00000000..a679506f --- /dev/null +++ b/vapi/mutter-cogl-6.vapi @@ -0,0 +1 @@ +mutter-cogl-5.vapi \ No newline at end of file diff --git a/vapi/mutter-cogl-pango-3.vapi b/vapi/mutter-cogl-pango-3.vapi new file mode 100644 index 00000000..e69de29b diff --git a/vapi/mutter-cogl-pango-4.vapi b/vapi/mutter-cogl-pango-4.vapi new file mode 100644 index 00000000..e69de29b diff --git a/vapi/mutter-cogl-pango-5.vapi b/vapi/mutter-cogl-pango-5.vapi new file mode 100644 index 00000000..e69de29b diff --git a/vapi/mutter-cogl-pango-6.vapi b/vapi/mutter-cogl-pango-6.vapi new file mode 100644 index 00000000..e69de29b diff --git a/vapi/mutter-cogl-path-3.vapi b/vapi/mutter-cogl-path-3.vapi new file mode 100644 index 00000000..e69de29b diff --git a/vapi/mutter-cogl-path-4.vapi b/vapi/mutter-cogl-path-4.vapi new file mode 100644 index 00000000..e69de29b diff --git a/vapi/mutter-cogl-path-5.vapi b/vapi/mutter-cogl-path-5.vapi new file mode 100644 index 00000000..e69de29b diff --git a/vapi/mutter-cogl-path-6.vapi b/vapi/mutter-cogl-path-6.vapi new file mode 100644 index 00000000..e69de29b diff --git a/wingpanel-interface/BackgroundManager.vala b/wingpanel-interface/BackgroundManager.vala index 58dcc82c..6923ff43 100644 --- a/wingpanel-interface/BackgroundManager.vala +++ b/wingpanel-interface/BackgroundManager.vala @@ -63,9 +63,16 @@ public class WingpanelInterface.BackgroundManager : Object { } private void connect_signals () { +#if HAS_MUTTER330 + unowned Meta.WorkspaceManager manager = Main.display.get_workspace_manager (); + manager.workspace_switched.connect (() => { + update_current_workspace (); + }); +#else Main.screen.workspace_switched.connect (() => { update_current_workspace (); }); +#endif var signal_id = GLib.Signal.lookup ("changed", Main.wm.background_group.get_type ()); @@ -84,7 +91,12 @@ public class WingpanelInterface.BackgroundManager : Object { } private void update_current_workspace () { +#if HAS_MUTTER330 + unowned Meta.WorkspaceManager manager = Main.display.get_workspace_manager (); + var workspace = manager.get_workspace_by_index (manager.get_active_workspace_index ()); +#else var workspace = Main.screen.get_workspace_by_index (Main.screen.get_active_workspace_index ()); +#endif if (workspace == null) { warning ("Cannot get active workspace"); diff --git a/wingpanel-interface/FocusManager.vala b/wingpanel-interface/FocusManager.vala index 37e51a9a..03567ec3 100644 --- a/wingpanel-interface/FocusManager.vala +++ b/wingpanel-interface/FocusManager.vala @@ -25,9 +25,16 @@ public class WingpanelInterface.FocusManager : Object { private Meta.Window? last_focused_dialog_window = null; public FocusManager () { +#if HAS_MUTTER330 + unowned Meta.WorkspaceManager manager = Main.display.get_workspace_manager (); + manager.workspace_switched.connect (() => { + update_current_workspace (); + }); +#else Main.screen.workspace_switched.connect (() => { update_current_workspace (); }); +#endif update_current_workspace (); } @@ -41,11 +48,19 @@ public class WingpanelInterface.FocusManager : Object { } } +#if HAS_MUTTER330 + Main.display.window_created.connect (window_created); +#else Main.screen.get_display ().window_created.connect (window_created); +#endif } public void restore_focused_window () { +#if HAS_MUTTER330 + var display = Main.display; +#else var display = Main.screen.get_display (); +#endif // when a dialog was opened give it focus if (last_focused_dialog_window != null) { last_focused_dialog_window.focus (display.get_current_time ()); @@ -64,7 +79,11 @@ public class WingpanelInterface.FocusManager : Object { window.unmanaged.disconnect (window_unmanaged); } +#if HAS_MUTTER330 + Main.display.window_created.disconnect (window_created); +#else Main.screen.get_display ().window_created.disconnect (window_created); +#endif } void window_created (Meta.Window window) { @@ -87,10 +106,18 @@ public class WingpanelInterface.FocusManager : Object { } public bool begin_grab_focused_window (int x, int y, int button, uint time, uint state) { +#if HAS_MUTTER330 + var display = Main.display; +#else var display = Main.screen.get_display (); +#endif var window = display.get_focus_window (); if (window == null || !get_can_grab_window (window, x, y)) { +#if HAS_MUTTER330 + unowned Meta.Workspace workspace = Main.display.get_workspace_manager ().get_active_workspace (); +#else unowned Meta.Workspace workspace = Main.screen.get_active_workspace (); +#endif List? windows = workspace.list_windows (); if (windows == null) { return false; @@ -111,7 +138,11 @@ public class WingpanelInterface.FocusManager : Object { } if (window != null) { +#if HAS_MUTTER330 + display.begin_grab_op (window, Meta.GrabOp.MOVING, false, true, button, state, time, x, y); +#else display.begin_grab_op (Main.screen, window, Meta.GrabOp.MOVING, false, true, button, state, time, x, y); +#endif return true; } @@ -124,7 +155,12 @@ public class WingpanelInterface.FocusManager : Object { } private void update_current_workspace () { +#if HAS_MUTTER330 + unowned Meta.WorkspaceManager manager = Main.display.get_workspace_manager (); + var workspace = manager.get_workspace_by_index (manager.get_active_workspace_index ()); +#else var workspace = Main.screen.get_workspace_by_index (Main.screen.get_active_workspace_index ()); +#endif if (workspace == null) { warning ("Cannot get active workspace"); diff --git a/wingpanel-interface/Main.vala b/wingpanel-interface/Main.vala index c9bf19e4..58061693 100644 --- a/wingpanel-interface/Main.vala +++ b/wingpanel-interface/Main.vala @@ -27,7 +27,11 @@ public class WingpanelInterface.Main : Gala.Plugin { private const string DBUS_PATH = "/org/pantheon/gala/WingpanelInterface"; public static Gala.WindowManager wm; +#if HAS_MUTTER330 + public static Meta.Display display; +#else public static Meta.Screen screen; +#endif private DBusConnection? dbus_connection = null; @@ -37,7 +41,11 @@ public class WingpanelInterface.Main : Gala.Plugin { } wm = _wm; +#if HAS_MUTTER330 + display = wm.get_display (); +#else screen = wm.get_screen (); +#endif Bus.own_name (BusType.SESSION, DBUS_NAME, diff --git a/wingpanel-interface/meson.build b/wingpanel-interface/meson.build index 23268996..c98ee408 100644 --- a/wingpanel-interface/meson.build +++ b/wingpanel-interface/meson.build @@ -65,18 +65,54 @@ if mutter328_dep.found() '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'] endif -mutter330_dep = dependency('libmutter-2', version: ['>= 3.29.2', '< 3.31'], required: false) +mutter330_dep = dependency('libmutter-3', version: ['>= 3.29.2', '< 3.31'], required: false) if mutter330_dep.found() - libmutter_dep = dependency('libmutter-2', version: '>= 3.29.2') + libmutter_dep = dependency('libmutter-3', version: '>= 3.29.2') mutter_dep = [ - dependency('mutter-cogl-2'), dependency('mutter-cogl-pango-2'), - dependency('mutter-cogl-path-2'), dependency('mutter-clutter-2') + dependency('mutter-cogl-3'), dependency('mutter-cogl-pango-3'), + dependency('mutter-cogl-path-3'), dependency('mutter-clutter-3') ] vala_flags += ['--define', 'HAS_MUTTER320', '--define', 'HAS_MUTTER322', '--define', 'HAS_MUTTER324', '--define', 'HAS_MUTTER326', '--define', 'HAS_MUTTER328', '--define', 'HAS_MUTTER330'] c_flags = ['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'] endif +mutter332_dep = dependency('libmutter-4', version: ['>= 3.31.2', '< 3.34'], required: false) +if mutter332_dep.found() + libmutter_dep = dependency('libmutter-4', version: '>= 3.31.2') + mutter_dep = [ + dependency('mutter-cogl-4'), dependency('mutter-cogl-pango-4'), + dependency('mutter-cogl-path-4'), dependency('mutter-clutter-4') + ] + vala_flags += ['--define', 'HAS_MUTTER320', '--define', 'HAS_MUTTER322', '--define', 'HAS_MUTTER324', '--define', 'HAS_MUTTER326', '--define', 'HAS_MUTTER328', '--define', 'HAS_MUTTER330', '--define', 'HAS_MUTTER332'] + c_flags = ['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', + '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'] +endif + +mutter334_dep = dependency('libmutter-5', version: ['>= 3.34', '< 3.35.1'], required: false) +if mutter334_dep.found() + libmutter_dep = dependency('libmutter-5', version: '>= 3.34') + mutter_dep = [ + dependency('mutter-cogl-5'), dependency('mutter-cogl-pango-5'), + dependency('mutter-cogl-path-5'), dependency('mutter-clutter-5') + ] + vala_flags += ['--define', 'HAS_MUTTER320', '--define', 'HAS_MUTTER322', '--define', 'HAS_MUTTER324', '--define', 'HAS_MUTTER326', '--define', 'HAS_MUTTER328', '--define', 'HAS_MUTTER330', '--define', 'HAS_MUTTER332', '--define', 'HAS_MUTTER334'] + c_flags = ['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', + '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'] +endif + +mutter336_dep = dependency('libmutter-6', version: ['>= 3.35.1', '< 3.38'], required: false) +if mutter336_dep.found() + libmutter_dep = dependency('libmutter-6', version: '>= 3.35.1') + mutter_dep = [ + dependency('mutter-cogl-6'), dependency('mutter-cogl-pango-6'), + dependency('mutter-cogl-path-6'), dependency('mutter-clutter-6') + ] + vala_flags += ['--define', 'HAS_MUTTER320', '--define', 'HAS_MUTTER322', '--define', 'HAS_MUTTER324', '--define', 'HAS_MUTTER326', '--define', 'HAS_MUTTER328', '--define', 'HAS_MUTTER330', '--define', 'HAS_MUTTER332', '--define', 'HAS_MUTTER334', '--define', 'HAS_MUTTER336'] + c_flags = ['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', + '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'] +endif + if mutter_dep.length() == 0 error ('No supported mutter library found!') endif From 4c3f7015c8c4d73436b830f88ddc7f30df123601 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Thu, 31 Oct 2019 12:50:36 +0100 Subject: [PATCH 2/2] reuse display variable where possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Corentin Noël --- wingpanel-interface/FocusManager.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wingpanel-interface/FocusManager.vala b/wingpanel-interface/FocusManager.vala index 03567ec3..1676e47f 100644 --- a/wingpanel-interface/FocusManager.vala +++ b/wingpanel-interface/FocusManager.vala @@ -114,7 +114,7 @@ public class WingpanelInterface.FocusManager : Object { var window = display.get_focus_window (); if (window == null || !get_can_grab_window (window, x, y)) { #if HAS_MUTTER330 - unowned Meta.Workspace workspace = Main.display.get_workspace_manager ().get_active_workspace (); + unowned Meta.Workspace workspace = display.get_workspace_manager ().get_active_workspace (); #else unowned Meta.Workspace workspace = Main.screen.get_active_workspace (); #endif