Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Mutter >=45 #773

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You'll need the following dependencies:
* libgtk-3-dev
* libhandy-1-dev >= 0.90.0
* liblightdm-gobject-1-dev
* libmutter-6-dev
* libmutter-13-dev
* libx11-dev
* meson
* valac
Expand Down
4 changes: 0 additions & 4 deletions compositor/Background/Animation.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ namespace GreeterCompositor {
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
19 changes: 0 additions & 19 deletions compositor/PantheonShell.vala
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,13 @@
*/

namespace GreeterCompositor {
#if !HAS_MUTTER45
[Compact]
public class FakeMetaWaylandCompositor : GLib.Object {
// It is the third field and Vala adds a FakeMetaWaylandCompositorPrivate *priv
public Wl.Display wayland_display;

[CCode (cname = "meta_context_get_wayland_compositor")]
public extern static unowned GreeterCompositor.FakeMetaWaylandCompositor from_context (Meta.Context context);
}
#endif
public static inline unowned Wl.Display? get_display_from_context (Meta.Context context) {
#if HAS_MUTTER45
unowned Meta.WaylandCompositor? compositor = context.get_wayland_compositor ();
if (compositor == null) {
return null;
}

return (Wl.Display) compositor.get_wayland_display ();
#else
unowned FakeMetaWaylandCompositor compositor = GreeterCompositor.FakeMetaWaylandCompositor.from_context (context);
if (compositor == null) {
return null;
}

return compositor.wayland_display;
#endif
}

private static Pantheon.Desktop.ShellInterface wayland_pantheon_shell_interface;
Expand Down
4 changes: 0 additions & 4 deletions compositor/ShellClients/ManagedClient.vala
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ public class GreeterCompositor.ManagedClient : Object {
private async void start_wayland () {
var subprocess_launcher = new GLib.SubprocessLauncher (STDERR_PIPE | STDOUT_PIPE);
try {
#if HAS_MUTTER44
wayland_client = new Meta.WaylandClient (display.get_context (), subprocess_launcher);
#else
wayland_client = new Meta.WaylandClient (subprocess_launcher);
#endif
subprocess = wayland_client.spawnv (display, args);

yield subprocess.wait_async ();
Expand Down
8 changes: 0 additions & 8 deletions compositor/ShellClients/PanelWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,13 @@ public class GreeterCompositor.PanelWindow : Object {
update_strut ();
}

#if HAS_MUTTER45
private void position_window_top (Mtk.Rectangle monitor_geom, Mtk.Rectangle window_rect) {
#else
private void position_window_top (Meta.Rectangle monitor_geom, Meta.Rectangle window_rect) {
#endif
var x = monitor_geom.x + (monitor_geom.width - window_rect.width) / 2;

move_window_idle (x, monitor_geom.y);
}

#if HAS_MUTTER45
private void position_window_bottom (Mtk.Rectangle monitor_geom, Mtk.Rectangle window_rect) {
#else
private void position_window_bottom (Meta.Rectangle monitor_geom, Meta.Rectangle window_rect) {
#endif
var x = monitor_geom.x + (monitor_geom.width - window_rect.width) / 2;
var y = monitor_geom.y + monitor_geom.height - window_rect.height;

Expand Down
16 changes: 0 additions & 16 deletions compositor/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,7 @@ namespace GreeterCompositor {
var subprocess_launcher = new GLib.SubprocessLauncher (GLib.SubprocessFlags.INHERIT_FDS);
try {
Meta.WaylandClient daemon_client;
#if HAS_MUTTER44
daemon_client = new Meta.WaylandClient (display.get_context (), subprocess_launcher);
#else
daemon_client = new Meta.WaylandClient (subprocess_launcher);
#endif
var subprocess = daemon_client.spawnv (display, command);

yield subprocess.wait_async ();
Expand Down Expand Up @@ -332,11 +328,7 @@ namespace GreeterCompositor {
}
}

#if HAS_MUTTER45
public override void show_window_menu_for_rect (Meta.Window window, Meta.WindowMenuType menu, Mtk.Rectangle rect) {
#else
public override void show_window_menu_for_rect (Meta.Window window, Meta.WindowMenuType menu, Meta.Rectangle rect) {
#endif
show_window_menu (window, menu, rect.x, rect.y);
}

Expand Down Expand Up @@ -388,11 +380,7 @@ namespace GreeterCompositor {
}
}

#if HAS_MUTTER45
public override void size_change (Meta.WindowActor actor, Meta.SizeChange which_change, Mtk.Rectangle old_frame_rect, Mtk.Rectangle old_buffer_rect) {
#else
public override void size_change (Meta.WindowActor actor, Meta.SizeChange which_change, Meta.Rectangle old_frame_rect, Meta.Rectangle old_buffer_rect) {
#endif
unowned Meta.Window window = actor.get_meta_window ();
if (window.get_tile_match () != null) {
size_change_completed (actor);
Expand Down Expand Up @@ -490,12 +478,8 @@ namespace GreeterCompositor {
}

public override void confirm_display_change () {
#if HAS_MUTTER44
unowned var monitor_manager = get_display ().get_context ().get_backend ().get_monitor_manager ();
var timeout = monitor_manager.get_display_configuration_timeout ();
#else
var timeout = Meta.MonitorManager.get_display_configuration_timeout ();
#endif
var summary = ngettext (
"Changes will automatically revert after %i second.",
"Changes will automatically revert after %i seconds.",
Expand Down
4 changes: 1 addition & 3 deletions compositor/WingpanelManager/FocusManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,8 @@ public class GreeterCompositor.FocusManager : GLib.Object {
#if HAS_MUTTER46
Graphene.Point pos_hint = {x, y};
window.begin_grab_op (Meta.GrabOp.MOVING, null, null, time, pos_hint);
#elif HAS_MUTTER44
window.begin_grab_op (Meta.GrabOp.MOVING, null, null, time);
#else
window.begin_grab_op (Meta.GrabOp.MOVING, true, time);
window.begin_grab_op (Meta.GrabOp.MOVING, null, null, time);
#endif
return true;
}
Expand Down
37 changes: 2 additions & 35 deletions compositor/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,6 @@ vala_flags = []
compositor_c_args =['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API',
'-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API']

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')
]
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 All @@ -54,7 +22,6 @@ if mutter45_dep.found()
dependency('mutter-mtk-13'), dependency('mutter-cogl-13'),
dependency('mutter-cogl-pango-13'), dependency('mutter-clutter-13')
]
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44', '--define', 'HAS_MUTTER45']
endif

mutter46_dep = dependency('libmutter-14', version: ['>= 46', '< 47'], required: false)
Expand All @@ -65,7 +32,7 @@ if mutter46_dep.found()
dependency('mutter-mtk-14'), dependency('mutter-cogl-14'),
dependency('mutter-cogl-pango-14'), dependency('mutter-clutter-14')
]
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44', '--define', 'HAS_MUTTER45', '--define', 'HAS_MUTTER46']
vala_flags = ['--define', 'HAS_MUTTER46']
endif

mutter47_dep = dependency('libmutter-15', version: ['>= 47', '< 48'], required: false)
Expand All @@ -76,7 +43,7 @@ if mutter47_dep.found()
dependency('mutter-mtk-15'), dependency('mutter-cogl-15'),
dependency('mutter-cogl-pango-15'), dependency('mutter-clutter-15')
]
vala_flags = ['--define', 'HAS_MUTTER43', '--define', 'HAS_MUTTER44', '--define', 'HAS_MUTTER45', '--define', 'HAS_MUTTER46', '--define', 'HAS_MUTTER47']
vala_flags = ['--define', 'HAS_MUTTER46', '--define', 'HAS_MUTTER47']
endif

if mutter_dep.length() == 0
Expand Down
53 changes: 0 additions & 53 deletions vapi/Clutter-10-custom.vala

This file was deleted.

Loading
Loading