From 763ec500b55ed809b4bdef3b284fa62560eb5fda Mon Sep 17 00:00:00 2001
From: Denis Garaev <garaevdi@yandex.ru>
Date: Mon, 9 Feb 2026 21:47:15 +0300
Subject: [PATCH] Update vapi for Mutter50

---
 vapi/Clutter-18.metadata        | 145 ++++++++++++++++++++
 vapi/Cogl-18-custom.vala        |  66 ++++++++++
 vapi/Cogl-18.metadata           |  40 ++++++
 vapi/Meta-18.metadata           | 176 +++++++++++++++++++++++++
 vapi/Mtk-18.metadata            |   6 +
 vapi/libmutter-18.deps          |   1 +
 vapi/libmutter-18.vapi          |   1 +
 vapi/libmutter.vapi             | 164 ++++++++++++++++++++++-
 vapi/meson.build                |  69 ++++++++++
 vapi/mutter-clutter-18.deps     |   6 +
 vapi/mutter-clutter-18.vapi     |   1 +
 vapi/mutter-clutter.vapi        | 188 +++++++++++++++++++++++++-
 vapi/mutter-cogl-14.vapi        | 227 +++++++++++++++++++++++++++++++-
 vapi/mutter-cogl-18.deps        |   5 +
 vapi/mutter-cogl-18.vapi        |   1 +
 vapi/mutter-mtk-13.vapi         |  11 ++
 vapi/mutter-mtk-18.vapi         |   1 +
 wingpanel-interface/meson.build |  11 ++
 18 files changed, 1107 insertions(+), 12 deletions(-)
 create mode 100644 vapi/Clutter-18.metadata
 create mode 100644 vapi/Cogl-18-custom.vala
 create mode 100644 vapi/Cogl-18.metadata
 create mode 100644 vapi/Meta-18.metadata
 create mode 100644 vapi/Mtk-18.metadata
 create mode 120000 vapi/libmutter-18.deps
 create mode 120000 vapi/libmutter-18.vapi
 create mode 100644 vapi/mutter-clutter-18.deps
 create mode 120000 vapi/mutter-clutter-18.vapi
 create mode 100644 vapi/mutter-cogl-18.deps
 create mode 120000 vapi/mutter-cogl-18.vapi
 create mode 120000 vapi/mutter-mtk-18.vapi

diff --git a/vapi/Clutter-18.metadata b/vapi/Clutter-18.metadata
new file mode 100644
index 00000000..f7f42051
--- /dev/null
+++ b/vapi/Clutter-18.metadata
@@ -0,0 +1,145 @@
+// Non mini-object
+ActorBox struct
+Margin struct
+PaintVolume struct
+Perspective struct
+
+*.ref unowned
+* cheader_filename="clutter/clutter.h"
+
+// Fix the few clutter-pango headers
+Text cheader_filename="clutter/clutter-pango.h"
+TextBuffer cheader_filename="clutter/clutter-pango.h"
+TextNode cheader_filename="clutter/clutter-pango.h"
+Actor
+	.get_pango_context cheader_filename="clutter/clutter-pango.h"
+	.create_pango_context cheader_filename="clutter/clutter-pango.h"
+	.create_pango_layout cheader_filename="clutter/clutter-pango.h"
+
+
+Actor
+	.apply_transform.matrix ref
+	.get_abs_allocation_vertices.verts out=false
+Event.type#method name="get_type"
+
+// ???
+Actor.has_pointer#method name="get_has_pointer"
+
+// Not all backing symbols are deprecated
+Actor.pick deprecated=false
+
+// Nullable return values
+Actor
+	.get_parent nullable
+
+// The original CType has been overridden by the annotations
+Actor
+	.allocate.box ctype="const ClutterActorBox *"
+	.get_stage ctype="ClutterActor *"
+Action.handle_event.event ctype="const ClutterEvent *"
+
+// method/virtual-method/signal don't match
+Actor
+	.event#method name="emit_event"
+	.get_paint_volume#virtual_method name="get_paint_volume_vfunc"
+	.get_paint_volume#virtual_method.volume out
+Text
+	.activate#method name="try_activate"
+	.insert_text#signal skip
+TextBuffer.get_text#virtual_method name="get_text_with_length"
+
+// Default values
+Stage.read_pixels
+	.width default=-1
+	.height default=-1
+Stage.paint_to_buffer
+    .data type="uint8[]"
+Text
+	.position_to_coords.line_height default=null
+
+// Skipped by g-i for unknown reasons
+LayoutManager
+	.create_child_meta skip=false
+
+// We can use static strings
+PaintNode
+	.set_static_name skip=false
+
+// Variadic arguments
+Backend
+	.get_cogl_context skip=false
+Interval
+	.new skip=false
+	.get_interval skip=false
+	.set_final skip=false
+	.set_initial skip=false
+	.set_interval skip=false
+LayoutManager
+	.child_get skip=false
+	.child_set skip=false
+
+// Skipped upstream for unknown reasons
+Interval.register_progress_func skip=false
+
+// struct/class confusion
+ActorBox
+	.new skip
+	.from_vertices skip
+Margin
+	.new skip
+
+// Upstream
+Event
+	.get_position.position out
+
+FrameListenerIface skip
+FrameClock.new skip
+
+// Remove for clutter-2.0
+/////////////////////////
+
+StageView.layout skip
+
+Stage
+	.paint_view.redraw_clip type="Cairo.Region"
+
+// *Event should be compact classes derived from Clutter.Event
+Event.type skip=false
+AnyEvent struct=false base_type="Clutter.Event"
+ButtonEvent struct=false base_type="Clutter.Event"
+CrossingEvent struct=false base_type="Clutter.Event"
+DeviceEvent struct=false base_type="Clutter.Event"
+IMEvent struct=false base_type="Clutter.Event"
+KeyEvent struct=false base_type="Clutter.Event"
+MotionEvent struct=false base_type="Clutter.Event"
+PadButtonEvent struct=false base_type="Clutter.Event"
+PadRingEvent struct=false base_type="Clutter.Event"
+PadStripEvent struct=false base_type="Clutter.Event"
+ProximityEvent struct=false base_type="Clutter.Event"
+ScrollEvent struct=false base_type="Clutter.Event"
+TouchEvent struct=false base_type="Clutter.Event"
+TouchpadHoldEvent struct=false base_type="Clutter.Event"
+TouchpadPinchEvent struct=false base_type="Clutter.Event"
+TouchpadSwipeEvent struct=false base_type="Clutter.Event"
+
+// Keysyms used to be CLUTTER_X instead of CLUTTER_KEY_X
+*#constant skip
+CURRENT_TIME skip=false
+PRIORITY_REDRAW skip=false
+
+// Clutter devs don't like us creating nested namespaces
+value_* name="value_(.+)" parent="Clutter.Value"
+threads_* name="threads_(.+)" parent="Clutter.Threads"
+
+// There is no way to know sealed classes before GLib 2.70
+ColorState sealed
+FrameClock sealed
+TextureContent sealed
+
+TextureContent.new_from_texture symbol_type="constructor"
+
+// Possibly keep
+KEY_* skip=false name="KEY_(.+)" type="uint" parent="Clutter.Key"
+BUTTON_* skip=false name="BUTTON_(.+)" type="uint32" parent="Clutter.Button"
+EVENT_STOP skip=false type="bool"
+EVENT_PROPAGATE skip=false type="bool"
diff --git a/vapi/Cogl-18-custom.vala b/vapi/Cogl-18-custom.vala
new file mode 100644
index 00000000..90d46b33
--- /dev/null
+++ b/vapi/Cogl-18-custom.vala
@@ -0,0 +1,66 @@
+namespace Cogl {
+	public struct Color {
+		[CCode (cname="cogl_color_init_from_4f")]
+		public Color.from_4f (float red, float green, float blue, float alpha);
+		[CCode (cname="cogl_color_init_from_hsl")]
+		public Color.from_hsl (float hue, float saturation, float luminance);
+		[CCode (cname = "_vala_cogl_color_from_string")]
+		public static Cogl.Color? from_string (string str) {
+			Cogl.Color color = {};
+			if (color.init_from_string (str))
+				return color;
+
+			return null;
+		}
+	}
+	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
+	public struct VertexP2 {
+		public float x;
+		public float y;
+	}
+	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
+	public struct VertexP2C4 {
+		public float x;
+		public float y;
+		public uint8 r;
+		public uint8 g;
+		public uint8 b;
+		public uint8 a;
+	}
+	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
+	public struct VertexP2T2 {
+		public float x;
+		public float y;
+		public float s;
+		public float t;
+	}
+	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
+	public struct VertexP2T2C4 {
+		public float x;
+		public float y;
+		public float s;
+		public float t;
+		public uint8 r;
+		public uint8 g;
+		public uint8 b;
+		public uint8 a;
+	}
+	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
+	public struct VertexP3 {
+		public float x;
+		public float y;
+		public float z;
+	}
+	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
+	public struct VertexP3T2 {
+		public float x;
+		public float y;
+		public float z;
+		public float s;
+		public float t;
+	}
+	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_PIXEL_FORMAT_", type_id = "cogl_pixel_format_get_type ()")]
+	public enum PixelFormat {
+		CAIRO_ARGB32_COMPAT;
+	}
+}
diff --git a/vapi/Cogl-18.metadata b/vapi/Cogl-18.metadata
new file mode 100644
index 00000000..f66d6f40
--- /dev/null
+++ b/vapi/Cogl-18.metadata
@@ -0,0 +1,40 @@
+* cheader_filename="cogl/cogl.h"
+
+Color struct
+
+Color.equal.v1 type="Cogl.Color"
+Color.equal.v2 type="Cogl.Color"
+Color.from_string name="init_from_string"
+
+Bitmap.* skip=false
+Bitmap.new_for_data.data type="owned uint8[]"
+Bitmap.get_buffer type="unowned Cogl.Buffer?"
+
+Primitive.new skip=false
+
+Texture
+  .get_data.data type="uint8[]"
+  .set_data.data type="uint8[]"
+  .set_region.data type="uint8[]"
+
+Texture2D
+  .new_from_data skip=false
+
+Texture.error_quark parent="Cogl.TextureError" name="quark"
+
+RendererError errordomain
+SystemError errordomain
+TextureError errordomain
+FramebufferError errordomain
+ScanoutError errordomain
+
+Onscreen
+  .add_frame_callback unowned
+
+A_BIT parent="Cogl.Bits" name="A"
+BGR_BIT parent="Cogl.Bits" name="BGR"
+AFIRST_BIT parent="Cogl.Bits" name="AFIRST"
+PREMULT_BIT parent="Cogl.Bits" name="PREMULT"
+DEPTH_BIT parent="Cogl.Bits" name="DEPTH"
+STENCIL_BIT parent="Cogl.Bits" name="STENCIL"
+PIXEL_FORMAT_MAX_PLANES parent = "Cogl.PixelFormat" name="MAX_PLANES"
diff --git a/vapi/Meta-18.metadata b/vapi/Meta-18.metadata
new file mode 100644
index 00000000..04355e74
--- /dev/null
+++ b/vapi/Meta-18.metadata
@@ -0,0 +1,176 @@
+* skip=false
+*.* skip=false
+* cheader_filename="meta/main.h"
+
+Backend cheader_filename="meta/meta-backend.h"
+Backend.gpu_added skip
+Background cheader_filename="meta/meta-background.h"
+Background.set_file.file nullable
+BackgroundContent.new symbol_type="constructor"
+BackgroundActor cheader_filename="meta/meta-background-actor.h"
+BackgroundContent cheader_filename="meta/meta-background-content.h"
+BackgroundGroup cheader_filename="meta/meta-background-group.h"
+BackgroundImage cheader_filename="meta/meta-background-image.h"
+BackgroundImageCache cheader_filename="meta/meta-background-image.h"
+Barrier cheader_filename="meta/barrier.h"
+BarrierDirection cheader_filename="meta/barrier.h"
+BarrierEvent cheader_filename="meta/barrier.h"
+BarrierFlags cheader_filename="meta/barrier.h"
+ButtonFunction cheader_filename="meta/common.h"
+ButtonLayout cheader_filename="meta/common.h"
+Compositor cheader_filename="meta/compositor.h"
+CompEffect cheader_filename="meta/compositor.h"
+CloseDialog cheader_filename="meta/meta-close-dialog.h"
+CloseDialogResponse cheader_filename="meta/meta-close-dialog.h"
+Context cheader_filename="meta/meta-context.h"
+CursorTracker cheader_filename="meta/meta-cursor-tracker.h"
+CursorTracker.get_pointer.mods out
+DebugControl cheader_filename="meta/meta-debug-control.h"
+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"
+EdgeType cheader_filename="meta/boxes.h"
+Edge cheader_filename="meta/boxes.h"
+FrameBorders cheader_filename="meta/common.h"
+FrameType cheader_filename="meta/common.h"
+GrabOp cheader_filename="meta/common.h"
+Gravity cheader_filename="meta/common.h"
+Group cheader_filename="meta/meta-x11-types.h"
+IdleMonitor cheader_filename="meta/meta-idle-monitor.h"
+IdleMonitorWatchFunc cheader_filename="meta/meta-idle-monitor.h"
+InhibitShortcutsDialog cheader_filename="meta/meta-inhibit-shortcuts-dialog.h"
+InhibitShortcutsDialogResponse cheader_filename="meta/meta-inhibit-shortcuts-dialog.h"
+KeyboardA11yFlags cheader_filename="meta/meta-enums.h"
+KeyBinding cheader_filename="meta/keybindings.h"
+keybindings_set_custom_handler parent="Meta.KeyBinding" name="set_custom_handler" cheader_filename="meta/keybindings.h"
+KeyBindingAction cheader_filename="meta/prefs.h"
+KeyBindingFlags cheader_filename="meta/prefs.h"
+KeyHandlerFunc cheader_filename="meta/prefs.h"
+KeyHandlerFunc.event type="Clutter.KeyEvent?"
+KeyHandlerFunc.window nullable
+LaunchContext cheader_filename="meta/meta-launch-context.h"
+Laters cheader_filename="meta/types.h"
+LaterType cheader_filename="meta/util.h"
+MaximizeFlags cheader_filename="meta/window.h"
+MultiTexture cheader_filename="meta/meta-multi-texture.h"
+MultiTextureFormat cheader_filename="meta/meta-multi-texture-format.h"
+MonitorManager cheader_filename="meta/meta-monitor-manager.h"
+MonitorSwitchConfigType cheader_filename="meta/meta-monitor-manager.h"
+MotionDirection cheader_filename="meta/common.h"
+Orientation cheader_filename="meta/meta-orientation-manager.h"
+OrientationManager cheader_filename="meta/meta-orientation-manager.h"
+PadDirection cheader_filename="meta/display.h"
+PadFeatureType cheader_filename="meta/display.h"
+Plugin cheader_filename="meta/meta-plugin.h"
+PowerSaveChangeReason cheader_filename="meta/meta-monitor-manager.h"
+Preference cheader_filename="meta/prefs.h"
+PrefsChangedFunc cheader_filename="meta/prefs.h"
+RemoteAccessController cheader_filename="meta/meta-remote-access-controller.h"
+RemoteAccessHandle cheader_filename="meta/meta-remote-access-controller.h"
+Selection cheader_filename="meta/meta-selection.h"
+SelectionSource cheader_filename="meta/meta-selection-source.h"
+SelectionSourceMemory cheader_filename="meta/meta-selection-source-memory.h"
+SelectionType cheader_filename="meta/meta-selection-source.h"
+Settings cheader_filename="meta/meta-settings.h"
+ShapedTexture cheader_filename="meta/meta-shaped-texture.h"
+Side cheader_filename="meta/common.h"
+SizeChange cheader_filename="meta/compositor.h"
+SoundPlayer cheader_filename="meta/meta-sound-player.h"
+StartupNotification cheader_filename="meta/meta-startup-notification.h"
+StartupNotification.changed.object type="Meta.StartupSequence"
+StartupNotification.get_sequences type_arguments="Meta.StartupSequence"
+StartupSequence cheader_filename="meta/meta-startup-notification.h"
+StackLayer cheader_filename="meta/common.h"
+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"
+WaylandClient cheader_filename="meta/meta-wayland-client.h"
+WaylandCompositor cheader_filename="meta/meta-wayland-compositor.h"
+Workspace cheader_filename="meta/workspace.h"
+WorkspaceManager cheader_filename="meta/meta-workspace-manager.h"
+Window cheader_filename="meta/window.h"
+Window.focus#signal name="focused"
+Window.suspend_state skip
+Window.main_monitor skip
+WindowActor cheader_filename="meta/meta-window-actor.h"
+WindowClientType cheader_filename="meta/window.h"
+WindowForeachFunc cheader_filename="meta/window.h"
+WindowGroup cheader_filename="meta/meta-window-group.h"
+WindowMenuType cheader_filename="meta/compositor.h"
+WindowType cheader_filename="meta/window.h"
+X11Display cheader_filename="meta/meta-x11-display.h"
+X11Display.add_event_func skip
+X11DisplayEventFunc skip
+
+WaylandSurface.scanout_candidate skip
+WaylandSurface.main_monitor skip
+
+// As per https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2287
+MonitorManager.monitor_privacy_screen_changed skip
+
+prefs_* parent="Meta.Prefs" name="prefs_(.+)" cheader_filename="meta/prefs.h"
+
+g_utf8_strndup skip
+
+preference_to_string cheader_filename="meta/prefs.h"
+frame_type_to_string cheader_filename="meta/util.h"
+topic_to_string parent="Meta.DebugTopic" name="to_string" cheader_filename="meta/util.h"
+
+CURRENT_TIME cheader_filename="meta/common.h"
+PRIORITY_RESIZE cheader_filename="meta/common.h"
+PRIORITY_BEFORE_REDRAW cheader_filename="meta/common.h"
+PRIORITY_REDRAW cheader_filename="meta/common.h"
+PRIORITY_PREFS_NOTIFY cheader_filename="meta/common.h"
+VIRTUAL_CORE_POINTER_ID cheader_filename="meta/common.h"
+VIRTUAL_CORE_KEYBOARD_ID cheader_filename="meta/common.h"
+
+Display.window_visibility_updated
+	.object name="unplaced" type="GLib.List<unowned Meta.Window>"
+	.p0 name="should_show" type="GLib.List<unowned Meta.Window>"
+	.p1 name="should_hide" type="GLib.List<unowned Meta.Window>"
+
+Compositor.get_window_actors type_arguments="Meta.WindowActor"
+
+add_verbose_topic parent="Meta.Util" cheader_filename="meta/util.h"
+bug parent="Meta.Util" cheader_filename="meta/util.h"
+external_binding_name_for_action parent="Meta.Util" cheader_filename="meta/util.h"
+fatal parent="Meta.Util" cheader_filename="meta/util.h"
+is_verbose parent="Meta.Util" cheader_filename="meta/util.h"
+pop_no_msg_prefix parent="Meta.Util" cheader_filename="meta/util.h"
+push_no_msg_prefix parent="Meta.Util" cheader_filename="meta/util.h"
+remove_verbose_topic parent="Meta.Util" cheader_filename="meta/util.h"
+unsigned_long_equal parent="Meta.Util" name="ulong_equal" cheader_filename="meta/util.h"
+unsigned_long_equal.v1 type="ulong?"
+unsigned_long_equal.v2 type="ulong?"
+unsigned_long_hash parent="Meta.Util" name="ulong_hash" cheader_filename="meta/util.h"
+unsigned_long_hash.v type="ulong?"
+create_context parent="Meta.Context" name="new" symbol_type="constructor" cheader_filename="meta/meta-context.h"
+
+Plugin.create_close_dialog unowned=false nullable
+Plugin.create_inhibit_shortcuts_dialog unowned=false
+
+BackgroundActor sealed
+BackgroundContent sealed
+BackgroundImage sealed
+BackgroundImageCache sealed
+Background sealed
+Dnd sealed
+IdleMonitor sealed
+LaunchContext sealed
+RemoteAccessController sealed
+SelectionSourceMemory sealed
+Selection sealed
+ShapedTexture sealed
+SoundPlayer sealed
+Stage sealed
+StartupNotification sealed
+WaylandClient sealed
+WindowGroup sealed
+WorkspaceManager sealed
+X11Display sealed
diff --git a/vapi/Mtk-18.metadata b/vapi/Mtk-18.metadata
new file mode 100644
index 00000000..f804d1bc
--- /dev/null
+++ b/vapi/Mtk-18.metadata
@@ -0,0 +1,6 @@
+Rectangle struct
+RECTANGLE_MAX_STACK_RECTS parent="Mtk.Rectangle" name="MAX_STACK_RECTS"
+REGION_BUILDER_MAX_LEVELS parent="Mtk.RegionBuilder" name="MAX_LEVELS"
+
+MONITOR_ALL_TRANSFORMS parent="Mtk.MonitorTransform" name="ALL"
+MONITOR_N_TRANSFORMS skip
diff --git a/vapi/libmutter-18.deps b/vapi/libmutter-18.deps
new file mode 120000
index 00000000..18c721de
--- /dev/null
+++ b/vapi/libmutter-18.deps
@@ -0,0 +1 @@
+libmutter-17.deps
\ No newline at end of file
diff --git a/vapi/libmutter-18.vapi b/vapi/libmutter-18.vapi
new file mode 120000
index 00000000..ff0e578a
--- /dev/null
+++ b/vapi/libmutter-18.vapi
@@ -0,0 +1 @@
+libmutter-17.vapi
\ No newline at end of file
diff --git a/vapi/libmutter.vapi b/vapi/libmutter.vapi
index d825594e..922c6959 100644
--- a/vapi/libmutter.vapi
+++ b/vapi/libmutter.vapi
@@ -105,8 +105,10 @@ namespace Meta {
 #endif
 		[CCode (cheader_filename = "meta/util.h", cname = "meta_is_verbose")]
 		public static bool is_verbose ();
+#if !HAS_MUTTER50
 		[CCode (cheader_filename = "meta/util.h", cname = "meta_is_wayland_compositor")]
 		public static bool is_wayland_compositor ();
+#endif
 		[CCode (cheader_filename = "meta/util.h", cname = "meta_pop_no_msg_prefix")]
 		public static void pop_no_msg_prefix ();
 		[CCode (cheader_filename = "meta/util.h", cname = "meta_push_no_msg_prefix")]
@@ -139,6 +141,9 @@ namespace Meta {
 		public unowned Meta.CursorTracker get_cursor_tracker ();
 #endif
 		public unowned Meta.Dnd get_dnd ();
+#if HAS_MUTTER50
+		public unowned Meta.KeymapDescription get_keymap_description ();
+#endif
 		public unowned Meta.MonitorManager get_monitor_manager ();
 #if HAS_MUTTER47
 		public unowned Meta.OrientationManager get_orientation_manager ();
@@ -148,19 +153,29 @@ namespace Meta {
 		public unowned Clutter.Actor get_stage ();
 		public bool is_headless ();
 		public bool is_rendering_hardware_accelerated ();
+#if !HAS_MUTTER49
 		public void lock_layout_group (uint idx);
+#endif
 #if HAS_MUTTER48
 		public void renderdoc_capture ();
 #endif
 #if HAS_MUTTER46
 #if HAS_MUTTER49
+#if HAS_MUTTER50
+		public async bool set_keymap_async (Meta.KeymapDescription description, uint32 layout_index, GLib.Cancellable? cancellable) throws GLib.Error;
+#else
 		public async bool set_keymap_async (string layouts, string variants, string options, string model, GLib.Cancellable? cancellable) throws GLib.Error;
+#endif
+#if !HAS_MUTTER50
 		public async bool set_keymap_layout_group_async (uint32 idx, GLib.Cancellable? cancellable) throws GLib.Error;
+#endif
 #else
 		public void set_keymap (string layouts, string variants, string options, string model);
 #endif
+#if !HAS_MUTTER50
 		public void unfreeze_keyboard (uint32 timestamp);
 		public void ungrab_keyboard (uint32 timestamp);
+#endif
 #else
 		public void set_keymap (string layouts, string variants, string options);
 #endif
@@ -170,11 +185,16 @@ namespace Meta {
 		public signal void keymap_layout_group_changed (uint object);
 		public signal void last_device_changed (Clutter.InputDevice object);
 		public signal void lid_is_closed_changed (bool object);
-#if HAS_MUTTER48
+#if HAS_MUTTER50
+		public signal Clutter.CursorType override_cursor ();
+#elif HAS_MUTTER48
 		public signal void pause ();
 #endif
 		public signal void prepare_shutdown ();
-#if HAS_MUTTER48
+#if HAS_MUTTER50
+		public signal Meta.KeymapDescription reset_keymap_description ();
+		public signal uint reset_keymap_layout_index ();
+#elif HAS_MUTTER48
 		public signal void resume ();
 #endif
 	}
@@ -362,13 +382,17 @@ namespace Meta {
 		public bool configure ([CCode (array_length_cname = "argc", array_length_pos = 0.5)] ref unowned string[]? argv) throws GLib.Error;
 		public void destroy ();
 		public unowned Meta.Backend get_backend ();
+#if !HAS_MUTTER50
 		public Meta.CompositorType get_compositor_type ();
+#endif
 #if HAS_MUTTER47
 		public unowned Meta.DebugControl get_debug_control ();
 #endif
 		public unowned Meta.Display get_display ();
 		public unowned Meta.WaylandCompositor? get_wayland_compositor ();
+#if !HAS_MUTTER50
 		public bool is_replacing ();
+#endif
 		public void notify_ready ();
 		public bool raise_rlimit_nofile () throws GLib.Error;
 		public bool restore_rlimit_nofile () throws GLib.Error;
@@ -495,11 +519,15 @@ namespace Meta {
 		public unowned Meta.X11Display get_x11_display ();
 		public uint grab_accelerator (string accelerator, Meta.KeyBindingFlags flags);
 		public bool is_grabbed ();
+#if !HAS_MUTTER50
 		public bool is_pointer_emulating_sequence (Clutter.EventSequence? sequence);
+#endif
 		public GLib.List<weak Meta.Window> list_all_windows ();
 		public bool remove_keybinding (string name);
 		public void request_pad_osd (Clutter.InputDevice pad, bool edition_mode);
+#if !HAS_MUTTER50
 		public void set_cursor (Meta.Cursor cursor);
+#endif
 #if HAS_MUTTER46
 		public void set_input_focus (Meta.Window window, uint32 timestamp);
 #else
@@ -525,7 +553,9 @@ namespace Meta {
 		public signal void accelerator_deactivated (uint object, Clutter.InputDevice p0, uint p1);
 #endif
 		public signal void closing ();
+#if !HAS_MUTTER50
 		public signal void cursor_updated ();
+#endif
 		[CCode (cname = "focus-window")]
 		public signal void do_focus_window (Meta.Window object, int64 p0);
 		public signal void gl_video_memory_purged ();
@@ -533,15 +563,23 @@ namespace Meta {
 		public signal void grab_op_end (Meta.Window object, Meta.GrabOp p0);
 		public signal void in_fullscreen_changed ();
 		public signal bool init_xserver (GLib.Task object);
+#if HAS_MUTTER50
+		public signal void modifiers_accelerator_activated ();
+#else
 		public signal bool modifiers_accelerator_activated ();
+#endif
 		public signal void overlay_key ();
 		public signal void pad_mode_switch (Clutter.InputDevice object, uint p0, uint p1);
 		public signal void restacked ();
+#if !HAS_MUTTER50
 		public signal bool restart ();
+#endif
 		public signal void show_osd (int object, string p0, string p1);
 		public signal unowned Clutter.Actor? show_pad_osd (Clutter.InputDevice pad, GLib.Settings settings, string layout_path, bool edition_mode, int monitor_idx);
 		public signal bool show_resize_popup (bool object, Mtk.Rectangle p0, int p1, int p2);
+#if !HAS_MUTTER50
 		public signal bool show_restart_message (string? message);
+#endif
 		public signal void showing_desktop_changed ();
 		public signal void window_created (Meta.Window object);
 		public signal void window_demands_attention (Meta.Window object);
@@ -593,6 +631,9 @@ namespace Meta {
 		[CCode (has_construct_function = false)]
 		protected IdleMonitor ();
 		public uint add_idle_watch (uint64 interval_msec, owned Meta.IdleMonitorWatchFunc? callback);
+#if HAS_MUTTER50
+		public uint add_idle_watch_full (uint64 interval_msec, [CCode (delegate_target_pos = 2.33333, destroy_notify_pos = 2.66667)] owned Meta.IdleMonitorWatchFunc? callback, Meta.IdleMonitorWatchFlags flags);
+#endif
 		public uint add_user_active_watch (owned Meta.IdleMonitorWatchFunc? callback);
 		public int64 get_idletime ();
 		public void remove_watch (uint id);
@@ -612,6 +653,18 @@ 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_MUTTER50
+	[CCode (cheader_filename = "meta/main.h", ref_function = "meta_keymap_description_ref", type_id = "meta_keymap_description_get_type ()", unref_function = "meta_keymap_description_unref")]
+	[Compact]
+	public class KeymapDescription {
+		public bool direct_equal (Meta.KeymapDescription other);
+		[CCode (has_construct_function = false)]
+		public KeymapDescription.from_rules (string model, string layout, string variant, string options, [CCode (array_length = false, array_null_terminated = true)] string[] display_names, [CCode (array_length = false, array_null_terminated = true)] string[] short_names);
+		public bool is_locked ();
+		public Meta.KeymapDescription @ref ();
+		public void unref ();
+	}
+#endif
 	[CCode (cheader_filename = "meta/types.h", type_id = "meta_laters_get_type ()")]
 	public class Laters : GLib.Object {
 		[CCode (has_construct_function = false)]
@@ -661,6 +714,9 @@ namespace Meta {
 		[CCode (has_construct_function = false)]
 		protected MonitorManager ();
 		public bool can_switch_config ();
+#if HAS_MUTTER50
+		public unowned Meta.Backend get_backend ();
+#endif
 		public int get_display_configuration_timeout ();
 		public bool get_is_builtin_display_on ();
 #if HAS_MUTTER49
@@ -673,8 +729,12 @@ namespace Meta {
 		public bool get_panel_orientation_managed ();
 		public Meta.MonitorSwitchConfigType get_switch_config ();
 		public void switch_config (Meta.MonitorSwitchConfigType config_type);
+#if HAS_MUTTER50
+		public Meta.Backend backend { get; construct; }
+#else
 		[NoAccessorMethod]
 		public Meta.Backend backend { owned get; construct; }
+#endif
 #if !HAS_MUTTER48
 		[NoAccessorMethod]
 		public string experimental_hdr { owned get; set; }
@@ -785,16 +845,18 @@ namespace Meta {
 		[NoWrapper]
 		public virtual void unminimize (Meta.WindowActor actor);
 		public void unminimize_completed (Meta.WindowActor actor);
+#if !HAS_MUTTER50
 #if !HAS_MUTTER46
 		[NoWrapper]
 		public virtual bool xevent_filter ([CCode (type = "XEvent*")] ref X.Event event);
 #endif
 #if HAS_MUTTER49
 		[NoWrapper]
-		public virtual bool xevent_filter (Meta.XEvent event);
+		public virtual bool xevent_filter ([CCode (type = "MetaXEvent*")] X.Event event);
 #elif HAS_MUTTER48
 		[NoWrapper]
 		public virtual bool xevent_filter (X.Event event);
+#endif
 #endif
 	}
 	[CCode (cheader_filename = "meta/meta-remote-access-controller.h", type_id = "meta_remote_access_controller_get_type ()")]
@@ -1001,6 +1063,9 @@ namespace Meta {
 		protected Window ();
 		public void activate (uint32 current_time);
 		public void activate_with_workspace (uint32 current_time, Meta.Workspace workspace);
+#if HAS_MUTTER50
+		public void add_external_constraint (Meta.ExternalConstraint constraint);
+#endif
 		public bool allows_move ();
 		public bool allows_resize ();
 #if HAS_MUTTER49
@@ -1101,6 +1166,9 @@ namespace Meta {
 		public bool has_pointer ();
 #if HAS_MUTTER49
 		public void hide_from_window_list ();
+#endif
+#if HAS_MUTTER50
+		public void inhibit_mapped ();
 #endif
 		public bool is_above ();
 		public bool is_always_on_all_workspaces ();
@@ -1111,6 +1179,9 @@ namespace Meta {
 #endif
 		public bool is_fullscreen ();
 		public bool is_hidden ();
+#if HAS_MUTTER50
+		public bool is_mapped_inhibited ();
+#endif
 #if HAS_MUTTER49
 		public bool is_maximized ();
 #endif
@@ -1144,6 +1215,9 @@ namespace Meta {
 		public void raise_and_make_recent_on_workspace (Meta.Workspace workspace);
 #else
 		public void raise_and_make_recent ();
+#endif
+#if HAS_MUTTER50
+		public void remove_external_constraint (Meta.ExternalConstraint constraint);
 #endif
 		public void set_compositor_private (GLib.Object priv);
 		public void set_demands_attention ();
@@ -1165,6 +1239,9 @@ namespace Meta {
 		public Mtk.Rectangle stage_to_protocol_rect (Mtk.Rectangle stage_rect);
 #endif
 		public void stick ();
+#if HAS_MUTTER50
+		public void uninhibit_mapped ();
+#endif
 #if !HAS_MUTTER48
 		public bool titlebar_is_onscreen ();
 #endif
@@ -1183,6 +1260,12 @@ namespace Meta {
 		[CCode (cheader_filename = "meta/meta-x11-group.h")]
 #endif
 		public unowned Meta.Group? x11_get_group ();
+#endif
+#if HAS_MUTTER50
+		[NoAccessorMethod]
+		public string a11y_dbus_name { owned get; }
+		[NoAccessorMethod]
+		public string a11y_object_path { owned get; }
 #endif
 		[NoAccessorMethod]
 		public bool above { get; }
@@ -1383,7 +1466,11 @@ namespace Meta {
 		public signal void workspaces_reordered ();
 	}
 	[CCode (cheader_filename = "meta/meta-x11-display.h", type_id = "meta_x11_display_get_type ()")]
+#if HAS_MUTTER50
+	public class X11Display : GLib.Object {
+#else
 	public sealed class X11Display : GLib.Object {
+#endif
 		[CCode (has_construct_function = false)]
 		protected X11Display ();
 #if !HAS_MUTTER47
@@ -1404,10 +1491,12 @@ namespace Meta {
 #endif
 		public void redirect_windows (Meta.Display display);
 		public void remove_event_func (uint id);
+#if !HAS_MUTTER50
 #if HAS_MUTTER47
 		public void set_stage_input_region ([CCode (array_length_cname = "n_rects", array_length_pos = 1.1, type = "XRectangle*")] X.Xrectangle[] rects);
 #else
 		public void set_stage_input_region (X.XserverRegion region);
+#endif
 #endif
 	}
 	[CCode (cheader_filename = "meta/meta-close-dialog.h", type_cname = "MetaCloseDialogInterface", type_id = "meta_close_dialog_get_type ()")]
@@ -1421,6 +1510,12 @@ namespace Meta {
 		[HasEmitter]
 		public signal void response (Meta.CloseDialogResponse response);
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "meta/main.h", type_cname = "MetaExternalConstraintInterface", type_id = "meta_external_constraint_get_type ()")]
+	public interface ExternalConstraint : GLib.Object {
+		public abstract bool constrain (Meta.Window window, Meta.ExternalConstraintInfo info);
+	}
+#endif
 	[CCode (cheader_filename = "meta/meta-inhibit-shortcuts-dialog.h", type_cname = "MetaInhibitShortcutsDialogInterface", type_id = "meta_inhibit_shortcuts_dialog_get_type ()")]
 	public interface InhibitShortcutsDialog : GLib.Object {
 		public abstract void hide ();
@@ -1447,6 +1542,14 @@ namespace Meta {
 		public Meta.Side side_type;
 		public Meta.EdgeType edge_type;
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "meta/main.h", has_type_id = false)]
+	public struct ExternalConstraintInfo {
+		public Mtk.Rectangle new_rect;
+		public Meta.ExternalConstraintFlags flags;
+		public Meta.Gravity resize_gravity;
+	}
+#endif
 	[CCode (cheader_filename = "meta/main.h", has_type_id = false)]
 	public struct FrameBorder {
 		public int16 left;
@@ -1486,7 +1589,7 @@ namespace Meta {
 		public Mtk.Rectangle rect;
 		public Meta.Side side;
 	}
-#if HAS_MUTTER49
+#if HAS_MUTTER49 && !HAS_MUTTER50
 	[CCode (cheader_filename = "meta/main.h")]
 	public struct XEvent {
 	}
@@ -1536,6 +1639,7 @@ namespace Meta {
 		MINIMIZE,
 		NONE
 	}
+#if !HAS_MUTTER50
 	[CCode (cheader_filename = "meta/meta-enums.h", cprefix = "META_COMPOSITOR_TYPE_", type_id = "meta_compositor_type_get_type ()")]
 	public enum CompositorType {
 		WAYLAND,
@@ -1607,6 +1711,7 @@ namespace Meta {
 		LAST
 #endif
 	}
+#endif
 	[CCode (cheader_filename = "meta/util.h", cprefix = "META_DEBUG_PAINT_", type_id = "meta_debug_paint_flag_get_type ()")]
 	[Flags]
 	public enum DebugPaintFlag {
@@ -1707,6 +1812,15 @@ namespace Meta {
 		SUCCESS,
 		ERROR
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "meta/main.h", cprefix = "META_EXTERNAL_CONSTRAINT_FLAGS_", type_id = "meta_external_constraint_flags_get_type ()")]
+	[Flags]
+	public enum ExternalConstraintFlags {
+		NONE,
+		MOVE,
+		RESIZE
+	}
+#endif
 	[CCode (cheader_filename = "meta/common.h", cprefix = "META_FRAME_TYPE_", type_id = "meta_frame_type_get_type ()")]
 	public enum FrameType {
 		NORMAL,
@@ -1717,7 +1831,9 @@ namespace Meta {
 		BORDER,
 		ATTACHED,
 		LAST;
+#if !HAS_MUTTER50
 		[CCode (cheader_filename = "meta/util.h")]
+#endif
 		public unowned string to_string ();
 	}
 	[CCode (cheader_filename = "meta/common.h", cprefix = "META_GRAB_OP_", type_id = "meta_grab_op_get_type ()")]
@@ -1758,9 +1874,20 @@ namespace Meta {
 		SOUTH,
 		SOUTH_EAST,
 		STATIC;
+#if !HAS_MUTTER50
 		[CCode (cheader_filename = "meta/util.h")]
+#endif
 		public unowned string to_string ();
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "meta/main.h", cprefix = "META_IDLE_MONITOR_WATCH_FLAGS_", type_id = "meta_idle_monitor_watch_flags_get_type ()")]
+	[Flags]
+	public enum IdleMonitorWatchFlags {
+		NONE,
+		UNINHIBITABLE,
+		START_NOW
+	}
+#endif
 	[CCode (cheader_filename = "meta/meta-inhibit-shortcuts-dialog.h", cprefix = "META_INHIBIT_SHORTCUTS_DIALOG_RESPONSE_", type_id = "meta_inhibit_shortcuts_dialog_response_get_type ()")]
 	public enum InhibitShortcutsDialogResponse {
 		ALLOW,
@@ -2028,7 +2155,7 @@ namespace Meta {
 	public enum PadFeatureType {
 		RING,
 #if HAS_MUTTER49
-        DIAL,
+		DIAL,
 #endif
 		STRIP
 	}
@@ -2073,7 +2200,9 @@ namespace Meta {
 		DRAG_THRESHOLD,
 		LOCATE_POINTER,
 		CHECK_ALIVE_TIMEOUT;
+#if !HAS_MUTTER50
 		[CCode (cheader_filename = "meta/prefs.h")]
+#endif
 		public unowned string to_string ();
 	}
 	[CCode (cheader_filename = "meta/meta-selection-source.h", cprefix = "META_", type_id = "meta_selection_type_get_type ()")]
@@ -2223,21 +2352,46 @@ namespace Meta {
 #if !HAS_MUTTER48
 	[CCode (cheader_filename = "meta/main.h")]
 	public static void get_clutter_debug_flags (out Clutter.DebugFlag debug_flags, out Clutter.DrawDebugFlag draw_flags, out Clutter.PickDebugFlag pick_flags);
+#endif
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "meta/util.h")]
+	[Version (replacement = "FrameType.to_string")]
+	public static unowned string frame_type_to_string (Meta.FrameType type);
 #endif
 	[CCode (cheader_filename = "meta/main.h")]
 	public static Meta.DebugPaintFlag get_debug_paint_flags ();
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "meta/main.h")]
+	[Version (replacement = "Gravity.to_string")]
+	public static unowned string gravity_to_string (Meta.Gravity gravity);
+#else
 	[CCode (cheader_filename = "meta/main.h")]
 	public static bool is_restart ();
+#endif
 	[CCode (cheader_filename = "meta/main.h")]
 	public static bool is_topic_enabled (Meta.DebugTopic topic);
 	[CCode (cheader_filename = "meta/main.h")]
 	public static void log (string format, ...);
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "meta/main.h")]
+	[Version (replacement = "Orientation.to_transform")]
+	public static Mtk.MonitorTransform orientation_to_transform (Meta.Orientation orientation);
+	[CCode (cheader_filename = "meta/prefs.h")]
+	[Version (replacement = "Preference.to_string")]
+	public static unowned string preference_to_string (Meta.Preference pref);
+	[CCode (cheader_filename = "meta/main.h")]
+	public static async bool read_bytes (int fd, uint32 offset, uint32 length) throws GLib.Error;
+	[CCode (cheader_filename = "meta/main.h")]
+	public static void remove_debug_paint_flag (Meta.DebugPaintFlag flag);
+#endif
 #if !HAS_MUTTER48
 	[CCode (cheader_filename = "meta/main.h")]
 	public static void remove_clutter_debug_flags (Clutter.DebugFlag debug_flags, Clutter.DrawDebugFlag draw_flags, Clutter.PickDebugFlag pick_flags);
 #endif
+#if !HAS_MUTTER50
 	[CCode (cheader_filename = "meta/main.h")]
 	public static void remove_debug_paint_flag (Meta.DebugPaintFlag flag);
 	[CCode (cheader_filename = "meta/main.h")]
 	public static void restart (string? message, Meta.Context context);
+#endif
 }
diff --git a/vapi/meson.build b/vapi/meson.build
index 408feaec..464346fa 100644
--- a/vapi/meson.build
+++ b/vapi/meson.build
@@ -414,3 +414,72 @@ if mutter49_dep.found()
 		output: 'libmutter-17.vapi'
 	)
 endif
+if mutter50_dep.found()
+	mtk_target = custom_target('mutter-mtk-18',
+		command: [
+			vapigen,
+			mutter_typelib_dir / 'Mtk-18.gir',
+			'--library=mutter-mtk-18',
+			'--pkg=gobject-2.0',
+			'--pkg=gio-2.0',
+			'--pkg=cairo',
+			'--pkg=graphene-gobject-1.0',
+			vapigen_args
+		],
+		output: 'mutter-mtk-18.vapi'
+	)
+	cogl_target = custom_target('mutter-cogl-18',
+		command: [
+			vapigen,
+			mutter_typelib_dir / 'Cogl-18.gir',
+			'--library=mutter-cogl-18',
+			'--pkg=mutter-mtk-18',
+			'--pkg=gobject-2.0',
+			'--pkg=gio-2.0',
+			'--pkg=cairo',
+			'--pkg=graphene-gobject-1.0',
+			'--pkg=x11',
+			vapigen_args,
+			files('Cogl-18-custom.vala')
+		],
+		depends: mtk_target,
+		output: 'mutter-cogl-18.vapi'
+	)
+	clutter_target = custom_target('mutter-clutter-18',
+		command: [
+			vapigen,
+			mutter_typelib_dir / 'Clutter-18.gir',
+			'--library=mutter-clutter-18',
+			'--pkg=graphene-gobject-1.0',
+			'--pkg=mutter-mtk-18',
+			'--pkg=mutter-cogl-18',
+			'--pkg=atk',
+			'--pkg=gio-2.0',
+			'--pkg=json-glib-1.0',
+			'--pkg=pango',
+			'--pkg=x11',
+			vapigen_args,
+		],
+		depends: [ cogl_target, mtk_target ],
+		output: 'mutter-clutter-18.vapi'
+	)
+	libmutter_target = custom_target('libmutter-18',
+		command: [
+			vapigen,
+			mutter_typelib_dir / 'Meta-18.gir',
+			'--library=libmutter-18',
+			'--pkg=graphene-gobject-1.0',
+			'--pkg=mutter-cogl-18',
+			'--pkg=mutter-clutter-18',
+			'--pkg=atk',
+			'--pkg=gio-2.0',
+			'--pkg=json-glib-1.0',
+			'--pkg=pango',
+			'--pkg=x11',
+			'--pkg=xfixes-4.0',
+			vapigen_args
+		],
+		depends: [ cogl_target, clutter_target ],
+		output: 'libmutter-18.vapi'
+	)
+endif
diff --git a/vapi/mutter-clutter-18.deps b/vapi/mutter-clutter-18.deps
new file mode 100644
index 00000000..b3056877
--- /dev/null
+++ b/vapi/mutter-clutter-18.deps
@@ -0,0 +1,6 @@
+atk
+cairo
+pango
+json-glib-1.0
+mutter-cogl-18
+graphene-gobject-1.0
diff --git a/vapi/mutter-clutter-18.vapi b/vapi/mutter-clutter-18.vapi
new file mode 120000
index 00000000..ee388ea5
--- /dev/null
+++ b/vapi/mutter-clutter-18.vapi
@@ -0,0 +1 @@
+mutter-clutter-17.vapi
\ No newline at end of file
diff --git a/vapi/mutter-clutter.vapi b/vapi/mutter-clutter.vapi
index 780e379f..ae1a0b08 100644
--- a/vapi/mutter-clutter.vapi
+++ b/vapi/mutter-clutter.vapi
@@ -5235,6 +5235,9 @@ namespace Clutter {
 		public void get_content_scaling_filters (out Clutter.ScalingFilter min_filter, out Clutter.ScalingFilter mag_filter);
 #if HAS_MUTTER47
 		public unowned Clutter.Context get_context ();
+#endif
+#if HAS_MUTTER50
+		public Clutter.CursorType get_cursor_type ();
 #endif
 		public uint get_easing_delay ();
 		public uint get_easing_duration ();
@@ -5404,6 +5407,9 @@ namespace Clutter {
 		public void set_content_gravity (Clutter.ContentGravity gravity);
 		public void set_content_repeat (Clutter.ContentRepeat repeat);
 		public void set_content_scaling_filters (Clutter.ScalingFilter min_filter, Clutter.ScalingFilter mag_filter);
+#if HAS_MUTTER50
+		public void set_cursor_type (Clutter.CursorType cursor_type);
+#endif
 		public void set_easing_delay (uint msecs);
 		public void set_easing_duration (uint msecs);
 		public void set_easing_mode (Clutter.AnimationMode mode);
@@ -5486,6 +5492,9 @@ namespace Clutter {
 		public Clutter.ContentRepeat content_repeat { get; set; }
 #if HAS_MUTTER47
 		public Clutter.Context context { get; construct; }
+#endif
+#if HAS_MUTTER50
+		public Clutter.CursorType cursor_type { get; set; }
 #endif
 		[NoAccessorMethod]
 		public Clutter.Effect effect { set; }
@@ -5939,7 +5948,11 @@ namespace Clutter {
 		public uint get_id ();
 #if HAS_MUTTER48
 		[NoWrapper]
+#if HAS_MUTTER50
+		public virtual void init_color_transform_key (Clutter.ColorState target_color_state, Clutter.ColorStateTransformFlags flags, Clutter.ColorTransformKey key);
+#else
 		public virtual void init_color_transform_key (Clutter.ColorState target_color_state, Clutter.ColorTransformKey key);
+#endif
 #if HAS_MUTTER49
 		public virtual bool needs_mapping (Clutter.ColorState target_color_state);
 		public void params_do_tone_mapping (Clutter.ColorState other_color_state, [CCode (array_length = false)] float[] data, int n_samples);
@@ -5992,7 +6005,11 @@ namespace Clutter {
 		[CCode (has_construct_function = false, type = "ClutterColorState*")]
 		public ColorStateParams.from_primitives (Clutter.Context context, Clutter.Colorimetry colorimetry, Clutter.EOTF eotf, Clutter.Luminance luminance);
 		[CCode (has_construct_function = false, type = "ClutterColorState*")]
+#if HAS_MUTTER50
+		public ColorStateParams.full (Clutter.Context context, Clutter.Colorspace colorspace, Clutter.TransferFunction transfer_function, Clutter.Primaries primaries, float gamma_exp, float min_lum, float max_lum, float ref_lum, float mastering_max_lum);
+#else
 		public ColorStateParams.full (Clutter.Context context, Clutter.Colorspace colorspace, Clutter.TransferFunction transfer_function, Clutter.Primaries primaries, float gamma_exp, float min_lum, float max_lum, float ref_lum);
+#endif
 		public unowned Clutter.Colorimetry? get_colorimetry ();
 		public unowned Clutter.EOTF? get_eotf ();
 		public unowned Clutter.Luminance? get_luminance ();
@@ -6048,6 +6065,28 @@ namespace Clutter {
 	[Compact]
 	public class CrossingEvent : Clutter.Event {
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_cursor_get_type ()")]
+	public abstract class Cursor : GLib.Object {
+		[CCode (has_construct_function = false)]
+		protected Cursor ();
+		[NoWrapper]
+		public virtual uint get_current_frame_time ();
+		[NoWrapper]
+		public virtual void invalidate ();
+		[NoWrapper]
+		public virtual bool is_animated ();
+		[NoWrapper]
+		public virtual void prepare_at (float best_scale, int x, int y);
+		[NoWrapper]
+		public virtual bool realize_texture ();
+		[NoWrapper]
+		public virtual void tick_frame ();
+		[NoAccessorMethod]
+		public Clutter.ColorState color_state { construct; }
+		public signal void texture_changed ();
+	}
+#endif
 	[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_deform_effect_get_type ()")]
 	public abstract class DeformEffect : Clutter.OffscreenEffect {
 		[CCode (has_construct_function = false)]
@@ -6132,7 +6171,9 @@ namespace Clutter {
 		public void get_coords (out float x, out float y);
 		public unowned Clutter.InputDevice get_device ();
 		public unowned Clutter.InputDeviceTool get_device_tool ();
+#if !HAS_MUTTER50
 		public Clutter.InputDeviceType get_device_type ();
+#endif
 		public float get_distance (Clutter.Event target);
 		public uint32 get_event_code ();
 		public unowned Clutter.EventSequence get_event_sequence ();
@@ -6259,6 +6300,9 @@ namespace Clutter {
 	[Compact]
 	public class Frame {
 		public int64 get_count ();
+#if HAS_MUTTER50
+		public bool get_expected_presentation_time (int64 expected_presentation_time_us);
+#endif
 #if HAS_MUTTER46
 		public bool get_frame_deadline (int64 frame_deadline_us);
 #else
@@ -6391,7 +6435,9 @@ namespace Clutter {
 		public void activate ();
 #endif
 		public void dismiss ();
+#if !HAS_MUTTER50
 		public Clutter.GrabState get_seat_state ();
+#endif
 #if HAS_MUTTER46
 		public bool is_revoked ();
 		[NoAccessorMethod]
@@ -6450,13 +6496,17 @@ namespace Clutter {
 		public uint get_bus_type ();
 #endif
 		public Clutter.InputCapabilities get_capabilities ();
+#if !HAS_MUTTER50
 		public Clutter.InputMode get_device_mode ();
+#endif
 		public unowned string get_device_name ();
 		public unowned string get_device_node ();
 		public Clutter.InputDeviceType get_device_type ();
 		public virtual bool get_dimensions (out uint width, out uint height);
 		public virtual int get_group_n_modes (int group);
+#if !HAS_MUTTER50
 		public bool get_has_cursor ();
+#endif
 		public int get_mode_switch_button_group (uint button);
 		public int get_n_buttons ();
 #if HAS_MUTTER49
@@ -6483,10 +6533,14 @@ namespace Clutter {
 		public uint bus_type { get; construct; }
 #endif
 		public Clutter.InputCapabilities capabilities { get; construct; }
+#if !HAS_MUTTER50
 		public Clutter.InputMode device_mode { get; construct; }
+#endif
 		public string device_node { get; construct; }
 		public Clutter.InputDeviceType device_type { get; construct; }
+#if !HAS_MUTTER50
 		public bool has_cursor { get; construct; }
+#endif
 		public int n_buttons { get; construct; }
 #if HAS_MUTTER49
 		public int n_dials { get; construct; }
@@ -6651,6 +6705,10 @@ namespace Clutter {
 		[CCode (has_construct_function = false)]
 		protected Keymap ();
 		public bool get_caps_lock_state ();
+#if HAS_MUTTER50
+		public unowned string? get_current_display_name ();
+		public unowned string? get_current_short_name ();
+#endif
 #if HAS_MUTTER46
 		public virtual Clutter.TextDirection get_direction ();
 #else
@@ -6846,6 +6904,9 @@ namespace Clutter {
 		public Graphene.Point get_begin_centroid ();
 		public Graphene.Point get_begin_centroid_abs ();
 		public uint get_begin_threshold ();
+#if HAS_MUTTER50
+		public uint get_button ();
+#endif
 		public Graphene.Point get_centroid ();
 		public Graphene.Point get_centroid_abs ();
 		public Graphene.Vec2 get_delta ();
@@ -6853,16 +6914,26 @@ namespace Clutter {
 		public uint get_max_n_points ();
 		public uint get_min_n_points ();
 		public Clutter.PanAxis get_pan_axis ();
+#if HAS_MUTTER50
+		public uint get_required_button ();
+		public Clutter.ModifierType get_state ();
+#endif
 		public Graphene.Vec2 get_velocity ();
 		public Graphene.Vec2 get_velocity_abs ();
 		public void set_begin_threshold (uint begin_threshold);
 		public void set_max_n_points (uint max_n_points);
 		public void set_min_n_points (uint min_n_points);
 		public void set_pan_axis (Clutter.PanAxis axis);
+#if HAS_MUTTER50
+		public void set_required_button (uint required_button);
+#endif
 		public uint begin_threshold { get; set; }
 		public uint max_n_points { get; set; }
 		public uint min_n_points { get; set; }
 		public Clutter.PanAxis pan_axis { get; set; }
+#if HAS_MUTTER50
+		public uint required_button { get; set; }
+#endif
 		public signal void pan_update ();
 	}
 #else
@@ -7108,8 +7179,10 @@ namespace Clutter {
 #endif
 		public void get_pointer_a11y_settings (Clutter.PointerA11ySettings settings);
 		public bool get_touch_mode ();
+#if !HAS_MUTTER50
 		[NoWrapper]
 		public virtual Clutter.GrabState grab (uint32 time);
+#endif
 #if HAS_MUTTER48
 		[NoWrapper]
 #endif
@@ -7126,8 +7199,10 @@ namespace Clutter {
 #endif
 		public void set_pointer_a11y_dwell_click_type (Clutter.PointerA11yDwellClickType click_type);
 		public void set_pointer_a11y_settings (Clutter.PointerA11ySettings settings);
+#if !HAS_MUTTER50
 		[NoWrapper]
 		public virtual void ungrab (uint32 time);
+#endif
 		public void uninhibit_unfocus ();
 		public virtual void warp_pointer (int x, int y);
 #if HAS_MUTTER47
@@ -7137,7 +7212,11 @@ namespace Clutter {
 		public bool touch_mode { get; }
 		public signal void device_added (Clutter.InputDevice object);
 		public signal void device_removed (Clutter.InputDevice object);
+#if HAS_MUTTER50
+		public virtual signal void is_unfocus_inhibited_changed ();
+#else
 		public signal void is_unfocus_inhibited_changed ();
+#endif
 		public signal void kbd_a11y_flags_changed (uint settings_flags, uint changed_mask);
 		public signal void kbd_a11y_mods_state_changed (uint latched_mask, uint locked_mask);
 		public signal void ptr_a11y_dwell_click_type_changed (Clutter.PointerA11yDwellClickType click_type);
@@ -7262,8 +7341,17 @@ namespace Clutter {
 		[CCode (has_construct_function = false)]
 		protected Sprite ();
 		public Graphene.Point get_coords ();
+#if HAS_MUTTER50
+		public Clutter.SpriteRole get_role ();
+		[NoWrapper]
+		public virtual void update_cursor (Clutter.Cursor cursor);
+		public Clutter.SpriteRole role { get; construct; }
+		[NoAccessorMethod]
+		public Clutter.InputDevice sprite_device { owned get; construct; }
+#else
 		[NoAccessorMethod]
 		public Clutter.InputDevice device { owned get; construct; }
+#endif
 		[NoAccessorMethod]
 		public Clutter.EventSequence sequence { owned get; construct; }
 	}
@@ -7344,7 +7432,9 @@ namespace Clutter {
 		public signal void after_update (Clutter.StageView view, Clutter.Frame frame);
 		public virtual signal void before_paint (Clutter.StageView view, Clutter.Frame frame);
 		public signal void before_update (Clutter.StageView view, Clutter.Frame frame);
+#if !HAS_MUTTER50
 		public virtual signal void deactivate ();
+#endif
 		public virtual signal void paint_view (Clutter.StageView view, Cairo.Region redraw_clip, Clutter.Frame frame);
 		public signal void prepare_frame (Clutter.StageView view, Clutter.Frame frame);
 #if HAS_MUTTER48
@@ -8003,6 +8093,9 @@ namespace Clutter {
 		public float min;
 		public float max;
 		public float @ref;
+#if HAS_MUTTER50
+		public float mastering_max;
+#endif
 	}
 #endif
 #if !HAS_MUTTER47
@@ -8349,7 +8442,7 @@ namespace Clutter {
 		SRGB,
 #if HAS_MUTTER48
 		BT2020,
-#if HAS_MUTTER39
+#if HAS_MUTTER49
 		PAL,
 		P3,
 #endif
@@ -8381,6 +8474,49 @@ namespace Clutter {
 		Y_AXIS,
 		BOTH
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_CURSOR_", type_id = "clutter_cursor_type_get_type ()")]
+	public enum CursorType {
+		INHERIT,
+		NONE,
+		DEFAULT,
+		CONTEXT_MENU,
+		HELP,
+		POINTER,
+		PROGRESS,
+		WAIT,
+		CELL,
+		CROSSHAIR,
+		TEXT,
+		VERTICAL_TEXT,
+		ALIAS,
+		COPY,
+		MOVE,
+		NO_DROP,
+		NOT_ALLOWED,
+		GRAB,
+		GRABBING,
+		E_RESIZE,
+		N_RESIZE,
+		NE_RESIZE,
+		NW_RESIZE,
+		S_RESIZE,
+		SE_RESIZE,
+		SW_RESIZE,
+		W_RESIZE,
+		EW_RESIZE,
+		NS_RESIZE,
+		NESW_RESIZE,
+		NWSE_RESIZE,
+		COL_RESIZE,
+		ROW_RESIZE,
+		ALL_SCROLL,
+		ZOOM_IN,
+		ZOOM_OUT,
+		DND_ASK,
+		ALL_RESIZE
+	}
+#endif
 #if !HAS_MUTTER48
 #if HAS_MUTTER46
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_CONTEXT_FLAG_", type_id = "clutter_context_flags_get_type ()")]
@@ -8572,12 +8708,15 @@ namespace Clutter {
 		CLUTTER_N_GESTURE_STATES
 	}
 #endif
+#if !HAS_MUTTER49
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_GESTURE_TRIGGER_EDGE_", type_id = "clutter_gesture_trigger_edge_get_type ()")]
 	public enum GestureTriggerEdge {
 		NONE,
 		AFTER,
 		BEFORE
 	}
+#endif
+#if !HAS_MUTTER50
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_GRAB_STATE_", type_id = "clutter_grab_state_get_type ()")]
 	[Flags]
 	public enum GrabState {
@@ -8586,6 +8725,7 @@ namespace Clutter {
 		KEYBOARD,
 		ALL
 	}
+#endif
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_GRID_POSITION_", type_id = "clutter_grid_position_get_type ()")]
 	public enum GridPosition {
 		LEFT,
@@ -8704,12 +8844,14 @@ namespace Clutter {
 		PAD_DEVICE,
 		N_DEVICE_TYPES
 	}
+#if !HAS_MUTTER50
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_INPUT_MODE_", type_id = "clutter_input_mode_get_type ()")]
 	public enum InputMode {
 		LOGICAL,
 		PHYSICAL,
 		FLOATING
 	}
+#endif
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_INPUT_PANEL_STATE_", type_id = "clutter_input_panel_state_get_type ()")]
 	public enum InputPanelState {
 		OFF,
@@ -8955,6 +9097,14 @@ namespace Clutter {
 		BOTTOM,
 		LEFT
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_SPRITE_ROLE_", type_id = "clutter_sprite_role_get_type ()")]
+	public enum SpriteRole {
+		POINTER,
+		TABLET,
+		TOUCHPOINT
+	}
+#endif
 #if !HAS_MUTTER46
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_COLOR_", type_id = "clutter_static_color_get_type ()")]
 	public enum StaticColor {
@@ -9010,6 +9160,7 @@ namespace Clutter {
 		START,
 		END
 	}
+#if !HAS_MUTTER50
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_SWIPE_DIRECTION_", type_id = "clutter_swipe_direction_get_type ()")]
 	[Flags]
 	public enum SwipeDirection {
@@ -9018,6 +9169,7 @@ namespace Clutter {
 		LEFT,
 		RIGHT
 	}
+#endif
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_TEXT_DIRECTION_", type_id = "clutter_text_direction_get_type ()")]
 	public enum TextDirection {
 		DEFAULT,
@@ -9039,11 +9191,17 @@ namespace Clutter {
 #if HAS_MUTTER47
 	[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_TRANSFER_FUNCTION_", type_id = "clutter_transfer_function_get_type ()")]
 	public enum TransferFunction {
+#if !HAS_MUTTER50
 		DEFAULT,
+#endif
 		SRGB,
 		PQ,
 #if HAS_MUTTER48
+#if HAS_MUTTER50
+		BT1886,
+#else
 		BT709,
+#endif
 		LINEAR
 #else
 		LINEAR;
@@ -9119,6 +9277,14 @@ namespace Clutter {
 #endif
 	[CCode (cheader_filename = "clutter/clutter.h", cname = "CLUTTER_PRIORITY_REDRAW")]
 	public const int PRIORITY_REDRAW;
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "clutter/clutter.h")]
+	[Version (replacement = "ActorBox.alloc")]
+	public static Clutter.ActorBox? actor_box_alloc ();
+	[CCode (cheader_filename = "clutter/clutter.h")]
+	[Version (replacement = "ActorBox.clamp_to_pixel")]
+	public static void actor_box_clamp_to_pixel (ref Clutter.ActorBox box);
+#endif
 #if !HAS_MUTTER46
 	[CCode (cheader_filename = "clutter/clutter.h")]
 	public static void cairo_clear (Cairo.Context cr);
@@ -9128,12 +9294,27 @@ namespace Clutter {
 #if HAS_MUTTER48
 	[CCode (cheader_filename = "clutter/clutter.h")]
 	public static void add_debug_flags (Clutter.DebugFlag debug_flags, Clutter.DrawDebugFlag draw_flags, Clutter.PickDebugFlag pick_flags);
+#endif
+#if HAS_MUTTER50
+	[Version (replacement = "Colorspace.to_primaries")]
+	public static unowned Clutter.Primaries? colorspace_to_primaries (Clutter.Colorspace colorspace);
 #endif
 	[CCode (cheader_filename = "clutter/clutter.h")]
 	public static void debug_set_max_render_time_constant (int max_render_time_constant_us);
 #if !HAS_MUTTER47
 	[CCode (cheader_filename = "clutter/clutter.h")]
 	public static void disable_accessibility ();
+#endif
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "clutter/clutter.h")]
+	[Version (replacement = "Event.add_filter")]
+	public static uint event_add_filter (Clutter.Stage? stage, [CCode (delegate_target_pos = 2.2, destroy_notify_pos = 2.1)] owned Clutter.EventFilterFunc func);
+	[CCode (cheader_filename = "clutter/clutter.h")]
+	[Version (replacement = "Event.get")]
+	public static Clutter.Event event_get ();
+	[CCode (cheader_filename = "clutter/clutter.h")]
+	[Version (replacement = "Event.remove_filter")]
+	public static void event_remove_filter (uint id);
 #endif
 	[CCode (cheader_filename = "clutter/clutter.h")]
 	public static bool events_pending ();
@@ -9165,6 +9346,11 @@ namespace Clutter {
 	public static void keyval_convert_case (uint symbol, out uint lower, out uint upper);
 	[CCode (cheader_filename = "clutter/clutter.h")]
 	public static unowned string? keyval_name (uint keyval);
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "clutter/clutter.h")]
+	[Version (replacement = "PipelineCapability.quark")]
+	public static GLib.Quark pipeline_capability_quark ();
+#endif
 #if HAS_MUTTER48
 	[CCode (cheader_filename = "clutter/clutter.h")]
 	public static void remove_debug_flags (Clutter.DebugFlag debug_flags, Clutter.DrawDebugFlag draw_flags, Clutter.PickDebugFlag pick_flags);
diff --git a/vapi/mutter-cogl-14.vapi b/vapi/mutter-cogl-14.vapi
index 55a4088c..c234e7b6 100644
--- a/vapi/mutter-cogl-14.vapi
+++ b/vapi/mutter-cogl-14.vapi
@@ -122,16 +122,24 @@ namespace Cogl {
 		[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_foreach_feature")]
 		public void foreach_feature (Cogl.FeatureCallback callback);
 #endif
+#if !HAS_MUTTER50
 #if HAS_MUTTER49
 		public bool format_supports_upload (Cogl.PixelFormat format);
 #endif
 		public void free_timestamp_query (owned Cogl.TimestampQuery query);
+#endif
 		public unowned Cogl.Display get_display ();
+#if HAS_MUTTER50
+		public unowned Cogl.Driver get_driver ();
+#else
 		public int64 get_gpu_time_ns ();
+#endif
 #if !HAS_MUTTER47
 		[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_get_graphics_reset_status")]
 #endif
+#if !HAS_MUTTER50
 		public Cogl.GraphicsResetStatus get_graphics_reset_status ();
+#endif
 #if HAS_MUTTER48
 		public int get_latest_sync_fd ();
 #endif
@@ -147,9 +155,13 @@ namespace Cogl {
 #if HAS_MUTTER47
 		public bool has_winsys_feature (Cogl.WinsysFeature feature);
 #endif
+#if !HAS_MUTTER50
 		public bool is_hardware_accelerated ();
+#endif
 		public void set_named_pipeline (Cogl.PipelineKey key, Cogl.Pipeline? pipeline);
+#if !HAS_MUTTER50
 		public int64 timestamp_query_get_time_ns (Cogl.TimestampQuery query);
+#endif
 	}
 	[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_display_get_type ()")]
 	public sealed class Display : GLib.Object {
@@ -193,6 +205,19 @@ namespace Cogl {
 		public bool sync_read_end () throws GLib.Error;
 		public bool sync_read_start () throws GLib.Error;
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_driver_get_type ()")]
+	public abstract class Driver : GLib.Object {
+		[CCode (has_construct_function = false)]
+		protected Driver ();
+		public bool format_supports_upload (Cogl.PixelFormat format);
+		public Cogl.GraphicsResetStatus get_graphics_reset_status ();
+		public unowned string get_vendor ();
+		public bool has_feature (Cogl.FeatureID feature);
+		public bool is_hardware_accelerated ();
+		public void set_feature (Cogl.FeatureID feature, bool value);
+	}
+#endif
 #if !HAS_MUTTER47
 	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
 	[Compact]
@@ -217,19 +242,28 @@ namespace Cogl {
 		public int64 get_global_frame_counter ();
 #endif
 		public bool get_is_symbolic ();
+#if HAS_MUTTER50
+		public int64 get_kms_ready_time_us ();
+#endif
 		public int64 get_presentation_time_us ();
 		public float get_refresh_rate ();
+#if !HAS_MUTTER50
 		public int64 get_rendering_duration_ns ();
+#endif
 		public uint get_sequence ();
+#if !HAS_MUTTER50
 #if HAS_MUTTER49
 		public int64 get_target_presentation_time_us ();
 #endif
 		public int64 get_time_before_buffer_swap_us ();
+#endif
 #if HAS_MUTTER49
 		public int64 get_view_frame_counter ();
 #endif
+#if !HAS_MUTTER50
 #if HAS_MUTTER47
 		public bool has_valid_gpu_rendering_duration ();
+#endif
 #endif
 		public bool is_hw_clock ();
 		public bool is_vsync ();
@@ -404,6 +438,10 @@ namespace Cogl {
 	public sealed class Offscreen : Cogl.Framebuffer {
 		[CCode (has_construct_function = false)]
 		protected Offscreen ();
+#if HAS_MUTTER50
+		[CCode (has_construct_function = false)]
+		public Offscreen.from_formats (Cogl.Context context, Cogl.PixelFormat formats, size_t n_formats, int width, int height) throws GLib.Error;
+#endif
 		public unowned Cogl.Texture get_texture ();
 		[CCode (has_construct_function = false)]
 		public Offscreen.with_texture (Cogl.Texture texture);
@@ -447,6 +485,13 @@ namespace Cogl {
 		public virtual void swap_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5)] int[] rectangles, Cogl.FrameInfo info);
 #endif
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_onscreen_egl_get_type ()")]
+	public class OnscreenEgl : Cogl.Onscreen {
+		[CCode (has_construct_function = false)]
+		protected OnscreenEgl ();
+	}
+#endif
 #if !HAS_MUTTER47
 	[CCode (cheader_filename = "cogl/cogl.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "cogl_onscreen_dirty_closure_get_type ()")]
 	[Compact]
@@ -529,9 +574,15 @@ namespace Cogl {
 #endif
 		public void set_uniform_1f (int uniform_location, float value);
 		public void set_uniform_1i (int uniform_location, int value);
-		public void set_uniform_float (int uniform_location, int n_components, int count, float value);
+#if HAS_MUTTER50
+		public void set_uniform_float (int uniform_location, int n_components, int count, [CCode (array_length = false)] float[] value);
+		public void set_uniform_int (int uniform_location, int n_components, int count, [CCode (array_length = false)] int[] value);
+		public void set_uniform_matrix (int uniform_location, int dimensions, int count, bool transpose, [CCode (array_length = false)] float[] value);
+#else
+		public void set_uniform_float (int uniform_location, int n_components, int count, [CCode (array_length = false, array_null_terminated = false)] float[] value);
 		public void set_uniform_int (int uniform_location, int n_components, int count, int value);
 		public void set_uniform_matrix (int uniform_location, int dimensions, int count, bool transpose, float value);
+#endif
 		public void set_user_program (Cogl.Program program);
 	}
 	[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_pixel_buffer_get_type ()")]
@@ -640,10 +691,16 @@ namespace Cogl {
 #if HAS_MUTTER47
 		public void* get_proc_address (string name);
 #endif
-#if HAS_MUTTER49
-public void* get_winsys ();
+#if HAS_MUTTER50
+		public unowned Cogl.Winsys get_winsys ();
+#elif HAS_MUTTER49
+		public void* get_winsys ();
 #endif
+#if HAS_MUTTER50
+		public void* get_winsys_data ();
+#else
 		public Cogl.WinsysID get_winsys_id ();
+#endif
 		public bool is_dma_buf_supported ();
 #if HAS_MUTTER48
 		public bool is_implicit_drm_modifier (uint64 modifier);
@@ -657,9 +714,16 @@ public void* get_winsys ();
 #if !HAS_MUTTER47
 		public void set_winsys_id (Cogl.WinsysID winsys_id);
 #endif
+#if HAS_MUTTER50
+		public void set_custom_winsys (Cogl.Winsys winsys);
+#endif
 #if HAS_MUTTER49
 		public void set_driver (Cogl.DriverId driver);
+#if HAS_MUTTER50
+		public void set_winsys_data (void* winsys, GLib.DestroyNotify destroy);
+#else
 		public void set_winsys (void* winsys);
+#endif
 #endif
 	}
 	[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_scanout_get_type ()")]
@@ -670,7 +734,11 @@ public void* get_winsys ();
 #else
 		public Scanout (Cogl.ScanoutBuffer scanout_buffer);
 #endif
+#if HAS_MUTTER50
+		public bool copy_to_framebuffer (Cogl.Framebuffer framebuffer) throws GLib.Error;
+#else
 		public bool blit_to_framebuffer (Cogl.Framebuffer framebuffer, int x, int y) throws GLib.Error;
+#endif
 		public unowned Cogl.ScanoutBuffer get_buffer ();
 		public void get_dst_rect (Mtk.Rectangle dst_rect);
 		public void get_src_rect (Graphene.Rect rect);
@@ -760,7 +828,7 @@ public void* get_winsys ();
 		public uint get_width ();
 		public bool is_get_data_supported ();
 		public bool is_sliced ();
-#if HAS_MUTTER47
+#if HAS_MUTTER47 && !HAS_MUTTER49
 		public void set_auto_mipmap (bool value);
 #endif
 		public void set_components (Cogl.TextureComponents components);
@@ -808,10 +876,47 @@ public void* get_winsys ();
 		[CCode (has_construct_function = false, type = "CoglTexture*")]
 		public Texture2DSliced.with_size (Cogl.Context ctx, int width, int height, int max_waste);
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_winsys_get_type ()")]
+	public abstract class Winsys : GLib.Object {
+		[CCode (has_construct_function = false)]
+		protected Winsys ();
+		[NoWrapper]
+		public virtual bool context_init (Cogl.Context context) throws GLib.Error;
+		[NoWrapper]
+		public virtual void display_destroy (Cogl.Display display);
+		[NoWrapper]
+		public virtual bool display_setup (Cogl.Display display) throws GLib.Error;
+		[NoWrapper]
+		public virtual int get_sync_fd (Cogl.Context ctx);
+		[NoWrapper]
+		public virtual void renderer_bind_api (Cogl.Renderer renderer);
+		[NoWrapper]
+		public virtual bool renderer_connect (Cogl.Renderer renderer) throws GLib.Error;
+		[NoWrapper]
+		public virtual uint64 renderer_get_implicit_drm_modifier (Cogl.Renderer renderer);
+		[NoWrapper]
+		public virtual bool renderer_is_dma_buf_supported (Cogl.Renderer renderer);
+		[NoWrapper]
+		public virtual void update_sync (Cogl.Context ctx);
+		[NoAccessorMethod]
+		public string name { owned get; construct; }
+	}
+	[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_winsys_egl_get_type ()")]
+	public abstract class WinsysEGL : Cogl.Winsys {
+		[CCode (has_construct_function = false)]
+		protected WinsysEGL ();
+		[NoWrapper]
+		public virtual void cleanup_context (Cogl.Display display);
+		[NoWrapper]
+		public virtual bool context_created (Cogl.Display display) throws GLib.Error;
+	}
+#else
 	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
 	[Compact]
 	public class TimestampQuery {
 	}
+#endif
 	[CCode (cheader_filename = "cogl/cogl.h", type_cname = "CoglScanoutBufferInterface", type_id = "cogl_scanout_buffer_get_type ()")]
 	public interface ScanoutBuffer : GLib.Object {
 		public abstract int get_height ();
@@ -881,6 +986,12 @@ public void* get_winsys ();
 		public void set_test_function (Cogl.DepthTestFunction function);
 		public void set_write_enabled (bool enable);
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
+	public struct DisplayEGL {
+		public void* platform;
+	}
+#endif
 #if !HAS_MUTTER47
 	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
 	public struct OnscreenDirtyInfo {
@@ -908,6 +1019,14 @@ public void* get_winsys ();
 		public float ty;
 		public Cogl.Color color;
 	}
+#endif
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
+	public struct RendererEGL {
+		public Cogl.EGLWinsysFeature private_features;
+		public void* platform;
+		public bool needs_config;
+	}
 #endif
 	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
 	public struct VertexP2 {
@@ -969,7 +1088,7 @@ public void* get_winsys ();
 		public float s;
 		public float t;
 	}
-#if !HAS_MUTTER47
+#if !HAS_MUTTER47 || HAS_MUTTER50
 	[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
 	public struct VertexP3T2C4 {
 		public float x;
@@ -1088,6 +1207,21 @@ public void* get_winsys ();
 		SINGLE_PLANE,
 		NOT_EXTERNAL_ONLY
 	}
+#endif
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_EGL_WINSYS_FEATURE_", has_type_id = false)]
+	[Flags]
+	public enum EGLWinsysFeature {
+		SWAP_REGION,
+		EGL_IMAGE_FROM_WAYLAND_BUFFER,
+		CREATE_CONTEXT,
+		BUFFER_AGE,
+		FENCE_SYNC,
+		SURFACELESS_CONTEXT,
+		CONTEXT_PRIORITY,
+		NO_CONFIG_CONTEXT,
+		NATIVE_FENCE_SYNC
+	}
 #endif
 	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_EGL_IMAGE_FLAG_", has_type_id = false)]
 	[Flags]
@@ -1113,19 +1247,60 @@ public void* get_winsys ();
 		OGL_FEATURE_ID_TEXTURE_HALF_FLOAT,
 		[CCode (cname = "COGL_FEATURE_ID_TEXTURE_NORM16")]
 		OGL_FEATURE_ID_TEXTURE_NORM16,
+#if !HAS_MUTTER50
 		[CCode (cname = "COGL_FEATURE_ID_BUFFER_AGE")]
 		OGL_FEATURE_ID_BUFFER_AGE,
+#endif
 		[CCode (cname = "COGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL")]
 		OGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL,
 		[CCode (cname = "COGL_FEATURE_ID_BLIT_FRAMEBUFFER")]
 		OGL_FEATURE_ID_BLIT_FRAMEBUFFER,
-#if HAS_MUTTER47
+#if HAS_MUTTER47 && !HAS_MUTTER50
 		[CCode (cname = "COGL_FEATURE_ID_SYNC_FD")]
 		OGL_FEATURE_ID_SYNC_FD,
+#endif
+#if HAS_MUTTER50
+		[CCode (cname = "COGL_FEATURE_ID_TEXTURE_2D_FROM_EGL_IMAGE")]
+		OGL_FEATURE_ID_TEXTURE_2D_FROM_EGL_IMAGE,
+		[CCode (cname = "COGL_FEATURE_ID_MESA_PACK_INVERT")]
+		OGL_FEATURE_ID_MESA_PACK_INVERT,
+		[CCode (cname = "COGL_FEATURE_ID_PBOS")]
+		OGL_FEATURE_ID_PBOS,
+		[CCode (cname = "COGL_FEATURE_ID_EXT_PACKED_DEPTH_STENCIL")]
+		OGL_FEATURE_ID_EXT_PACKED_DEPTH_STENCIL,
+		[CCode (cname = "COGL_FEATURE_ID_OES_PACKED_DEPTH_STENCIL")]
+		OGL_FEATURE_ID_OES_PACKED_DEPTH_STENCIL,
+		[CCode (cname = "COGL_FEATURE_ID_TEXTURE_FORMAT_BGRA8888")]
+		OGL_FEATURE_ID_TEXTURE_FORMAT_BGRA8888,
+		[CCode (cname = "COGL_FEATURE_ID_TEXTURE_FORMAT_SIZED_RGBA")]
+		OGL_FEATURE_ID_TEXTURE_FORMAT_SIZED_RGBA,
+		[CCode (cname = "COGL_FEATURE_ID_UNPACK_SUBIMAGE")]
+		OGL_FEATURE_ID_UNPACK_SUBIMAGE,
+		[CCode (cname = "COGL_FEATURE_ID_SAMPLER_OBJECTS")]
+		OGL_FEATURE_ID_SAMPLER_OBJECTS,
+		[CCode (cname = "COGL_FEATURE_ID_READ_PIXELS_ANY_STRIDE")]
+		OGL_FEATURE_ID_READ_PIXELS_ANY_STRIDE,
+		[CCode (cname = "COGL_FEATURE_ID_FORMAT_CONVERSION")]
+		OGL_FEATURE_ID_FORMAT_CONVERSION,
+		[CCode (cname = "COGL_FEATURE_ID_QUERY_FRAMEBUFFER_BITS")]
+		OGL_FEATURE_ID_QUERY_FRAMEBUFFER_BITS,
+		[CCode (cname = "COGL_FEATURE_ID_ALPHA_TEXTURES")]
+		OGL_FEATURE_ID_ALPHA_TEXTURES,
+		[CCode (cname = "COGL_FEATURE_ID_TEXTURE_SWIZZLE")]
+		OGL_FEATURE_ID_TEXTURE_SWIZZLE,
+		[CCode (cname = "COGL_FEATURE_ID_TEXTURE_MAX_LEVEL")]
+		OGL_FEATURE_ID_TEXTURE_MAX_LEVEL,
+		[CCode (cname = "COGL_FEATURE_ID_TEXTURE_LOD_BIAS")]
+		OGL_FEATURE_ID_TEXTURE_LOD_BIAS,
+		[CCode (cname = "COGL_FEATURE_ID_OES_EGL_SYNC")]
+		OGL_FEATURE_ID_OES_EGL_SYNC,
+		[CCode (cname = "COGL_FEATURE_ID_QUIRK_GENERATE_MIPMAP_NEEDS_FLUSH")]
+		OGL_FEATURE_ID_QUIRK_GENERATE_MIPMAP_NEEDS_FLUSH,
 #endif
 		[CCode (cname = "COGL_FEATURE_ID_TIMESTAMP_QUERY")]
 		OGL_FEATURE_ID_TIMESTAMP_QUERY
 	}
+#if !HAS_MUTTER50
 #if HAS_MUTTER48
 	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_FILTER_", type_id = "cogl_filter_return_get_type ()")]
 #else
@@ -1135,6 +1310,7 @@ public void* get_winsys ();
 		CONTINUE,
 		REMOVE
 	}
+#endif
 	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_FRAME_EVENT_", has_type_id = false)]
 	public enum FrameEvent {
 		SYNC,
@@ -1245,6 +1421,9 @@ public void* get_winsys ();
 		RGBA_FP_32323232_PRE,
 		R_16,
 		RG_1616,
+#if HAS_MUTTER50
+		RGBX_16161616,
+#endif
 		RGBA_16161616,
 		RGBA_16161616_PRE,
 		DEPTH_16,
@@ -1354,23 +1533,37 @@ public void* get_winsys ();
 		CLOCKWISE,
 		COUNTER_CLOCKWISE
 	}
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_ERROR_", has_type_id = false)]
+	public enum WinsysError {
+		INIT,
+		CREATE_CONTEXT,
+		CREATE_ONSCREEN,
+		MAKE_CURRENT
+	}
+#endif
 #if HAS_MUTTER48
 	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_FEATURE_", type_id = "cogl_winsys_feature_get_type ()")]
 #else
 	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_FEATURE_", has_type_id = false)]
 #endif
 	public enum WinsysFeature {
+#if !HAS_MUTTER50
 		VBLANK_COUNTER,
 		VBLANK_WAIT,
 		TEXTURE_FROM_PIXMAP,
 		SWAP_BUFFERS_EVENT,
+#endif
 		SWAP_REGION,
+#if !HAS_MUTTER50
 		SWAP_REGION_THROTTLE,
 		SWAP_REGION_SYNCHRONIZED,
+#endif
 		BUFFER_AGE,
 		SYNC_AND_COMPLETE_EVENT,
 		N_FEATURES
 	}
+#if !HAS_MUTTER50
 	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_ID_", has_type_id = false)]
 	public enum WinsysID {
 		ANY,
@@ -1379,6 +1572,7 @@ public void* get_winsys ();
 		EGL_XLIB,
 		CUSTOM
 	}
+#endif
 #if !HAS_MUTTER47
 	[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_BITMAP_ERROR_", has_type_id = false)]
 	public errordomain BitmapError {
@@ -1471,12 +1665,23 @@ public void* get_winsys ();
 #if HAS_MUTTER48
 	[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 3.9)]
 	public delegate void TextureForeachCallback (Cogl.Texture sub_texture, float sub_texture_coords, float meta_coords);
+#endif
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h", cname = "COGL_MAX_EGL_CONFIG_ATTRIBS")]
+	public const int MAX_EGL_CONFIG_ATTRIBS;
 #endif
 	[CCode (cheader_filename = "cogl/cogl.h", cname = "COGL_TEXTURE_MAX_WASTE")]
 	public const int TEXTURE_MAX_WASTE;
 #if !HAS_MUTTER47
 	[CCode (cheader_filename = "cogl/cogl.h")]
 	public static bool clutter_winsys_has_feature (Cogl.WinsysFeature feature);
+#endif
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h")]
+	public static bool can_blit_between_formats (Cogl.PixelFormat src_format, Cogl.PixelFormat dst_format);
+	[CCode (cheader_filename = "cogl/cogl.h")]
+	[Version (replacement = "Color.from_string")]
+	public static bool color_from_string (out Cogl.Color color, string str);
 #endif
 	[CCode (cheader_filename = "cogl/cogl.h")]
 	[Version (replacement = "Color.init_from_hsl")]
@@ -1504,8 +1709,10 @@ public void* get_winsys ();
 #else
 	public static void graphene_matrix_project_point (Graphene.Matrix matrix, ref float x, ref float y, ref float z, ref float w);
 #endif
+#if !HAS_MUTTER50
 	[CCode (cheader_filename = "cogl/cogl.h")]
 	public static void graphene_matrix_project_points (Graphene.Matrix matrix, int n_components, size_t stride_in, void* points_in, size_t stride_out, void* points_out, int n_points);
+#endif
 	[CCode (cheader_filename = "cogl/cogl.h")]
 	public static void graphene_matrix_transform_points (Graphene.Matrix matrix, int n_components, size_t stride_in, void* points_in, size_t stride_out, void* points_out, int n_points);
 	[CCode (cheader_filename = "cogl/cogl.h")]
@@ -1522,6 +1729,14 @@ public void* get_winsys ();
 	public static void poll_renderer_dispatch (Cogl.Renderer renderer, Cogl.PollFD poll_fds, int n_poll_fds);
 	[CCode (cheader_filename = "cogl/cogl.h")]
 	public static int poll_renderer_get_info (Cogl.Renderer renderer, Cogl.PollFD poll_fds, int n_poll_fds, int64 timeout);
+#endif
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "cogl/cogl.h")]
+	[Version (replacement = "RendererError.quark")]
+	public static uint32 renderer_error_quark ();
+	[CCode (cheader_filename = "cogl/cogl.h")]
+	[Version (replacement = "ScanoutError.quark")]
+	public static GLib.Quark scanout_error_quark ();
 #endif
 	[CCode (cheader_filename = "cogl/cogl.h")]
 	public static void set_tracing_disabled_on_thread (void* data);
diff --git a/vapi/mutter-cogl-18.deps b/vapi/mutter-cogl-18.deps
new file mode 100644
index 00000000..8f69f28a
--- /dev/null
+++ b/vapi/mutter-cogl-18.deps
@@ -0,0 +1,5 @@
+pango
+glib-2.0
+gio-2.0
+mutter-mtk-18
+x11
diff --git a/vapi/mutter-cogl-18.vapi b/vapi/mutter-cogl-18.vapi
new file mode 120000
index 00000000..dca44a1c
--- /dev/null
+++ b/vapi/mutter-cogl-18.vapi
@@ -0,0 +1 @@
+mutter-cogl-17.vapi
\ No newline at end of file
diff --git a/vapi/mutter-mtk-13.vapi b/vapi/mutter-mtk-13.vapi
index c588368b..1f1981ac 100644
--- a/vapi/mutter-mtk-13.vapi
+++ b/vapi/mutter-mtk-13.vapi
@@ -27,6 +27,9 @@ namespace Mtk {
 		public static Mtk.Region create_rectangle (Mtk.Rectangle rect);
 		public static Mtk.Region create_rectangles (Mtk.Rectangle rects, int n_rects);
 		public Mtk.Region crop_and_scale (Graphene.Rect src_rect, int dst_width, int dst_height);
+#if HAS_MUTTER50
+		public Mtk.Region downscale (int scale);
+#endif
 		public bool equal (Mtk.Region other);
 #if HAS_MUTTER48
 		public void get_box (int nth, int x1, int y1, int x2, int y2);
@@ -170,7 +173,15 @@ namespace Mtk {
 #endif
 #if HAS_MUTTER49
 	[CCode (cheader_filename = "mtk/mtk.h")]
+#if HAS_MUTTER50
+	public static int64 extrapolate_next_interval_boundary (int64 boundary_us, int64 base_us, int64 interval_us);
+#else
 	public static int64 extrapolate_next_interval_boundary (int64 base_us, int64 interval_us);
+#endif
+#endif
+#if HAS_MUTTER50
+	[CCode (cheader_filename = "mtk/mtk.h")]
+	public static int64 find_nearest_interval_boundary (int64 boundary_us, int64 base_us, int64 interval_us);
 #endif
 	[CCode (cheader_filename = "mtk/mtk.h")]
 	[Version (replacement = "Rectangle.from_graphene_rect")]
diff --git a/vapi/mutter-mtk-18.vapi b/vapi/mutter-mtk-18.vapi
new file mode 120000
index 00000000..efd075ab
--- /dev/null
+++ b/vapi/mutter-mtk-18.vapi
@@ -0,0 +1 @@
+mutter-mtk-17.vapi
\ No newline at end of file
diff --git a/wingpanel-interface/meson.build b/wingpanel-interface/meson.build
index 24a49c48..fcda54d6 100644
--- a/wingpanel-interface/meson.build
+++ b/wingpanel-interface/meson.build
@@ -60,6 +60,17 @@ if mutter49_dep.found()
 	vala_flags = ['--define', 'HAS_MUTTER46', '--define', 'HAS_MUTTER47', '--define', 'HAS_MUTTER48', '--define', 'HAS_MUTTER49']
 endif
 
+mutter50_dep = dependency('libmutter-18', version: ['>= 50', '< 51'], required: false)
+if mutter50_dep.found()
+	libmutter_dep = dependency('libmutter-18', version: '>= 50')
+	mutter_dep = [
+		libmutter_dep,
+		dependency('mutter-mtk-18'), dependency('mutter-cogl-18'),
+		dependency('mutter-clutter-18')
+	]
+	vala_flags = ['--define', 'HAS_MUTTER46', '--define', 'HAS_MUTTER47', '--define', 'HAS_MUTTER48', '--define', 'HAS_MUTTER49', '--define', 'HAS_MUTTER50']
+endif
+
 if mutter_dep.length() == 0
 	error ('No supported mutter library found!')
 endif
