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
1=== modified file 'configure.ac'
2--- configure.ac 2015-09-23 14:52:12 +0000
3+++ configure.ac 2015-11-03 15:28:06 +0000
4@@ -181,6 +181,13 @@
5 MUTTER_API="3.18"
6 fi
7
8+# Check for newer Plank
9+PLANK_PKGS="plank >= 0.10.9"
10+PKG_CHECK_MODULES(PLANK_0_11, $PLANK_PKGS, [enable_plank_0_11=yes], [enable_plank_0_11=no])
11+if test "x$enable_plank_0_11" = "xyes" ; then
12+ VALAFLAGS="$VALAFLAGS --define HAVE_PLANK_0_11"
13+fi
14+
15 # -----------------------------------------------------------
16 # Dependencies for Notifications plugin
17 # -----------------------------------------------------------
18
19=== modified file 'lib/Utils.vala'
20--- lib/Utils.vala 2015-03-11 13:43:19 +0000
21+++ lib/Utils.vala 2015-11-03 15:28:06 +0000
22@@ -132,10 +132,18 @@
23 if (app != null && app.get_desktop_file () != null) {
24 var appinfo = new DesktopAppInfo.from_filename (app.get_desktop_file ());
25 if (appinfo != null) {
26+#if HAVE_PLANK_0_11
27+ icon = Plank.DrawingService.get_icon_from_gicon (appinfo.get_icon ());
28+#else
29 icon = Plank.Drawing.DrawingService.get_icon_from_gicon (appinfo.get_icon ());
30+#endif
31 icon_key = "%s::%i".printf (icon, size);
32 if (ignore_cache || (image = icon_pixbuf_cache.get (icon_key)) == null) {
33+#if HAVE_PLANK_0_11
34+ image = Plank.DrawingService.load_icon (icon, size, size);
35+#else
36 image = Plank.Drawing.DrawingService.load_icon (icon, size, size);
37+#endif
38 not_cached = true;
39 }
40 }
41@@ -166,7 +174,11 @@
42 }
43
44 if (size != image.width || size != image.height)
45+#if HAVE_PLANK_0_11
46+ image = Plank.DrawingService.ar_scale (image, size, size);
47+#else
48 image = Plank.Drawing.DrawingService.ar_scale (image, size, size);
49+#endif
50
51 if (not_cached)
52 icon_pixbuf_cache.set (icon_key, image);
53
54=== modified file 'src/DockThemeManager.vala'
55--- src/DockThemeManager.vala 2015-03-12 14:10:18 +0000
56+++ src/DockThemeManager.vala 2015-11-03 15:28:06 +0000
57@@ -33,20 +33,35 @@
58 }
59
60 Plank.DockPreferences? dock_settings = null;
61+#if HAVE_PLANK_0_11
62+ Plank.DockTheme? dock_theme = null;
63+
64+ public signal void dock_theme_changed (Plank.DockTheme? old_theme,
65+ Plank.DockTheme new_theme);
66+#else
67 Plank.Drawing.DockTheme? dock_theme = null;
68
69 public signal void dock_theme_changed (Plank.Drawing.DockTheme? old_theme,
70 Plank.Drawing.DockTheme new_theme);
71+#endif
72
73 DockThemeManager ()
74 {
75+#if HAVE_PLANK_0_11
76+ dock_settings = new Plank.DockPreferences ("dock1");
77+#else
78 var file = Environment.get_user_config_dir () + "/plank/dock1/settings";
79
80 dock_settings = new Plank.DockPreferences.with_filename (file);
81+#endif
82 dock_settings.notify["Theme"].connect (load_dock_theme);
83 }
84
85+#if HAVE_PLANK_0_11
86+ public Plank.DockTheme get_dock_theme ()
87+#else
88 public Plank.Drawing.DockTheme get_dock_theme ()
89+#endif
90 {
91 if (dock_theme == null)
92 load_dock_theme ();
93@@ -61,7 +76,11 @@
94
95 void load_dock_theme ()
96 {
97+#if HAVE_PLANK_0_11
98+ var new_theme = new Plank.DockTheme (dock_settings.Theme);
99+#else
100 var new_theme = new Plank.Drawing.DockTheme (dock_settings.Theme);
101+#endif
102 new_theme.load ("dock");
103 dock_theme_changed (dock_theme, new_theme);
104 dock_theme = new_theme;
105
106=== modified file 'src/Main.vala'
107--- src/Main.vala 2014-04-08 12:51:06 +0000
108+++ src/Main.vala 2015-11-03 15:28:06 +0000
109@@ -52,7 +52,11 @@
110 GLib.Environment.unset_variable ("NO_GAIL");
111 GLib.Environment.unset_variable ("NO_AT_BRIDGE");
112
113+#if HAVE_PLANK_0_11
114+ Plank.Paths.initialize ("plank", Config.DATADIR + "/plank");
115+#else
116 Plank.Services.Paths.initialize ("plank", Config.DATADIR + "/plank");
117+#endif
118
119 // Force initialization of static fields in Utils class
120 // https://bugzilla.gnome.org/show_bug.cgi?id=543189
121
122=== modified file 'src/Widgets/WindowSwitcher.vala'
123--- src/Widgets/WindowSwitcher.vala 2015-06-27 21:04:28 +0000
124+++ src/Widgets/WindowSwitcher.vala 2015-11-03 15:28:06 +0000
125@@ -33,8 +33,13 @@
126
127 WindowActor? dock_window;
128 Actor dock;
129+#if HAVE_PLANK_0_11
130+ Plank.Surface? dock_surface;
131+ Plank.DockTheme dock_theme;
132+#else
133 Plank.Drawing.DockSurface? dock_surface;
134 Plank.Drawing.DockTheme dock_theme;
135+#endif
136 Plank.DockPreferences dock_settings;
137 float dock_y_offset;
138 float dock_height_offset;
139@@ -57,12 +62,20 @@
140 construct
141 {
142 // pull drawing methods from libplank
143+#if HAVE_PLANK_0_11
144+ dock_settings = new Plank.DockPreferences ("dock1");
145+#else
146 var settings_file = Environment.get_user_config_dir () + "/plank/dock1/settings";
147 dock_settings = new Plank.DockPreferences.with_filename (settings_file);
148+#endif
149 dock_settings.notify.connect (update_dock);
150 dock_settings.notify["Theme"].connect (load_dock_theme);
151
152+#if HAVE_PLANK_0_11
153+ var launcher_folder = Plank.Paths.AppConfigFolder.get_child ("dock1").get_child ("launchers");
154+#else
155 var launcher_folder = Plank.Services.Paths.AppConfigFolder.get_child ("dock1").get_child ("launchers");
156+#endif
157
158 if (launcher_folder.query_exists ()) {
159 try {
160@@ -111,7 +124,11 @@
161 if (dock_theme != null)
162 dock_theme.notify.disconnect (update_dock);
163
164+#if HAVE_PLANK_0_11
165+ dock_theme = new Plank.DockTheme (dock_settings.Theme);
166+#else
167 dock_theme = new Plank.Drawing.DockTheme (dock_settings.Theme);
168+#endif
169 dock_theme.load ("dock");
170 dock_theme.notify.connect (update_dock);
171
172@@ -203,7 +220,11 @@
173 }
174
175 if (dock_surface == null || dock_surface.Width != width || dock_surface.Height != height) {
176+#if HAVE_PLANK_0_11
177+ var dummy_surface = new Plank.Surface.with_cairo_surface (1, 1, cr.get_target ());
178+#else
179 var dummy_surface = new Plank.Drawing.DockSurface.with_surface (1, 1, cr.get_target ());
180+#endif
181
182 dock_surface = dock_theme.create_background (width, height, position, dummy_surface);
183 }

Subscribers

People subscribed via source and target branches