Last active
May 8, 2019 21:48
-
-
Save Tireg/dcb264f755d4e83de53f44a4032a9598 to your computer and use it in GitHub Desktop.
Fix Pantheon-Greeter building with mutter 3.30 (See https://github.com/elementary/gala/issues/303 for instructions)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/compositor/DBusAccelerator.vala b/compositor/DBusAccelerator.vala | |
index c799870..be31a59 100644 | |
--- a/compositor/DBusAccelerator.vala | |
+++ b/compositor/DBusAccelerator.vala | |
@@ -74,7 +74,7 @@ namespace GreeterCompositor { | |
wm = _wm; | |
grabbed_accelerators = new GLib.List<GrabbedAccelerator> (); | |
- wm.get_screen ().get_display ().accelerator_activated.connect (on_accelerator_activated); | |
+ wm.get_display ().accelerator_activated.connect (on_accelerator_activated); | |
} | |
private void on_accelerator_activated (uint action, uint device_id, uint timestamp) { | |
@@ -100,7 +100,7 @@ namespace GreeterCompositor { | |
} | |
} | |
- uint action = wm.get_screen ().get_display ().grab_accelerator (accelerator.name); | |
+ uint action = wm.get_display ().grab_accelerator (accelerator.name); | |
if (action > 0) { | |
var accel = new GrabbedAccelerator (); | |
accel.action = action; | |
@@ -124,7 +124,7 @@ namespace GreeterCompositor { | |
public bool ungrab_accelerator (uint action) throws GLib.Error { | |
foreach (unowned GrabbedAccelerator accel in grabbed_accelerators) { | |
if (accel.action == action) { | |
- bool ret = wm.get_screen ().get_display ().ungrab_accelerator (action); | |
+ bool ret = wm.get_display ().ungrab_accelerator (action); | |
grabbed_accelerators.remove (accel); | |
return ret; | |
} | |
diff --git a/compositor/SystemBackground.vala b/compositor/SystemBackground.vala | |
index 2d2a474..353bec1 100644 | |
--- a/compositor/SystemBackground.vala | |
+++ b/compositor/SystemBackground.vala | |
@@ -21,24 +21,24 @@ | |
public class Greeter.SystemBackground : Meta.BackgroundActor { | |
const Clutter.Color DEFAULT_BACKGROUND_COLOR = { 0x2e, 0x34, 0x36, 0xff }; | |
- | |
+ | |
static Meta.Background? system_background = null; | |
public signal void loaded (); | |
- public SystemBackground (Meta.Screen screen) { | |
- Object (meta_screen: screen, monitor: 0); | |
+ public SystemBackground (Meta.Display display) { | |
+ Object (meta_display: display, monitor: 0); | |
} | |
construct { | |
if (system_background == null) { | |
- system_background = new Meta.Background (meta_screen); | |
+ system_background = new Meta.Background (meta_display); | |
} | |
background = system_background; | |
} | |
- public void refresh () { | |
+ public void refresh () { | |
if (system_background != null) { | |
this.set_wallpaper (); | |
} | |
diff --git a/compositor/Utils.vala b/compositor/Utils.vala | |
index 4774310..2935c32 100644 | |
--- a/compositor/Utils.vala | |
+++ b/compositor/Utils.vala | |
@@ -89,8 +89,7 @@ namespace GreeterCompositor | |
*/ | |
public static Meta.Window get_next_window (Meta.Workspace workspace, bool backward = false) | |
{ | |
- var screen = workspace.get_screen (); | |
- var display = screen.get_display (); | |
+ var display = workspace.get_display (); | |
var window = display.get_tab_next (Meta.TabList.NORMAL, | |
workspace, null, backward); | |
@@ -166,16 +165,16 @@ namespace GreeterCompositor | |
/** | |
* Ring the system bell, will most likely emit a <beep> error sound or, if the | |
- * audible bell is disabled, flash the screen | |
+ * audible bell is disabled, flash the display | |
* | |
- * @param screen The screen to flash, if necessary | |
+ * @param display The display to flash, if necessary | |
*/ | |
- public static void bell (Meta.Screen screen) | |
+ public static void bell (Meta.Display display) | |
{ | |
if (Meta.Prefs.bell_is_audible ()) | |
Gdk.beep (); | |
else | |
- screen.get_display ().get_compositor ().flash_screen (screen); | |
+ display.get_compositor ().flash_display (display); | |
} | |
} | |
} | |
diff --git a/compositor/WindowManager.vala b/compositor/WindowManager.vala | |
index 092aebf..d4c8478 100644 | |
--- a/compositor/WindowManager.vala | |
+++ b/compositor/WindowManager.vala | |
@@ -83,25 +83,25 @@ namespace GreeterCompositor { | |
Util.later_add (LaterType.BEFORE_REDRAW, show_stage); | |
#if HAS_MUTTER322 | |
- get_screen ().get_display ().gl_video_memory_purged.connect (refresh_background); | |
+ get_display ().gl_video_memory_purged.connect (refresh_background); | |
#endif | |
} | |
void refresh_background () { | |
- var screen = get_screen (); | |
- var system_background = new Greeter.SystemBackground (screen); | |
+ var display = get_display (); | |
+ var system_background = new Greeter.SystemBackground (display); | |
system_background.refresh (); | |
} | |
bool show_stage () { | |
- var screen = get_screen (); | |
+ var display = get_display (); | |
MediaFeedback.init (); | |
DBus.init (this); | |
DBusAccelerator.init (this); | |
- stage = Compositor.get_stage_for_screen (screen) as Clutter.Stage; | |
+ stage = Compositor.get_stage_for_display (display) as Clutter.Stage; | |
- var system_background = new Greeter.SystemBackground (screen); | |
+ var system_background = new Greeter.SystemBackground (display); | |
system_background.add_constraint (new Clutter.BindConstraint (stage, Clutter.BindCoordinate.ALL, 0)); | |
system_background.set_wallpaper (); | |
stage.insert_child_below (system_background, null); | |
@@ -110,11 +110,11 @@ namespace GreeterCompositor { | |
ui_group.reactive = true; | |
stage.add_child (ui_group); | |
- window_group = Compositor.get_window_group_for_screen (screen); | |
+ window_group = Compositor.get_window_group_for_display (display); | |
stage.remove_child (window_group); | |
ui_group.add_child (window_group); | |
- top_window_group = Compositor.get_top_window_group_for_screen (screen); | |
+ top_window_group = Compositor.get_top_window_group_for_display (display); | |
stage.remove_child (top_window_group); | |
ui_group.add_child (top_window_group); | |
@@ -156,7 +156,7 @@ namespace GreeterCompositor { | |
public uint32[] get_all_xids () { | |
var list = new Gee.ArrayList<uint32> (); | |
- foreach (var workspace in get_screen ().get_workspaces ()) { | |
+ foreach (var workspace in get_display().get_workspace_manager ().get_workspaces ()) { | |
foreach (var window in workspace.list_windows ()) | |
list.add ((uint32)window.get_xwindow ()); | |
} | |
@@ -171,15 +171,14 @@ namespace GreeterCompositor { | |
if (window == null) | |
return; | |
- var screen = get_screen (); | |
- var display = screen.get_display (); | |
+ var display = get_display (); | |
- var active = screen.get_active_workspace (); | |
+ var active = display.get_workspace_manager ().get_active_workspace (); | |
var next = active.get_neighbor (direction); | |
//dont allow empty workspaces to be created by moving, if we have dynamic workspaces | |
- if (Prefs.get_dynamic_workspaces () && Utils.get_n_windows (active) == 1 && next.index () == screen.n_workspaces - 1) { | |
- Utils.bell (screen); | |
+ if (Prefs.get_dynamic_workspaces () && Utils.get_n_windows (active) == 1 && next.index () == display.get_workspace_manager ().n_workspaces - 1) { | |
+ Utils.bell (display); | |
return; | |
} | |
@@ -214,8 +213,8 @@ namespace GreeterCompositor { | |
if (!Prefs.get_dynamic_workspaces ()) | |
return; | |
- unowned Meta.Screen screen = get_screen (); | |
- var time = screen.get_display ().get_current_time (); | |
+ unowned Meta.Display display = get_display (); | |
+ var time = display.get_current_time (); | |
unowned Meta.Workspace win_ws = window.get_workspace (); | |
if (which_change == Meta.SizeChange.FULLSCREEN) { | |
@@ -227,7 +226,7 @@ namespace GreeterCompositor { | |
var new_ws_index = old_ws_index + 1; | |
//InternalUtils.insert_workspace_with_window (new_ws_index, window); | |
- var new_ws_obj = screen.get_workspace_by_index (new_ws_index); | |
+ var new_ws_obj = display.get_workspace_manager ().get_workspace_by_index (new_ws_index); | |
window.change_workspace (new_ws_obj); | |
new_ws_obj.activate_with_focus (window, time); | |
@@ -236,8 +235,8 @@ namespace GreeterCompositor { | |
var old_ws_index = ws_assoc.get (window); | |
var new_ws_index = win_ws.index (); | |
- if (new_ws_index != old_ws_index && old_ws_index < screen.get_n_workspaces ()) { | |
- var old_ws_obj = screen.get_workspace_by_index (old_ws_index); | |
+ if (new_ws_index != old_ws_index && old_ws_index < display.get_workspace_manager ().get_n_workspaces ()) { | |
+ var old_ws_obj = display.get_workspace_manager ().get_workspace_by_index (old_ws_index); | |
window.change_workspace (old_ws_obj); | |
old_ws_obj.activate_with_focus (window, time); | |
} | |
@@ -347,8 +346,8 @@ namespace GreeterCompositor { | |
if (windows == null || parents == null) | |
return; | |
- var screen = get_screen (); | |
- var active_workspace = screen.get_active_workspace (); | |
+ var display = get_display (); | |
+ var active_workspace = display.get_workspace_manager ().get_active_workspace (); | |
for (var i = 0; i < windows.length (); i++) { | |
var actor = windows.nth_data (i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/compositor/meson.build b/compositor/meson.build | |
index 7466e2a..36cabc4 100644 | |
--- a/compositor/meson.build | |
+++ b/compositor/meson.build | |
@@ -115,6 +115,26 @@ if mutter328_dep.found() | |
'-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'] | |
endif | |
+mutter330_dep = dependency('libmutter-3', version: ['>= 3.29.92', '< 3.31'], required: false) | |
+if mutter330_dep.found() | |
+ mutter_packages_command = [ | |
+ '--pkg', 'libmutter-3', | |
+ '--pkg', 'mutter-cogl-3', | |
+ '--pkg', 'mutter-cogl-pango-3', | |
+ '--pkg', 'mutter-cogl-path-3', | |
+ '--pkg', 'mutter-clutter-3' | |
+ ] | |
+ libmutter_dep = dependency('libmutter-3', version: '>= 3.29.92') | |
+ mutter_dep = [ | |
+ libmutter_dep, | |
+ dependency('mutter-cogl-3'), dependency('mutter-cogl-pango-3'), | |
+ dependency('mutter-cogl-path-3'), dependency('mutter-clutter-3') | |
+ ] | |
+ vala_flags += ['--define', 'HAS_MUTTER320', '--define', 'HAS_MUTTER322', '--define', 'HAS_MUTTER324', '--define', 'HAS_MUTTER326', '--define', 'HAS_MUTTER328', '--define', 'HAS_MUTTER330'] | |
+ compositor_c_args = ['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', | |
+ '-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'] | |
+endif | |
+ | |
if mutter_dep.length() == 0 | |
error ('No supported mutter library found!') | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment