Created
May 8, 2019 21:55
-
-
Save Tireg/f4c6e28258601dedb73aca517d322806 to your computer and use it in GitHub Desktop.
Fix Wingpanel 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/wingpanel-interface/BackgroundManager.vala b/wingpanel-interface/BackgroundManager.vala | |
index 2850cbf..65887b8 100644 | |
--- a/wingpanel-interface/BackgroundManager.vala | |
+++ b/wingpanel-interface/BackgroundManager.vala | |
@@ -60,7 +60,7 @@ public class WingpanelInterface.BackgroundManager : Object { | |
} | |
private void connect_signals () { | |
- Main.screen.workspace_switched.connect (() => { | |
+ Main.display.get_workspace_manager ().workspace_switched.connect (() => { | |
update_current_workspace (); | |
}); | |
@@ -81,7 +81,7 @@ public class WingpanelInterface.BackgroundManager : Object { | |
} | |
private void update_current_workspace () { | |
- var workspace = Main.screen.get_workspace_by_index (Main.screen.get_active_workspace_index ()); | |
+ var workspace = Main.display.get_workspace_manager ().get_workspace_by_index (Main.display.get_workspace_manager ().get_active_workspace_index ()); | |
if (workspace == null) { | |
warning ("Cannot get active workspace"); | |
diff --git a/wingpanel-interface/FocusManager.vala b/wingpanel-interface/FocusManager.vala | |
index 1b8e629..f86d3df 100644 | |
--- a/wingpanel-interface/FocusManager.vala | |
+++ b/wingpanel-interface/FocusManager.vala | |
@@ -24,7 +24,7 @@ public class WingpanelInterface.FocusManager : Object { | |
private Meta.Window? last_focused_window = null; | |
public FocusManager () { | |
- Main.screen.workspace_switched.connect (() => { | |
+ Main.display.get_workspace_manager ().workspace_switched.connect (() => { | |
update_current_workspace (); | |
}); | |
@@ -40,12 +40,12 @@ public class WingpanelInterface.FocusManager : Object { | |
} | |
} | |
- Main.screen.get_display ().window_created.connect (window_created); | |
+ Main.display.window_created.connect (window_created); | |
} | |
public void restore_focused_window () { | |
if (last_focused_window != null) { | |
- var display = Main.screen.get_display (); | |
+ var display = Main.display; | |
last_focused_window.focus (display.get_current_time ()); | |
} | |
@@ -55,7 +55,7 @@ public class WingpanelInterface.FocusManager : Object { | |
window.unmanaged.disconnect (window_unmanaged); | |
} | |
- Main.screen.get_display ().window_created.disconnect (window_created); | |
+ Main.display.window_created.disconnect (window_created); | |
} | |
void window_created (Meta.Window window) { | |
@@ -75,10 +75,10 @@ public class WingpanelInterface.FocusManager : Object { | |
} | |
public bool begin_grab_focused_window (int x, int y, int button, uint time, uint state) { | |
- var display = Main.screen.get_display (); | |
+ var display = Main.display; | |
var window = display.get_focus_window (); | |
if (window == null || !get_can_grab_window (window, x, y)) { | |
- unowned Meta.Workspace workspace = Main.screen.get_active_workspace (); | |
+ unowned Meta.Workspace workspace = Main.display.get_workspace_manager ().get_active_workspace (); | |
List<unowned Meta.Window>? windows = workspace.list_windows (); | |
if (windows == null) { | |
return false; | |
@@ -99,7 +99,7 @@ public class WingpanelInterface.FocusManager : Object { | |
} | |
if (window != null) { | |
- display.begin_grab_op (Main.screen, window, Meta.GrabOp.MOVING, false, true, button, state, time, x, y); | |
+ display.begin_grab_op (window, Meta.GrabOp.MOVING, false, true, button, state, time, x, y); | |
return true; | |
} | |
@@ -112,7 +112,7 @@ public class WingpanelInterface.FocusManager : Object { | |
} | |
private void update_current_workspace () { | |
- var workspace = Main.screen.get_workspace_by_index (Main.screen.get_active_workspace_index ()); | |
+ var workspace = Main.display.get_workspace_manager ().get_workspace_by_index (Main.display.get_workspace_manager ().get_active_workspace_index ()); | |
if (workspace == null) { | |
warning ("Cannot get active workspace"); | |
diff --git a/wingpanel-interface/Main.vala b/wingpanel-interface/Main.vala | |
index c9bf19e..2855ab7 100644 | |
--- a/wingpanel-interface/Main.vala | |
+++ b/wingpanel-interface/Main.vala | |
@@ -27,7 +27,7 @@ public class WingpanelInterface.Main : Gala.Plugin { | |
private const string DBUS_PATH = "/org/pantheon/gala/WingpanelInterface"; | |
public static Gala.WindowManager wm; | |
- public static Meta.Screen screen; | |
+ public static Meta.Display display; | |
private DBusConnection? dbus_connection = null; | |
@@ -37,7 +37,7 @@ public class WingpanelInterface.Main : Gala.Plugin { | |
} | |
wm = _wm; | |
- screen = wm.get_screen (); | |
+ display = wm.get_display (); | |
Bus.own_name (BusType.SESSION, | |
DBUS_NAME, |
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/wingpanel-interface/meson.build b/wingpanel-interface/meson.build | |
index 506dc8a..f19f373 100644 | |
--- a/wingpanel-interface/meson.build | |
+++ b/wingpanel-interface/meson.build | |
@@ -65,12 +65,12 @@ if mutter328_dep.found() | |
'-DCOGL_ENABLE_EXPERIMENTAL_API', '-DCOGL_ENABLE_EXPERIMENTAL_2_0_API'] | |
endif | |
-mutter330_dep = dependency('libmutter-2', version: ['>= 3.29.2', '< 3.31'], required: false) | |
+mutter330_dep = dependency('libmutter-3', version: ['>= 3.29.2', '< 3.31'], required: false) | |
if mutter330_dep.found() | |
- libmutter_dep = dependency('libmutter-2', version: '>= 3.29.2') | |
+ libmutter_dep = dependency('libmutter-3', version: '>= 3.29.2') | |
mutter_dep = [ | |
- dependency('mutter-cogl-2'), dependency('mutter-cogl-pango-2'), | |
- dependency('mutter-cogl-path-2'), dependency('mutter-clutter-2') | |
+ 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'] | |
c_flags = ['-DCLUTTER_ENABLE_COMPOSITOR_API', '-DCLUTTER_ENABLE_EXPERIMENTAL_API', |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment