Merge lp:~ricotz/gala/plank-0.11 into lp:gala

Proposed by Rico Tzschichholz
Status: Merged
Merged at revision: 486
Proposed branch: lp:~ricotz/gala/plank-0.11
Merge into: lp:gala
Diff against target: 183 lines (+63/-0)
5 files modified
configure.ac (+7/-0)
lib/Utils.vala (+12/-0)
src/DockThemeManager.vala (+19/-0)
src/Main.vala (+4/-0)
src/Widgets/WindowSwitcher.vala (+21/-0)
To merge this branch: bzr merge lp:~ricotz/gala/plank-0.11
Reviewer Review Type Date Requested Status
Gala developers Pending
Review via email: mp+276550@code.launchpad.net

Description of the change

This should be merged/pushed after plank 0.10.9 hit the daily PPA

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2015-09-23 14:52:12 +0000
+++ configure.ac 2015-11-03 15:28:06 +0000
@@ -181,6 +181,13 @@
181 MUTTER_API="3.18"181 MUTTER_API="3.18"
182fi182fi
183183
184# Check for newer Plank
185PLANK_PKGS="plank >= 0.10.9"
186PKG_CHECK_MODULES(PLANK_0_11, $PLANK_PKGS, [enable_plank_0_11=yes], [enable_plank_0_11=no])
187if test "x$enable_plank_0_11" = "xyes" ; then
188 VALAFLAGS="$VALAFLAGS --define HAVE_PLANK_0_11"
189fi
190
184# -----------------------------------------------------------191# -----------------------------------------------------------
185# Dependencies for Notifications plugin192# Dependencies for Notifications plugin
186# -----------------------------------------------------------193# -----------------------------------------------------------
187194
=== modified file 'lib/Utils.vala'
--- lib/Utils.vala 2015-03-11 13:43:19 +0000
+++ lib/Utils.vala 2015-11-03 15:28:06 +0000
@@ -132,10 +132,18 @@
132 if (app != null && app.get_desktop_file () != null) {132 if (app != null && app.get_desktop_file () != null) {
133 var appinfo = new DesktopAppInfo.from_filename (app.get_desktop_file ());133 var appinfo = new DesktopAppInfo.from_filename (app.get_desktop_file ());
134 if (appinfo != null) {134 if (appinfo != null) {
135#if HAVE_PLANK_0_11
136 icon = Plank.DrawingService.get_icon_from_gicon (appinfo.get_icon ());
137#else
135 icon = Plank.Drawing.DrawingService.get_icon_from_gicon (appinfo.get_icon ());138 icon = Plank.Drawing.DrawingService.get_icon_from_gicon (appinfo.get_icon ());
139#endif
136 icon_key = "%s::%i".printf (icon, size);140 icon_key = "%s::%i".printf (icon, size);
137 if (ignore_cache || (image = icon_pixbuf_cache.get (icon_key)) == null) {141 if (ignore_cache || (image = icon_pixbuf_cache.get (icon_key)) == null) {
142#if HAVE_PLANK_0_11
143 image = Plank.DrawingService.load_icon (icon, size, size);
144#else
138 image = Plank.Drawing.DrawingService.load_icon (icon, size, size);145 image = Plank.Drawing.DrawingService.load_icon (icon, size, size);
146#endif
139 not_cached = true;147 not_cached = true;
140 }148 }
141 }149 }
@@ -166,7 +174,11 @@
166 }174 }
167175
168 if (size != image.width || size != image.height)176 if (size != image.width || size != image.height)
177#if HAVE_PLANK_0_11
178 image = Plank.DrawingService.ar_scale (image, size, size);
179#else
169 image = Plank.Drawing.DrawingService.ar_scale (image, size, size);180 image = Plank.Drawing.DrawingService.ar_scale (image, size, size);
181#endif
170182
171 if (not_cached)183 if (not_cached)
172 icon_pixbuf_cache.set (icon_key, image);184 icon_pixbuf_cache.set (icon_key, image);
173185
=== modified file 'src/DockThemeManager.vala'
--- src/DockThemeManager.vala 2015-03-12 14:10:18 +0000
+++ src/DockThemeManager.vala 2015-11-03 15:28:06 +0000
@@ -33,20 +33,35 @@
33 }33 }
3434
35 Plank.DockPreferences? dock_settings = null;35 Plank.DockPreferences? dock_settings = null;
36#if HAVE_PLANK_0_11
37 Plank.DockTheme? dock_theme = null;
38
39 public signal void dock_theme_changed (Plank.DockTheme? old_theme,
40 Plank.DockTheme new_theme);
41#else
36 Plank.Drawing.DockTheme? dock_theme = null;42 Plank.Drawing.DockTheme? dock_theme = null;
3743
38 public signal void dock_theme_changed (Plank.Drawing.DockTheme? old_theme,44 public signal void dock_theme_changed (Plank.Drawing.DockTheme? old_theme,
39 Plank.Drawing.DockTheme new_theme);45 Plank.Drawing.DockTheme new_theme);
46#endif
4047
41 DockThemeManager ()48 DockThemeManager ()
42 {49 {
50#if HAVE_PLANK_0_11
51 dock_settings = new Plank.DockPreferences ("dock1");
52#else
43 var file = Environment.get_user_config_dir () + "/plank/dock1/settings";53 var file = Environment.get_user_config_dir () + "/plank/dock1/settings";
4454
45 dock_settings = new Plank.DockPreferences.with_filename (file);55 dock_settings = new Plank.DockPreferences.with_filename (file);
56#endif
46 dock_settings.notify["Theme"].connect (load_dock_theme);57 dock_settings.notify["Theme"].connect (load_dock_theme);
47 }58 }
4859
60#if HAVE_PLANK_0_11
61 public Plank.DockTheme get_dock_theme ()
62#else
49 public Plank.Drawing.DockTheme get_dock_theme ()63 public Plank.Drawing.DockTheme get_dock_theme ()
64#endif
50 {65 {
51 if (dock_theme == null)66 if (dock_theme == null)
52 load_dock_theme ();67 load_dock_theme ();
@@ -61,7 +76,11 @@
6176
62 void load_dock_theme ()77 void load_dock_theme ()
63 {78 {
79#if HAVE_PLANK_0_11
80 var new_theme = new Plank.DockTheme (dock_settings.Theme);
81#else
64 var new_theme = new Plank.Drawing.DockTheme (dock_settings.Theme);82 var new_theme = new Plank.Drawing.DockTheme (dock_settings.Theme);
83#endif
65 new_theme.load ("dock");84 new_theme.load ("dock");
66 dock_theme_changed (dock_theme, new_theme);85 dock_theme_changed (dock_theme, new_theme);
67 dock_theme = new_theme;86 dock_theme = new_theme;
6887
=== modified file 'src/Main.vala'
--- src/Main.vala 2014-04-08 12:51:06 +0000
+++ src/Main.vala 2015-11-03 15:28:06 +0000
@@ -52,7 +52,11 @@
52 GLib.Environment.unset_variable ("NO_GAIL");52 GLib.Environment.unset_variable ("NO_GAIL");
53 GLib.Environment.unset_variable ("NO_AT_BRIDGE");53 GLib.Environment.unset_variable ("NO_AT_BRIDGE");
5454
55#if HAVE_PLANK_0_11
56 Plank.Paths.initialize ("plank", Config.DATADIR + "/plank");
57#else
55 Plank.Services.Paths.initialize ("plank", Config.DATADIR + "/plank");58 Plank.Services.Paths.initialize ("plank", Config.DATADIR + "/plank");
59#endif
5660
57 // Force initialization of static fields in Utils class61 // Force initialization of static fields in Utils class
58 // https://bugzilla.gnome.org/show_bug.cgi?id=54318962 // https://bugzilla.gnome.org/show_bug.cgi?id=543189
5963
=== modified file 'src/Widgets/WindowSwitcher.vala'
--- src/Widgets/WindowSwitcher.vala 2015-06-27 21:04:28 +0000
+++ src/Widgets/WindowSwitcher.vala 2015-11-03 15:28:06 +0000
@@ -33,8 +33,13 @@
3333
34 WindowActor? dock_window;34 WindowActor? dock_window;
35 Actor dock;35 Actor dock;
36#if HAVE_PLANK_0_11
37 Plank.Surface? dock_surface;
38 Plank.DockTheme dock_theme;
39#else
36 Plank.Drawing.DockSurface? dock_surface;40 Plank.Drawing.DockSurface? dock_surface;
37 Plank.Drawing.DockTheme dock_theme;41 Plank.Drawing.DockTheme dock_theme;
42#endif
38 Plank.DockPreferences dock_settings;43 Plank.DockPreferences dock_settings;
39 float dock_y_offset;44 float dock_y_offset;
40 float dock_height_offset;45 float dock_height_offset;
@@ -57,12 +62,20 @@
57 construct62 construct
58 {63 {
59 // pull drawing methods from libplank64 // pull drawing methods from libplank
65#if HAVE_PLANK_0_11
66 dock_settings = new Plank.DockPreferences ("dock1");
67#else
60 var settings_file = Environment.get_user_config_dir () + "/plank/dock1/settings";68 var settings_file = Environment.get_user_config_dir () + "/plank/dock1/settings";
61 dock_settings = new Plank.DockPreferences.with_filename (settings_file);69 dock_settings = new Plank.DockPreferences.with_filename (settings_file);
70#endif
62 dock_settings.notify.connect (update_dock);71 dock_settings.notify.connect (update_dock);
63 dock_settings.notify["Theme"].connect (load_dock_theme);72 dock_settings.notify["Theme"].connect (load_dock_theme);
6473
74#if HAVE_PLANK_0_11
75 var launcher_folder = Plank.Paths.AppConfigFolder.get_child ("dock1").get_child ("launchers");
76#else
65 var launcher_folder = Plank.Services.Paths.AppConfigFolder.get_child ("dock1").get_child ("launchers");77 var launcher_folder = Plank.Services.Paths.AppConfigFolder.get_child ("dock1").get_child ("launchers");
78#endif
6679
67 if (launcher_folder.query_exists ()) {80 if (launcher_folder.query_exists ()) {
68 try {81 try {
@@ -111,7 +124,11 @@
111 if (dock_theme != null)124 if (dock_theme != null)
112 dock_theme.notify.disconnect (update_dock);125 dock_theme.notify.disconnect (update_dock);
113126
127#if HAVE_PLANK_0_11
128 dock_theme = new Plank.DockTheme (dock_settings.Theme);
129#else
114 dock_theme = new Plank.Drawing.DockTheme (dock_settings.Theme);130 dock_theme = new Plank.Drawing.DockTheme (dock_settings.Theme);
131#endif
115 dock_theme.load ("dock");132 dock_theme.load ("dock");
116 dock_theme.notify.connect (update_dock);133 dock_theme.notify.connect (update_dock);
117134
@@ -203,7 +220,11 @@
203 }220 }
204221
205 if (dock_surface == null || dock_surface.Width != width || dock_surface.Height != height) {222 if (dock_surface == null || dock_surface.Width != width || dock_surface.Height != height) {
223#if HAVE_PLANK_0_11
224 var dummy_surface = new Plank.Surface.with_cairo_surface (1, 1, cr.get_target ());
225#else
206 var dummy_surface = new Plank.Drawing.DockSurface.with_surface (1, 1, cr.get_target ());226 var dummy_surface = new Plank.Drawing.DockSurface.with_surface (1, 1, cr.get_target ());
227#endif
207228
208 dock_surface = dock_theme.create_background (width, height, position, dummy_surface);229 dock_surface = dock_theme.create_background (width, height, position, dummy_surface);
209 }230 }

Subscribers

People subscribed via source and target branches