Skip to content

Commit

Permalink
Update Mutter 46 support
Browse files Browse the repository at this point in the history
Update to the latest version on time.
  • Loading branch information
tintou committed Feb 16, 2024
1 parent 61e5192 commit 3bdc4e9
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 51 deletions.
4 changes: 4 additions & 0 deletions lib/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ namespace Gala {
}
}

#if HAS_MUTTER46
unowned Meta.Group group = window.x11_get_group ();
#else
unowned Meta.Group group = window.get_group ();
#endif
if (group != null) {
var group_windows = group.list_windows ();
group_windows.foreach ((window) => {
Expand Down
5 changes: 0 additions & 5 deletions vapi/Clutter-14.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ Perspective struct
Actor
.apply_transform.matrix ref
.get_abs_allocation_vertices.verts out=false
Canvas
.new symbol_type="constructor"
Event.type#method name="get_type"
Image
.new symbol_type="constructor"
Expand Down Expand Up @@ -77,9 +75,6 @@ ActorBox
Margin
.new skip

// Struct return values
color_get_static nullable

// Upstream
Event
.get_position.position out
Expand Down
3 changes: 0 additions & 3 deletions vapi/Cogl-14.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,3 @@ blit_framebuffer parent="Cogl.Framebuffer" symbol_type="method" instance_idx=0 n
Onscreen
.add_dirty_callback unowned
.add_frame_callback unowned
.queue_damage_region.rectangles array array_length_idx=1
.swap_buffers_with_damage.rectangles array array_length_idx=1
.swap_region.rectangles array array_length_idx=1
7 changes: 1 addition & 6 deletions vapi/Meta-14.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ BarrierFlags cheader_filename="meta/barrier.h"
ButtonFunction cheader_filename="meta/common.h"
ButtonLayout cheader_filename="meta/common.h"
Compositor cheader_filename="meta/compositor.h"
get_feedback_group_for_display parent="Meta.Display" symbol_type="method" name="get_feedback_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
get_stage_for_display parent="Meta.Display" symbol_type="method" name="get_stage" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
get_top_window_group_for_display parent="Meta.Display" symbol_type="method" name="get_top_window_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
get_window_group_for_display parent="Meta.Display" symbol_type="method" name="get_window_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
Expand All @@ -41,6 +40,7 @@ DebugTopic cheader_filename="meta/util.h"
DebugPaintFlag cheader_filename="meta/util.h"
Direction cheader_filename="meta/common.h"
Display cheader_filename="meta/display.h"
Display.focus_window#signal name="do_focus_window"
DisplayCorner cheader_filename="meta/display.h"
DisplayDirection cheader_filename="meta/display.h"
Dnd cheader_filename="meta/meta-dnd.h"
Expand Down Expand Up @@ -107,7 +107,6 @@ Stage cheader_filename="meta/meta-stage.h"
Strut cheader_filename="meta/boxes.h"
TabList cheader_filename="meta/display.h"
TabShowType cheader_filename="meta/display.h"
VirtualModifier cheader_filename="meta/common.h"
WaylandClient cheader_filename="meta/meta-wayland-client.h"
WaylandCompositor cheader_filename="meta/meta-wayland-compositor.h"
Workspace cheader_filename="meta/workspace.h"
Expand Down Expand Up @@ -175,10 +174,6 @@ unsigned_long_hash.v type="ulong?"
warning parent="Meta.Util" cheader_filename="meta/util.h"
create_context parent="Meta.Context" name="new" symbol_type="constructor" cheader_filename="meta/meta-context.h"

x11_error_trap_pop parent="Meta.X11Display" symbol_type="method" name="error_trap_pop" instance_idx=0 cheader_filename="meta/meta-x11-errors.h"
x11_error_trap_pop_with_return parent="Meta.X11Display" symbol_type="method" name="error_trap_pop_with_return" instance_idx=0 cheader_filename="meta/meta-x11-errors.h"
x11_error_trap_push parent="Meta.X11Display" symbol_type="method" name="error_trap_push" instance_idx=0 cheader_filename="meta/meta-x11-errors.h"

BackgroundActor sealed
BackgroundContent sealed
BackgroundImage sealed
Expand Down
2 changes: 2 additions & 0 deletions vapi/Mtk-14.metadata
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Rectangle struct
RECTANGLE_MAX_STACK_RECTS parent="Mtk.Rectangle" name="MAX_STACK_RECTS"
REGION_BUILDER_MAX_LEVELS parent="Mtk.RegionBuilder" name="MAX_LEVELS"
38 changes: 38 additions & 0 deletions vapi/libmutter.vapi
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ namespace Meta {
public abstract class Backend : GLib.Object, GLib.Initable {
[CCode (has_construct_function = false)]
protected Backend ();
#if HAS_MUTTER46
public void freeze_keyboard (uint32 timestamp);
#endif
#if !HAS_MUTTER44
[CCode (cheader_filename = "meta/meta-backend.h", cname = "meta_get_backend")]
public static unowned Meta.Backend get_backend ();
Expand All @@ -163,7 +166,13 @@ namespace Meta {
public bool is_headless ();
public bool is_rendering_hardware_accelerated ();
public void lock_layout_group (uint idx);
#if HAS_MUTTER46
public void set_keymap (string layouts, string variants, string options, string model);
public void unfreeze_keyboard (uint32 timestamp);
public void ungrab_keyboard (uint32 timestamp);
#else
public void set_keymap (string layouts, string variants, string options);
#endif
#if HAS_MUTTER43
public Meta.BackendCapabilities capabilities { get; }
#endif
Expand Down Expand Up @@ -966,7 +975,9 @@ namespace Meta {
#else
public Meta.Rectangle client_rect_to_frame_rect (Meta.Rectangle client_rect);
#endif
#if !HAS_MUTTER46
public void compute_group ();
#endif
public void @delete (uint32 timestamp);
public unowned Meta.Window find_root_ancestor ();
public void focus (uint32 timestamp);
Expand All @@ -979,7 +990,9 @@ namespace Meta {
public Meta.Rectangle frame_rect_to_client_rect (Meta.Rectangle frame_rect);
public Meta.Rectangle get_buffer_rect ();
#endif
#if !HAS_MUTTER46
public unowned string? get_client_machine ();
#endif
public Meta.WindowClientType get_client_type ();
public unowned GLib.Object get_compositor_private ();
public unowned string get_description ();
Expand All @@ -996,7 +1009,9 @@ namespace Meta {
public Meta.Rectangle get_frame_rect ();
#endif
public Meta.FrameType get_frame_type ();
#if !HAS_MUTTER46
public unowned Meta.Group? get_group ();
#endif
public unowned string? get_gtk_app_menu_object_path ();
public unowned string? get_gtk_application_id ();
public unowned string? get_gtk_application_object_path ();
Expand Down Expand Up @@ -1036,8 +1051,10 @@ namespace Meta {
public Meta.Rectangle get_work_area_for_monitor (int which_monitor);
#endif
public unowned Meta.Workspace get_workspace ();
#if !HAS_MUTTER46
public X.Window get_xwindow ();
public void group_leader_changed ();
#endif
public bool has_attached_dialogs ();
public bool has_focus ();
#if HAS_MUTTER45
Expand Down Expand Up @@ -1087,7 +1104,9 @@ namespace Meta {
#endif
public void shove_titlebar_onscreen ();
public bool showing_on_its_workspace ();
#if !HAS_MUTTER46
public void shutdown_group ();
#endif
public void stick ();
public bool titlebar_is_onscreen ();
public void unmake_above ();
Expand All @@ -1099,6 +1118,9 @@ namespace Meta {
public void unshade (uint32 timestamp);
#endif
public void unstick ();
#if HAS_MUTTER46
public unowned Meta.Group? x11_get_group ();
#endif
[NoAccessorMethod]
public bool above { get; }
[NoAccessorMethod]
Expand Down Expand Up @@ -1259,14 +1281,22 @@ namespace Meta {
public unowned Meta.Workspace get_active_workspace ();
public int get_active_workspace_index ();
public int get_n_workspaces ();
#if HAS_MUTTER46
public int get_layout_columns ();
public int get_layout_rows ();
#endif
public unowned Meta.Workspace? get_workspace_by_index (int index);
public unowned GLib.List<Meta.Workspace> get_workspaces ();
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);
public void reorder_workspace (Meta.Workspace workspace, int new_index);
#if !HAS_MUTTER46
[NoAccessorMethod]
#endif
public int layout_columns { get; }
#if !HAS_MUTTER46
[NoAccessorMethod]
#endif
public int layout_rows { get; }
public int n_workspaces { get; }
public signal void active_workspace_changed ();
Expand Down Expand Up @@ -1303,6 +1333,9 @@ namespace Meta {
public bool has_shape ();
#endif
public unowned Meta.Group lookup_group (X.Window group_leader);
#if HAS_MUTTER46
public X.Window lookup_xwindow (Meta.Window window);
#endif
#if HAS_MUTTER45
public void redirect_windows (Meta.Display display);
public void remove_event_func (uint id);
Expand Down Expand Up @@ -1973,6 +2006,7 @@ namespace Meta {
ICON,
INSTANTLY
}
#if !HAS_MUTTER46
[CCode (cheader_filename = "meta/common.h", cprefix = "META_VIRTUAL_", type_id = "meta_virtual_modifier_get_type ()")]
[Flags]
public enum VirtualModifier {
Expand All @@ -1987,6 +2021,7 @@ namespace Meta {
MOD4_MASK,
MOD5_MASK
}
#endif
[CCode (cheader_filename = "meta/window.h", cprefix = "META_WINDOW_CLIENT_TYPE_", type_id = "meta_window_client_type_get_type ()")]
public enum WindowClientType {
WAYLAND,
Expand Down Expand Up @@ -2056,8 +2091,10 @@ namespace Meta {
public static void add_clutter_debug_flags (Clutter.DebugFlag debug_flags, Clutter.DrawDebugFlag draw_flags, Clutter.PickDebugFlag pick_flags);
[CCode (cheader_filename = "meta/main.h")]
public static void add_debug_paint_flag (Meta.DebugPaintFlag flag);
#if !HAS_MUTTER46
[CCode (cheader_filename = "meta/main.h")]
public static void clutter_init ();
#endif
[CCode (cheader_filename = "meta/main.h")]
public static void exit (Meta.ExitCode code);
#if HAS_MUTTER44
Expand Down Expand Up @@ -2085,3 +2122,4 @@ namespace Meta {
public static void restart (string? message);
#endif
}

Loading

0 comments on commit 3bdc4e9

Please sign in to comment.