Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions lib/CloseButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ public class Gala.CloseButton : Clutter.Actor {
pixbuf_actor.background_color = { 255, 0, 0, 255 };
}

#if HAS_MUTTER45
public override bool button_press_event (Clutter.Event e) {
#else
public override bool button_press_event (Clutter.ButtonEvent e) {
#endif
var estimated_duration = (uint) (ANIMATION_DURATION * (scale_x - 0.8) / 0.2);

pixbuf_actor.save_easing_state ();
Expand All @@ -97,11 +93,7 @@ public class Gala.CloseButton : Clutter.Actor {
return Clutter.EVENT_STOP;
}

#if HAS_MUTTER45
public override bool button_release_event (Clutter.Event e) {
#else
public override bool button_release_event (Clutter.ButtonEvent e) {
#endif
reset_scale ();

if (is_pressed) {
Expand All @@ -112,11 +104,7 @@ public class Gala.CloseButton : Clutter.Actor {
return Clutter.EVENT_STOP;
}

#if HAS_MUTTER45
public override bool leave_event (Clutter.Event event) {
#else
public override bool leave_event (Clutter.CrossingEvent event) {
#endif
reset_scale ();
is_pressed = false;

Expand Down
18 changes: 0 additions & 18 deletions lib/Plugin.vala
Original file line number Diff line number Diff line change
Expand Up @@ -84,34 +84,20 @@ namespace Gala {
* It is calculated by the system whenever update_region is called.
* You can influce it with the custom_region and the track_actor function.
*/
#if HAS_MUTTER45
private Mtk.Rectangle[] region;
public unowned Mtk.Rectangle[] get_region () {
#else
private Meta.Rectangle[] region;
public unowned Meta.Rectangle[] get_region () {
#endif
return region;
}
/**
* This list will be merged with the region property. See region for
* more details. Changing this property will cause update_region to be
* called. Default to null.
*/
#if HAS_MUTTER45
private Mtk.Rectangle[]? _custom_region = null;
protected unowned Mtk.Rectangle[]? get_custom_region () {
#else
private Meta.Rectangle[]? _custom_region = null;
protected unowned Meta.Rectangle[]? get_custom_region () {
#endif
return _custom_region;
}
#if HAS_MUTTER45
protected void set_custom_region (Mtk.Rectangle[]? custom_region) {
#else
protected void set_custom_region (Meta.Rectangle[]? custom_region) {
#endif
_custom_region = custom_region;
update_region ();
}
Expand Down Expand Up @@ -189,11 +175,7 @@ namespace Gala {
var has_custom = custom_region != null;
var len = tracked_actors.length () + (has_custom ? custom_region.length : 0);

#if HAS_MUTTER45
var regions = new Mtk.Rectangle[len];
#else
var regions = new Meta.Rectangle[len];
#endif
var i = 0;

if (has_custom) {
Expand Down
8 changes: 0 additions & 8 deletions lib/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,7 @@ namespace Gala {
*/
public static Clutter.Actor? get_window_actor_snapshot (
Meta.WindowActor actor,
#if HAS_MUTTER45
Mtk.Rectangle inner_rect
#else
Meta.Rectangle inner_rect
#endif
) {
Clutter.Content content;

Expand Down Expand Up @@ -344,11 +340,7 @@ namespace Gala {
*/
[Version (deprecated = true, deprecated_since = "7.0.3", replacement = "Meta.Display.get_monitor_scale")]
public static int get_ui_scaling_factor () {
#if HAS_MUTTER44
return 1;
#else
return Meta.Backend.get_backend ().get_settings ().get_ui_scaling_factor ();
#endif
}

/**
Expand Down
33 changes: 0 additions & 33 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -103,39 +103,6 @@ libmutter_dep = []

vala_flags = []

mutter42_dep = dependency('libmutter-10', version: ['>= 42', '< 43'], required: false)
if mutter42_dep.found()
libmutter_dep = dependency('libmutter-10', version: '>= 42')
mutter_dep = [
libmutter_dep,
dependency('mutter-cogl-10'), dependency('mutter-cogl-pango-10'),
dependency('mutter-clutter-10')
]
vala_flags = []
endif

mutter43_dep = dependency('libmutter-11', version: ['>= 43', '< 44'], required: false)
if mutter43_dep.found()
libmutter_dep = dependency('libmutter-11', version: '>= 43')
mutter_dep = [
libmutter_dep,
dependency('mutter-cogl-11'), dependency('mutter-cogl-pango-11'),
dependency('mutter-clutter-11')
]
vala_flags = ['--define', 'HAS_MUTTER43']
endif

mutter44_dep = dependency('libmutter-12', version: ['>= 44', '< 45'], required: false)
if mutter44_dep.found()
libmutter_dep = dependency('libmutter-12', version: '>= 44')
mutter_dep = [
libmutter_dep,
dependency('mutter-cogl-12'), dependency('mutter-cogl-pango-12'),
dependency('mutter-clutter-12')
]
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44']
endif

mutter45_dep = dependency('libmutter-13', version: ['>= 45', '< 46'], required: false)
if mutter45_dep.found()
libmutter_dep = dependency('libmutter-13', version: '>= 45')
Expand Down
4 changes: 0 additions & 4 deletions plugins/pip/Main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ public class Gala.Plugins.PIP.Plugin : Gala.Plugin {
private Gala.WindowManager? wm = null;
private SelectionArea? selection_area;

#if HAS_MUTTER45
private static inline bool meta_rectangle_contains (Mtk.Rectangle rect, int x, int y) {
#else
private static inline bool meta_rectangle_contains (Meta.Rectangle rect, int x, int y) {
#endif
return x >= rect.x && x < rect.x + rect.width
&& y >= rect.y && y < rect.y + rect.height;
}
Expand Down
12 changes: 0 additions & 12 deletions plugins/pip/PopupWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
}
}

#if HAS_MUTTER45
public override bool enter_event (Clutter.Event event) {
#else
public override bool enter_event (Clutter.CrossingEvent event) {
#endif
var duration = Utils.get_animation_duration (300);

close_button.save_easing_state ();
Expand All @@ -182,11 +178,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
return Clutter.EVENT_PROPAGATE;
}

#if HAS_MUTTER45
public override bool leave_event (Clutter.Event event) {
#else
public override bool leave_event (Clutter.CrossingEvent event) {
#endif
var duration = Utils.get_animation_duration (300);

close_button.save_easing_state ();
Expand Down Expand Up @@ -220,11 +212,7 @@ public class Gala.Plugins.PIP.PopupWindow : Clutter.Actor {
display.set_cursor (Meta.Cursor.DEFAULT);
}

#if HAS_MUTTER45
private bool on_resize_button_press (Clutter.Event event) {
#else
private bool on_resize_button_press (Clutter.ButtonEvent event) {
#endif
if (resizing || event.get_button () != Clutter.Button.PRIMARY) {
return Clutter.EVENT_STOP;
}
Expand Down
16 changes: 0 additions & 16 deletions plugins/pip/SelectionArea.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
height = screen_height;
}

#if HAS_MUTTER45
public override bool key_press_event (Clutter.Event e) {
#else
public override bool key_press_event (Clutter.KeyEvent e) {
#endif
if (e.get_key_symbol () == Clutter.Key.Escape) {
close ();
closed ();
Expand All @@ -58,11 +54,7 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
return false;
}

#if HAS_MUTTER45
public override bool button_press_event (Clutter.Event e) {
#else
public override bool button_press_event (Clutter.ButtonEvent e) {
#endif
if (dragging || e.get_button () != Clutter.Button.PRIMARY) {
return true;
}
Expand All @@ -76,11 +68,7 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
return true;
}

#if HAS_MUTTER45
public override bool button_release_event (Clutter.Event e) {
#else
public override bool button_release_event (Clutter.ButtonEvent e) {
#endif
if (e.get_button () != Clutter.Button.PRIMARY) {
return true;
}
Expand Down Expand Up @@ -109,11 +97,7 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
return true;
}

#if HAS_MUTTER45
public override bool motion_event (Clutter.Event e) {
#else
public override bool motion_event (Clutter.MotionEvent e) {
#endif
if (!clicked) {
return true;
}
Expand Down
4 changes: 0 additions & 4 deletions plugins/template/Main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ namespace Gala.Plugins.Template {
wm.ui_group.add_child (red_box);
}

#if HAS_MUTTER45
private bool turn_green (Clutter.Event event) {
#else
private bool turn_green (Clutter.ButtonEvent event) {
#endif
red_box.background_color = { 0, 255, 0, 255 };
return true;
}
Expand Down
4 changes: 0 additions & 4 deletions src/Background/Animation.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ public class Gala.Animation : Object {
yield;
}

#if HAS_MUTTER45
public void update (Mtk.Rectangle monitor) {
#else
public void update (Meta.Rectangle monitor) {
#endif
string[] key_frame_files = {};

if (show == null) {
Expand Down
4 changes: 0 additions & 4 deletions src/DaemonManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ public class Gala.DaemonManager : GLib.Object {
private async void start_wayland () {
var subprocess_launcher = new GLib.SubprocessLauncher (NONE);
try {
#if HAS_MUTTER44
daemon_client = new Meta.WaylandClient (display.get_context (), subprocess_launcher);
#else
daemon_client = new Meta.WaylandClient (subprocess_launcher);
#endif
string[] args = {"gala-daemon"};
var subprocess = daemon_client.spawnv (display, args);

Expand Down
8 changes: 0 additions & 8 deletions src/Gestures/ScrollBackend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ public class Gala.ScrollBackend : Object, GestureBackend {
actor.notify["visible"].connect (() => ignoring = false);
}

#if HAS_MUTTER45
private bool on_scroll_event (Clutter.Event event) {
#else
private bool on_scroll_event (Clutter.ScrollEvent event) {
#endif
if (!can_handle_event (event)) {
return false;
}
Expand Down Expand Up @@ -111,11 +107,7 @@ public class Gala.ScrollBackend : Object, GestureBackend {
return true;
}

#if HAS_MUTTER45
private static bool can_handle_event (Clutter.Event event) {
#else
private static bool can_handle_event (Clutter.ScrollEvent event) {
#endif
return event.get_type () == Clutter.EventType.SCROLL
&& event.get_source_device ().get_device_type () == Clutter.InputDeviceType.TOUCHPAD_DEVICE
&& event.get_scroll_direction () == Clutter.ScrollDirection.SMOOTH;
Expand Down
4 changes: 0 additions & 4 deletions src/HotCorners/HotCorner.vala
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ public class Gala.HotCorner : Object {
}
}

#if HAS_MUTTER45
private static Mtk.Rectangle get_barrier_rect (float x, float y, float scale, string hot_corner_position, Clutter.Orientation orientation) {
#else
private static Meta.Rectangle get_barrier_rect (float x, float y, float scale, string hot_corner_position, Clutter.Orientation orientation) {
#endif
var barrier_size = InternalUtils.scale_to_int (BARRIER_SIZE, scale);

int x1 = (int) x;
Expand Down
30 changes: 0 additions & 30 deletions src/InternalUtils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,8 @@ namespace Gala {

case InputArea.NONE:
default:
#if !HAS_MUTTER44
unowned Meta.X11Display x11display = display.get_x11_display ();
x11display.clear_stage_input_region ();
return;
#else
rects = {};
break;
#endif
}

unowned Meta.X11Display x11display = display.get_x11_display ();
Expand Down Expand Up @@ -104,39 +98,23 @@ namespace Gala {
return k1 * k1 + k2 * k2;
}

#if HAS_MUTTER45
private static Mtk.Rectangle rect_adjusted (Mtk.Rectangle rect, int dx1, int dy1, int dx2, int dy2) {
#else
private static Meta.Rectangle rect_adjusted (Meta.Rectangle rect, int dx1, int dy1, int dx2, int dy2) {
#endif
return {rect.x + dx1, rect.y + dy1, rect.width + (-dx1 + dx2), rect.height + (-dy1 + dy2)};
}

#if HAS_MUTTER45
private static Gdk.Point rect_center (Mtk.Rectangle rect) {
#else
private static Gdk.Point rect_center (Meta.Rectangle rect) {
#endif
return {rect.x + rect.width / 2, rect.y + rect.height / 2};
}

public struct TilableWindow {
#if HAS_MUTTER45
Mtk.Rectangle rect;
#else
Meta.Rectangle rect;
#endif
unowned WindowClone id;
}

/**
* Careful: List<TilableWindow?> windows will be modified in place and shouldn't be used afterwards.
*/
#if HAS_MUTTER45
public static List<TilableWindow?> calculate_grid_placement (Mtk.Rectangle area, List<TilableWindow?> windows) {
#else
public static List<TilableWindow?> calculate_grid_placement (Meta.Rectangle area, List<TilableWindow?> windows) {
#endif
uint window_count = windows.length ();
int columns = (int)Math.ceil (Math.sqrt (window_count));
int rows = (int)Math.ceil (window_count / (double)columns);
Expand Down Expand Up @@ -215,11 +193,7 @@ namespace Gala {
var rect = window.rect;

// Work out where the slot is
#if HAS_MUTTER45
Mtk.Rectangle target = {
#else
Meta.Rectangle target = {
#endif
area.x + (slot % columns) * slot_width,
area.y + (slot / columns) * slot_height,
slot_width,
Expand Down Expand Up @@ -308,11 +282,7 @@ namespace Gala {
/**
* Returns the workspaces geometry following the only_on_primary settings.
*/
#if HAS_MUTTER45
public static Mtk.Rectangle get_workspaces_geometry (Meta.Display display) {
#else
public static Meta.Rectangle get_workspaces_geometry (Meta.Display display) {
#endif
if (Meta.Prefs.get_workspaces_only_on_primary ()) {
return display.get_monitor_geometry (display.get_primary_monitor ());
} else {
Expand Down
Loading