Merge lp:~gala-dev/gala/mutter38 into lp:gala
- mutter38
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Rico Tzschichholz | ||||||||
Approved revision: | 386 | ||||||||
Merged at revision: | 364 | ||||||||
Proposed branch: | lp:~gala-dev/gala/mutter38 | ||||||||
Merge into: | lp:gala | ||||||||
Diff against target: |
1538 lines (+1085/-32) 17 files modified
CMakeLists.txt (+8/-2) src/Background/Background.vala (+194/-0) src/Background/BackgroundCache.vala (+119/-0) src/Background/BackgroundManager.vala (+61/-0) src/Background/SlideShow.vala (+163/-0) src/Background/SystemBackground.vala (+39/-0) src/Plugin.vala (+79/-10) src/Settings.vala (+25/-0) src/Widgets/WindowOverview.vala (+6/-10) src/Widgets/WindowSwitcher.vala (+7/-1) src/Widgets/WindowThumb.vala (+1/-1) src/Widgets/WorkspaceThumb.vala (+17/-5) src/Widgets/WorkspaceView.vala (+34/-2) src/Zooming.vala (+1/-1) vapi/gdesktopenums-3.0.vapi (+14/-0) vapi/gnome-desktop-3.0.deps (+7/-0) vapi/gnome-desktop-3.0.vapi (+310/-0) |
||||||||
To merge this branch: | bzr merge lp:~gala-dev/gala/mutter38 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rico Tzschichholz | Approve | ||
Cody Garver (community) | Approve | ||
Review via email: mp+179604@code.launchpad.net |
Commit message
Add support for mutter >= 3.8
Description of the change
Just for "pre-reviewing"
Rico Tzschichholz (ricotz) wrote : | # |
Tom Beckmann (tombeckmann) wrote : | # |
It appears to be running without problems for me now with libmutter 3.10.1.
- 372. By Tom Beckmann
-
add 'owned' to update_image's image parameter
- 373. By Tom Beckmann
-
workspacethumb: fix weirdnesses with the last workspacethumb and the opacity change
- 374. By Tom Beckmann
-
add animation when switching from wallpaper to slideshow
- 375. By Tom Beckmann
-
fix session intialization being blocked by gala
- 376. By Rico Tzschichholz
-
cleanup: Organize fields/properties and use gobject-
style-contstruc tion - 377. By Tom Beckmann
-
fix wallpaper on second monitor being moved away, fix cache to actually enable waiting for a loading texture
Cody Garver (codygarver) wrote : | # |
I think
add_definitions
should become
add_definitions
add_definitions
Maybe with some comments above the lines
Rico Tzschichholz (ricotz) wrote : | # |
> I think
>
> add_definitions
> -DGNOME_
>
> should become
>
> add_definitions
> add_definitions
>
> Maybe with some comments above the lines
This is not needed. They would have called it "add_definition" then ;)
Cody Garver (codygarver) : | # |
- 378. By Tom Beckmann
-
revert revision 374 because it fails to handle some cases. Adding animations when switching to slideshows will be revisited later
- 379. By Rico Tzschichholz
-
background: Handle picture-uri more careful
- 380. By Rico Tzschichholz
-
background: Make *_string_to_enum methods static
- 381. By Rico Tzschichholz
-
build: Silence c-warnings
Unfortunately we can't really do much about them.
- 382. By Rico Tzschichholz
-
build: Make it compile with mutter >= 3.4
- 383. By Rico Tzschichholz
-
build: More compat fixes for mutter >= 3.4
- 384. By Rico Tzschichholz
-
build: Yet more compat fixes for mutter >= 3.4
- 385. By Tom Beckmann
-
simplify slideshow/static image switching, add animation when switching between different types
Cody Garver (codygarver) wrote : | # |
I get this when I unplug from external display: http://
Tom Beckmann (tombeckmann) wrote : | # |
@Cody, can you always reproduce this once you plug out your monitor? Or was it only once?
Our code does not really "allow" any bugs in that area, so if it only happened once it could be a race condition of some sort in mutter/driver code.
Cody Garver (codygarver) wrote : | # |
It is hard to say whose fault it could be since I am on 14.04 alpha after all. However, it is consistent for a week now.
Cody Garver (codygarver) wrote : | # |
I am unable to reproduce my problem on a fresh install
- 386. By Rico Tzschichholz
-
Use MT-safe Clutter.
Threads. Timeout. add () instead of GLib.Timeout.add ()
Rico Tzschichholz (ricotz) wrote : | # |
Periodically cleaning the BackgroundCache can be postponed. So for now ignore the resulting increase of memory usage when switching the wallpaper.
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2013-11-16 16:18:45 +0000 |
3 | +++ CMakeLists.txt 2013-11-27 18:52:22 +0000 |
4 | @@ -31,10 +31,10 @@ |
5 | list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
6 | |
7 | configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala) |
8 | -add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\") |
9 | +add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DGNOME_DESKTOP_USE_UNSTABLE_API -w) |
10 | |
11 | find_package(PkgConfig) |
12 | -pkg_check_modules(DEPS REQUIRED libmutter>=3.4 granite clutter-1.0>=1.9.16 clutter-gtk-1.0 libbamf3 xfixes gee-1.0 plank) |
13 | +pkg_check_modules(DEPS REQUIRED libmutter>=3.4 granite clutter-1.0>=1.9.16 clutter-gtk-1.0 libbamf3 xfixes gee-1.0 plank gnome-desktop-3.0) |
14 | |
15 | set (MUTTER36_FLAGS "") |
16 | pkg_check_modules(MUTTER36 QUIET libmutter>=3.5) |
17 | @@ -84,6 +84,11 @@ |
18 | src/TextShadowEffect.vala |
19 | src/Utils.vala |
20 | src/Zooming.vala |
21 | + src/Background/Background.vala |
22 | + src/Background/BackgroundCache.vala |
23 | + src/Background/BackgroundManager.vala |
24 | + src/Background/SlideShow.vala |
25 | + src/Background/SystemBackground.vala |
26 | src/Widgets/AppIcon.vala |
27 | src/Widgets/WindowOverview.vala |
28 | src/Widgets/WindowSwitcher.vala |
29 | @@ -99,6 +104,7 @@ |
30 | clutter-gtk-1.0 |
31 | gdk-x11-3.0 |
32 | gdesktopenums-3.0 |
33 | + gnome-desktop-3.0 |
34 | xfixes-4.0 |
35 | OPTIONS |
36 | -g |
37 | |
38 | === modified file 'data/texture.png' |
39 | Binary files data/texture.png 2013-02-17 00:38:16 +0000 and data/texture.png 2013-11-27 18:52:22 +0000 differ |
40 | === added directory 'src/Background' |
41 | === added file 'src/Background/Background.vala' |
42 | --- src/Background/Background.vala 1970-01-01 00:00:00 +0000 |
43 | +++ src/Background/Background.vala 2013-11-27 18:52:22 +0000 |
44 | @@ -0,0 +1,194 @@ |
45 | +// |
46 | +// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz |
47 | +// |
48 | +// This program is free software: you can redistribute it and/or modify |
49 | +// it under the terms of the GNU General Public License as published by |
50 | +// the Free Software Foundation, either version 3 of the License, or |
51 | +// (at your option) any later version. |
52 | +// |
53 | +// This program is distributed in the hope that it will be useful, |
54 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
55 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
56 | +// GNU General Public License for more details. |
57 | +// |
58 | +// You should have received a copy of the GNU General Public License |
59 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
60 | +// |
61 | + |
62 | +namespace Gala |
63 | +{ |
64 | +#if HAS_MUTTER38 |
65 | + /** |
66 | + * Group that holds a pattern at the very bottom and then an image showing the |
67 | + * current wallpaper above (and one more additional image for transitions). |
68 | + * It listens to changes on the provided settings object and updates accordingly. |
69 | + */ |
70 | + public class Background : Meta.BackgroundGroup |
71 | + { |
72 | + const uint ANIMATION_TRANSITION_DURATION = 1500; |
73 | + |
74 | + public Meta.Screen screen { get; construct; } |
75 | + public int monitor { get; construct; } |
76 | + public Settings settings { get; construct; } |
77 | + |
78 | + Meta.BackgroundActor pattern; |
79 | + Clutter.Actor? image = null; |
80 | + |
81 | + public Background (Meta.Screen screen, int monitor, Settings settings) |
82 | + { |
83 | + Object (screen: screen, monitor: monitor, settings: settings); |
84 | + } |
85 | + |
86 | + construct |
87 | + { |
88 | + pattern = new Meta.BackgroundActor (); |
89 | + pattern.add_constraint (new Clutter.BindConstraint (this, Clutter.BindCoordinate.SIZE, 0)); |
90 | + add_child (pattern); |
91 | + |
92 | + load (null); |
93 | + |
94 | + settings.changed.connect (load); |
95 | + } |
96 | + |
97 | + ~Background () |
98 | + { |
99 | + settings.changed.disconnect (load); |
100 | + } |
101 | + |
102 | + /** |
103 | + * (Re)loads all components if key_changed is null or only the key_changed component |
104 | + */ |
105 | + void load (string? key_changed) |
106 | + { |
107 | + var all = key_changed == null; |
108 | + var cache = BackgroundCache.get_default (); |
109 | + |
110 | + // update images |
111 | + if (all || key_changed == "picture-uri" || key_changed == "picture-options") { |
112 | + var style = style_string_to_enum (settings.get_string ("picture-options")); |
113 | + var uri = settings.get_string ("picture-uri"); |
114 | + |
115 | + string filename; |
116 | + if (GLib.Uri.parse_scheme (uri) != null) |
117 | + filename = File.new_for_uri (uri).get_path (); |
118 | + else |
119 | + filename = uri; |
120 | + |
121 | + // no image at all or malformed picture-uri |
122 | + if (filename == null || filename == "" || style == GDesktop.BackgroundStyle.NONE) { |
123 | + set_current (null); |
124 | + // animation |
125 | + } else if (filename.has_suffix (".xml")) { |
126 | + var slides = new SlideShow (filename, screen, 0, style); |
127 | + |
128 | + slides.load.begin ((obj, res) => { |
129 | + if (!slides.load.end (res)) |
130 | + set_current (null); |
131 | + else |
132 | + set_current (slides); |
133 | + }); |
134 | + // normal wallpaper |
135 | + } else { |
136 | + cache.load_image.begin (filename, monitor, style, (obj, res) => { |
137 | + var content = cache.load_image.end (res); |
138 | + if (content == null) { |
139 | + set_current (null); |
140 | + return; |
141 | + } |
142 | + |
143 | + var new_image = new Meta.BackgroundActor (); |
144 | + new_image.content = content; |
145 | + set_current (new_image); |
146 | + }); |
147 | + } |
148 | + } |
149 | + |
150 | + // update image opacity |
151 | + if (all || key_changed == "picture-opacity") { |
152 | + if (image != null) |
153 | + image.opacity = (uint8)(settings.get_int ("picture-opacity") / 100.0 * 255); |
154 | + } |
155 | + |
156 | + // update pattern |
157 | + if (all |
158 | + || key_changed == "primary-color" |
159 | + || key_changed == "secondary-color" |
160 | + || key_changed == "color-shading-type") { |
161 | + var primary_color = Clutter.Color.from_string (settings.get_string ("primary-color")); |
162 | + var secondary_color = Clutter.Color.from_string (settings.get_string ("secondary-color")); |
163 | + var shading_type = shading_string_to_enum (settings.get_string ("color-shading-type")); |
164 | + pattern.content = cache.load_pattern (monitor, primary_color, secondary_color, shading_type); |
165 | + } |
166 | + } |
167 | + |
168 | + /** |
169 | + * Fade a new image over the old, then destroy the old one and replace it with the new one |
170 | + * if new_image is null, fade out and destroy the current image to show the pattern |
171 | + */ |
172 | + void set_current (Clutter.Actor? new_image) |
173 | + { |
174 | + if (new_image == null) { |
175 | + if (image != null) |
176 | + image.animate (Clutter.AnimationMode.EASE_OUT_QUAD, ANIMATION_TRANSITION_DURATION, |
177 | + opacity: 0).completed.connect (() => { |
178 | + image.destroy (); |
179 | + }); |
180 | + return; |
181 | + } |
182 | + |
183 | + new_image.opacity = 0; |
184 | + new_image.add_constraint (new Clutter.BindConstraint (this, Clutter.BindCoordinate.SIZE, 0)); |
185 | + insert_child_above (new_image, null); |
186 | + |
187 | + var dest_opacity = (uint8)(settings.get_int ("picture-opacity") / 100.0 * 255); |
188 | + new_image.animate (Clutter.AnimationMode.EASE_OUT_QUAD, ANIMATION_TRANSITION_DURATION, |
189 | + opacity: dest_opacity).completed.connect (() => { |
190 | + if (image != null) |
191 | + image.destroy (); |
192 | + image = new_image; |
193 | + }); |
194 | + } |
195 | + |
196 | + /** |
197 | + * translates the string returned from gsettings for the color-shading-type key to the |
198 | + * appropriate GDesktop.BackgroundShading enum value |
199 | + */ |
200 | + static GDesktop.BackgroundShading shading_string_to_enum (string shading) |
201 | + { |
202 | + switch (shading) { |
203 | + case "horizontal": |
204 | + return GDesktop.BackgroundShading.HORIZONTAL; |
205 | + case "vertical": |
206 | + return GDesktop.BackgroundShading.VERTICAL; |
207 | + } |
208 | + |
209 | + return GDesktop.BackgroundShading.SOLID; |
210 | + } |
211 | + |
212 | + /** |
213 | + * translates the string returned from gsettings for the picture-options key to the |
214 | + * appropriate GDesktop.BackgroundStyle enum value |
215 | + */ |
216 | + static GDesktop.BackgroundStyle style_string_to_enum (string style) |
217 | + { |
218 | + switch (style) { |
219 | + case "wallpaper": |
220 | + return GDesktop.BackgroundStyle.WALLPAPER; |
221 | + case "centered": |
222 | + return GDesktop.BackgroundStyle.CENTERED; |
223 | + case "scaled": |
224 | + return GDesktop.BackgroundStyle.SCALED; |
225 | + case "stretched": |
226 | + return GDesktop.BackgroundStyle.STRETCHED; |
227 | + case "zoom": |
228 | + return GDesktop.BackgroundStyle.ZOOM; |
229 | + case "spanned": |
230 | + return GDesktop.BackgroundStyle.SPANNED; |
231 | + } |
232 | + |
233 | + return GDesktop.BackgroundStyle.NONE; |
234 | + } |
235 | + } |
236 | +#endif |
237 | +} |
238 | + |
239 | |
240 | === added file 'src/Background/BackgroundCache.vala' |
241 | --- src/Background/BackgroundCache.vala 1970-01-01 00:00:00 +0000 |
242 | +++ src/Background/BackgroundCache.vala 2013-11-27 18:52:22 +0000 |
243 | @@ -0,0 +1,119 @@ |
244 | +// |
245 | +// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz |
246 | +// |
247 | +// This program is free software: you can redistribute it and/or modify |
248 | +// it under the terms of the GNU General Public License as published by |
249 | +// the Free Software Foundation, either version 3 of the License, or |
250 | +// (at your option) any later version. |
251 | +// |
252 | +// This program is distributed in the hope that it will be useful, |
253 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
254 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
255 | +// GNU General Public License for more details. |
256 | +// |
257 | +// You should have received a copy of the GNU General Public License |
258 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
259 | +// |
260 | + |
261 | +namespace Gala |
262 | +{ |
263 | +#if HAS_MUTTER38 |
264 | + public class BackgroundCache : Object |
265 | + { |
266 | + struct WaitingCallback |
267 | + { |
268 | + SourceFunc func; |
269 | + string hash; |
270 | + } |
271 | + |
272 | + static BackgroundCache? instance = null; |
273 | + |
274 | + public static void init (Meta.Screen screen) |
275 | + { |
276 | + instance = new BackgroundCache (screen); |
277 | + } |
278 | + |
279 | + public static BackgroundCache get_default () |
280 | + requires (instance != null) |
281 | + { |
282 | + return instance; |
283 | + } |
284 | + |
285 | + public Meta.Screen screen { get; construct; } |
286 | + |
287 | + Gee.HashMap<string,Meta.Background> image_cache; |
288 | + Gee.HashMap<string,Meta.Background> pattern_cache; |
289 | + Gee.LinkedList<WaitingCallback?> waiting_callbacks; |
290 | + |
291 | + BackgroundCache (Meta.Screen screen) |
292 | + { |
293 | + Object (screen: screen); |
294 | + } |
295 | + |
296 | + construct |
297 | + { |
298 | + image_cache = new Gee.HashMap<string,Meta.Background> (); |
299 | + pattern_cache = new Gee.HashMap<string,Meta.Background> (); |
300 | + waiting_callbacks = new Gee.LinkedList<WaitingCallback?> (); |
301 | + } |
302 | + |
303 | + public async Meta.Background? load_image (string file, int monitor, |
304 | + GDesktop.BackgroundStyle style) |
305 | + { |
306 | + string hash = "%s#%i".printf (file, style); |
307 | + Meta.Background? content = image_cache.get (hash); |
308 | + |
309 | + if (content != null) { |
310 | + // the content has been created, but the file is still loading, so we wait |
311 | + if (content.get_filename () == null) { |
312 | + waiting_callbacks.add ({ load_image.callback, hash }); |
313 | + yield; |
314 | + } |
315 | + |
316 | + return content.copy (monitor, Meta.BackgroundEffects.NONE); |
317 | + } |
318 | + |
319 | + content = new Meta.Background (screen, monitor, Meta.BackgroundEffects.NONE); |
320 | + |
321 | + image_cache.set (hash, content); |
322 | + |
323 | + try { |
324 | + yield content.load_file_async (file, style, null); |
325 | + } catch (Error e) { |
326 | + warning (e.message); |
327 | + return null; |
328 | + } |
329 | + |
330 | + foreach (var callback in waiting_callbacks) { |
331 | + if (callback.hash == hash) { |
332 | + callback.func (); |
333 | + waiting_callbacks.remove (callback); |
334 | + } |
335 | + } |
336 | + |
337 | + return content; |
338 | + } |
339 | + |
340 | + public Meta.Background load_pattern (int monitor, Clutter.Color primary, Clutter.Color secondary, |
341 | + GDesktop.BackgroundShading shading_type) |
342 | + { |
343 | + string hash = "%s#%s#%i".printf (primary.to_string (), secondary.to_string (), shading_type); |
344 | + Meta.Background? content = pattern_cache.get (hash); |
345 | + |
346 | + if (content != null) |
347 | + return content.copy (monitor, Meta.BackgroundEffects.NONE); |
348 | + |
349 | + content = new Meta.Background (screen, monitor, Meta.BackgroundEffects.NONE); |
350 | + if (shading_type == GDesktop.BackgroundShading.SOLID) |
351 | + content.load_color (primary); |
352 | + else |
353 | + content.load_gradient (shading_type, primary, secondary); |
354 | + |
355 | + pattern_cache.set (hash, content); |
356 | + |
357 | + return content; |
358 | + } |
359 | + } |
360 | +#endif |
361 | +} |
362 | + |
363 | |
364 | === added file 'src/Background/BackgroundManager.vala' |
365 | --- src/Background/BackgroundManager.vala 1970-01-01 00:00:00 +0000 |
366 | +++ src/Background/BackgroundManager.vala 2013-11-27 18:52:22 +0000 |
367 | @@ -0,0 +1,61 @@ |
368 | +// |
369 | +// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz |
370 | +// |
371 | +// This program is free software: you can redistribute it and/or modify |
372 | +// it under the terms of the GNU General Public License as published by |
373 | +// the Free Software Foundation, either version 3 of the License, or |
374 | +// (at your option) any later version. |
375 | +// |
376 | +// This program is distributed in the hope that it will be useful, |
377 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
378 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
379 | +// GNU General Public License for more details. |
380 | +// |
381 | +// You should have received a copy of the GNU General Public License |
382 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
383 | +// |
384 | + |
385 | +namespace Gala |
386 | +{ |
387 | +#if HAS_MUTTER38 |
388 | + public class BackgroundManager : Meta.BackgroundGroup |
389 | + { |
390 | + public Meta.Screen screen { get; construct; } |
391 | + |
392 | + public BackgroundManager (Meta.Screen screen) |
393 | + { |
394 | + Object (screen: screen); |
395 | + } |
396 | + |
397 | + construct |
398 | + { |
399 | + screen.monitors_changed.connect (update); |
400 | + |
401 | + update (); |
402 | + } |
403 | + |
404 | + ~BackgroundManager () |
405 | + { |
406 | + screen.monitors_changed.disconnect (update); |
407 | + } |
408 | + |
409 | + void update () |
410 | + { |
411 | + remove_all_children (); |
412 | + |
413 | + var settings = BackgroundSettings.get_default ().schema; |
414 | + |
415 | + for (var i = 0; i < screen.get_n_monitors (); i++) { |
416 | + var geom = screen.get_monitor_geometry (i); |
417 | + var background = new Background (screen, i, settings); |
418 | + |
419 | + background.set_position (geom.x, geom.y); |
420 | + background.set_size (geom.width, geom.height); |
421 | + |
422 | + add_child (background); |
423 | + } |
424 | + } |
425 | + } |
426 | +#endif |
427 | +} |
428 | + |
429 | |
430 | === added file 'src/Background/SlideShow.vala' |
431 | --- src/Background/SlideShow.vala 1970-01-01 00:00:00 +0000 |
432 | +++ src/Background/SlideShow.vala 2013-11-27 18:52:22 +0000 |
433 | @@ -0,0 +1,163 @@ |
434 | +// |
435 | +// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz |
436 | +// |
437 | +// This program is free software: you can redistribute it and/or modify |
438 | +// it under the terms of the GNU General Public License as published by |
439 | +// the Free Software Foundation, either version 3 of the License, or |
440 | +// (at your option) any later version. |
441 | +// |
442 | +// This program is distributed in the hope that it will be useful, |
443 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
444 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
445 | +// GNU General Public License for more details. |
446 | +// |
447 | +// You should have received a copy of the GNU General Public License |
448 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
449 | +// |
450 | + |
451 | +namespace Gala |
452 | +{ |
453 | +#if HAS_MUTTER38 |
454 | + public class SlideShow : Meta.BackgroundGroup |
455 | + { |
456 | + const double ANIMATION_OPACITY_STEP_INCREMENT = 4.0; |
457 | + const double ANIMATION_MIN_WAKEUP_INTERVAL = 1.0; |
458 | + |
459 | + public string file { get; construct set; } |
460 | + public Meta.Screen screen { get; construct set; } |
461 | + public int monitor { get; construct set; } |
462 | + public GDesktop.BackgroundStyle style { get; construct set; } |
463 | + |
464 | + Gnome.BGSlideShow? animation = null; |
465 | + |
466 | + double animation_duration = 0.0; |
467 | + double animation_progress = 0.0; |
468 | + |
469 | + uint update_animation_timeout_id; |
470 | + |
471 | + Meta.BackgroundActor image_from; |
472 | + Meta.BackgroundActor image_to; |
473 | + |
474 | + public SlideShow (string file, Meta.Screen screen, int monitor, GDesktop.BackgroundStyle style) |
475 | + { |
476 | + Object (file: file, screen: screen, monitor: monitor, style: style); |
477 | + } |
478 | + |
479 | + construct |
480 | + { |
481 | + var geom = screen.get_monitor_geometry (monitor); |
482 | + width = geom.width; |
483 | + height = geom.height; |
484 | + |
485 | + image_to = new Meta.BackgroundActor (); |
486 | + image_from = new Meta.BackgroundActor (); |
487 | + |
488 | + add_child (image_from); |
489 | + add_child (image_to); |
490 | + } |
491 | + |
492 | + ~SlideShow () |
493 | + { |
494 | + if (update_animation_timeout_id > 0) |
495 | + Source.remove (update_animation_timeout_id); |
496 | + } |
497 | + |
498 | + public async bool load () |
499 | + { |
500 | + animation = new Gnome.BGSlideShow (file); |
501 | + try { |
502 | + animation.load_async (null, (obj, res) => { |
503 | + load.callback (); |
504 | + }); |
505 | + yield; |
506 | + |
507 | + yield update_animation (); |
508 | + |
509 | + return true; |
510 | + } catch (Error e) { |
511 | + warning (e.message); |
512 | + } |
513 | + |
514 | + return false; |
515 | + } |
516 | + |
517 | + /** |
518 | + * SlideShow animation related functions |
519 | + */ |
520 | + async void update_animation () |
521 | + { |
522 | + if (animation == null) |
523 | + return; |
524 | + |
525 | + update_animation_timeout_id = 0; |
526 | + |
527 | + bool is_fixed; |
528 | + string file_from, file_to; |
529 | + double progress, duration; |
530 | + animation.get_current_slide ((int)width, (int)height, out progress, |
531 | + out duration, out is_fixed, out file_from, out file_to); |
532 | + |
533 | + animation_duration = duration; |
534 | + animation_progress = progress; |
535 | + |
536 | + if (file_from == null && file_to == null) { |
537 | + queue_update_animation (); |
538 | + return; |
539 | + } |
540 | + |
541 | + if (image_from.content == null |
542 | + || (image_from.content as Meta.Background).get_filename () != file_from) { |
543 | + yield update_image (image_from, file_from); |
544 | + } |
545 | + if (image_to.content == null |
546 | + || (image_to.content as Meta.Background).get_filename () != file_to) { |
547 | + yield update_image (image_to, file_to); |
548 | + } |
549 | + |
550 | + update_animation_progress (); |
551 | + } |
552 | + |
553 | + /** |
554 | + * Returns the passed orig_image with the correct content or a new one if orig_image was null |
555 | + */ |
556 | + async void update_image (Meta.BackgroundActor image, string? file) |
557 | + { |
558 | + if (file == null) { |
559 | + image.visible = false; |
560 | + return; |
561 | + } |
562 | + |
563 | + image.visible = true; |
564 | + image.content = yield BackgroundCache.get_default ().load_image (file, monitor, style); |
565 | + } |
566 | + |
567 | + void queue_update_animation () |
568 | + { |
569 | + if (update_animation_timeout_id != 0 || animation_duration == 0.0) |
570 | + return; |
571 | + |
572 | + var n_steps = 255 / ANIMATION_OPACITY_STEP_INCREMENT; |
573 | + var time_per_step = (uint)((animation_duration * 1000) / n_steps); |
574 | + var interval = uint.max ((uint)(ANIMATION_MIN_WAKEUP_INTERVAL * 1000), time_per_step); |
575 | + |
576 | + if (interval > uint.MAX) |
577 | + return; |
578 | + |
579 | + update_animation_timeout_id = Clutter.Threads.Timeout.add (interval, () => { |
580 | + update_animation_timeout_id = 0; |
581 | + update_animation.begin (); |
582 | + return false; |
583 | + }); |
584 | + } |
585 | + |
586 | + void update_animation_progress () |
587 | + { |
588 | + if (image_to != null) |
589 | + image_to.opacity = (uint)(animation_progress * 255); |
590 | + |
591 | + queue_update_animation (); |
592 | + } |
593 | + } |
594 | +#endif |
595 | +} |
596 | + |
597 | |
598 | === added file 'src/Background/SystemBackground.vala' |
599 | --- src/Background/SystemBackground.vala 1970-01-01 00:00:00 +0000 |
600 | +++ src/Background/SystemBackground.vala 2013-11-27 18:52:22 +0000 |
601 | @@ -0,0 +1,39 @@ |
602 | +// |
603 | +// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz |
604 | +// |
605 | +// This program is free software: you can redistribute it and/or modify |
606 | +// it under the terms of the GNU General Public License as published by |
607 | +// the Free Software Foundation, either version 3 of the License, or |
608 | +// (at your option) any later version. |
609 | +// |
610 | +// This program is distributed in the hope that it will be useful, |
611 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of |
612 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
613 | +// GNU General Public License for more details. |
614 | +// |
615 | +// You should have received a copy of the GNU General Public License |
616 | +// along with this program. If not, see <http://www.gnu.org/licenses/>. |
617 | +// |
618 | + |
619 | +namespace Gala |
620 | +{ |
621 | +#if HAS_MUTTER38 |
622 | + public class SystemBackground : Meta.BackgroundActor |
623 | + { |
624 | + public SystemBackground () |
625 | + { |
626 | + Object (); |
627 | + } |
628 | + |
629 | + construct |
630 | + { |
631 | + var cache = BackgroundCache.get_default (); |
632 | + cache.load_image.begin (Config.PKGDATADIR + "/texture.png", 0, |
633 | + GDesktop.BackgroundStyle.WALLPAPER, (obj, res) => { |
634 | + content = cache.load_image.end (res); |
635 | + }); |
636 | + } |
637 | + } |
638 | +#endif |
639 | +} |
640 | + |
641 | |
642 | === modified file 'src/Plugin.vala' |
643 | --- src/Plugin.vala 2013-09-28 22:17:35 +0000 |
644 | +++ src/Plugin.vala 2013-11-27 18:52:22 +0000 |
645 | @@ -51,8 +51,8 @@ |
646 | ScreenSaver? screensaver; |
647 | |
648 | #if HAS_MUTTER38 |
649 | - // FIXME we need a proper-sized background for every monitor |
650 | - public BackgroundActor wallpaper { get; private set; } |
651 | + public Meta.BackgroundGroup background_group { get; private set; } |
652 | + public Clutter.Actor ui_group { get; private set; } |
653 | #endif |
654 | |
655 | Window? moving; //place for the window that is being moved over |
656 | @@ -90,6 +90,9 @@ |
657 | var screen = get_screen (); |
658 | |
659 | DBus.init (this); |
660 | +#if HAS_MUTTER38 |
661 | + BackgroundCache.init (screen); |
662 | +#endif |
663 | |
664 | // Due to a bug which enables access to the stage when using multiple monitors |
665 | // in the screensaver, we have to listen for changes and make sure the input area |
666 | @@ -102,12 +105,41 @@ |
667 | |
668 | var stage = Compositor.get_stage_for_screen (screen) as Clutter.Stage; |
669 | |
670 | - string color = new Settings ("org.gnome.desktop.background").get_string ("primary-color"); |
671 | + var color = BackgroundSettings.get_default ().primary_color; |
672 | stage.background_color = Clutter.Color.from_string (color); |
673 | |
674 | if (Prefs.get_dynamic_workspaces ()) |
675 | screen.override_workspace_layout (ScreenCorner.TOPLEFT, false, 1, -1); |
676 | |
677 | +#if HAS_MUTTER38 |
678 | + /* our layer structure, copied from gnome-shell (from bottom to top): |
679 | + * stage |
680 | + * + system background |
681 | + * + ui group |
682 | + * +-- window group |
683 | + * +---- background manager |
684 | + * +-- shell elements |
685 | + * +-- top window group |
686 | + */ |
687 | + |
688 | + var system_background = new SystemBackground (); |
689 | + system_background.add_constraint (new Clutter.BindConstraint (stage, |
690 | + Clutter.BindCoordinate.ALL, 0)); |
691 | + stage.insert_child_below (system_background, null); |
692 | + |
693 | + ui_group = new Clutter.Actor (); |
694 | + ui_group.reactive = true; |
695 | + stage.add_child (ui_group); |
696 | + |
697 | + var window_group = Compositor.get_window_group_for_screen (screen); |
698 | + stage.remove_child (window_group); |
699 | + ui_group.add_child (window_group); |
700 | + |
701 | + background_group = new BackgroundManager (screen); |
702 | + window_group.add_child (background_group); |
703 | + window_group.set_child_below_sibling (background_group, null); |
704 | +#endif |
705 | + |
706 | workspace_view = new WorkspaceView (this); |
707 | workspace_view.visible = false; |
708 | |
709 | @@ -116,13 +148,18 @@ |
710 | zooming = new Zooming (this); |
711 | window_overview = new WindowOverview (this); |
712 | |
713 | +#if HAS_MUTTER38 |
714 | + ui_group.add_child (workspace_view); |
715 | + ui_group.add_child (winswitcher); |
716 | + ui_group.add_child (window_overview); |
717 | + |
718 | + var top_window_group = Compositor.get_top_window_group_for_screen (screen); |
719 | + stage.remove_child (top_window_group); |
720 | + ui_group.add_child (top_window_group); |
721 | +#else |
722 | stage.add_child (workspace_view); |
723 | stage.add_child (winswitcher); |
724 | stage.add_child (window_overview); |
725 | - |
726 | -#if HAS_MUTTER38 |
727 | - // FIXME create a background for every monitor and keep them updated and properly sized |
728 | - wallpaper = new BackgroundActor (); |
729 | #endif |
730 | |
731 | /*keybindings*/ |
732 | @@ -189,8 +226,15 @@ |
733 | workspace_view.show (true); |
734 | }); |
735 | |
736 | +#if HAS_MUTTER38 |
737 | + //FIXME we have to investigate this. Apparently alt-tab is now bound to switch-applications |
738 | + // instead of windows, which we should probably handle too |
739 | + KeyBinding.set_custom_handler ("switch-applications", winswitcher.handle_switch_windows); |
740 | + KeyBinding.set_custom_handler ("switch-applications-backward", winswitcher.handle_switch_windows); |
741 | +#else |
742 | KeyBinding.set_custom_handler ("switch-windows", winswitcher.handle_switch_windows); |
743 | KeyBinding.set_custom_handler ("switch-windows-backward", winswitcher.handle_switch_windows); |
744 | +#endif |
745 | |
746 | KeyBinding.set_custom_handler ("switch-to-workspace-up", () => {}); |
747 | KeyBinding.set_custom_handler ("switch-to-workspace-down", () => {}); |
748 | @@ -217,6 +261,9 @@ |
749 | |
750 | #if HAS_MUTTER38 |
751 | stage.show (); |
752 | + |
753 | + // let the session manager move to the next phase |
754 | + Meta.register_with_session (); |
755 | |
756 | return false; |
757 | #endif |
758 | @@ -281,7 +328,7 @@ |
759 | else |
760 | Utils.set_input_area (screen, InputArea.NONE); |
761 | } |
762 | - |
763 | + |
764 | public uint32[] get_all_xids () |
765 | { |
766 | var list = new Gee.ArrayList<uint32> (); |
767 | @@ -346,6 +393,10 @@ |
768 | #else |
769 | base.begin_modal (x_get_stage_window (Compositor.get_stage_for_screen (screen)), {}, 0, display.get_current_time ()); |
770 | #endif |
771 | + |
772 | +#if HAS_MUTTER38 |
773 | + Meta.Util.disable_unredirect_for_screen (screen); |
774 | +#endif |
775 | } |
776 | |
777 | public new void end_modal () |
778 | @@ -355,7 +406,12 @@ |
779 | return; |
780 | |
781 | update_input_area (); |
782 | - base.end_modal (get_screen ().get_display ().get_current_time ()); |
783 | + |
784 | + var screen = get_screen (); |
785 | + base.end_modal (screen.get_display ().get_current_time ()); |
786 | +#if HAS_MUTTER38 |
787 | + Meta.Util.enable_unredirect_for_screen (screen); |
788 | +#endif |
789 | } |
790 | |
791 | public void get_current_cursor_position (out int x, out int y) |
792 | @@ -786,7 +842,7 @@ |
793 | /*workspace switcher*/ |
794 | List<WindowActor>? win; |
795 | List<Clutter.Actor>? par; //class space for kill func |
796 | - List<Clutter.Clone>? clones; |
797 | + List<Clutter.Actor>? clones; |
798 | Clutter.Actor? in_group; |
799 | Clutter.Actor? out_group; |
800 | Clutter.Actor? moving_window_container; |
801 | @@ -834,6 +890,8 @@ |
802 | var group = Compositor.get_window_group_for_screen (screen); |
803 | #if !HAS_MUTTER38 |
804 | var wallpaper = Compositor.get_background_actor_for_screen (screen); |
805 | +#else |
806 | + var wallpaper = background_group; |
807 | #endif |
808 | |
809 | in_group = new Clutter.Actor (); |
810 | @@ -985,6 +1043,8 @@ |
811 | |
812 | #if !HAS_MUTTER38 |
813 | var wallpaper = Compositor.get_background_actor_for_screen (screen); |
814 | +#else |
815 | + var wallpaper = background_group; |
816 | #endif |
817 | wallpaper.detach_animation (); |
818 | wallpaper.x = 0.0f; |
819 | @@ -1003,6 +1063,15 @@ |
820 | { |
821 | return x_handle_event (event) != 0; |
822 | } |
823 | + |
824 | +#if HAS_MUTTER38 |
825 | + public override bool keybinding_filter (Meta.KeyBinding binding) |
826 | + { |
827 | + // for now we'll just block all keybindings if we're in modal mode, |
828 | + // do something useful with this later |
829 | + return modal_count > 0; |
830 | + } |
831 | +#endif |
832 | |
833 | public override unowned PluginInfo? plugin_info () |
834 | { |
835 | |
836 | === modified file 'src/Settings.vala' |
837 | --- src/Settings.vala 2013-02-10 14:01:15 +0000 |
838 | +++ src/Settings.vala 2013-11-27 18:52:22 +0000 |
839 | @@ -151,4 +151,29 @@ |
840 | return instance; |
841 | } |
842 | } |
843 | + |
844 | + public class BackgroundSettings : Granite.Services.Settings |
845 | + { |
846 | + public string picture_options { get; set; } |
847 | + public string picture_uri { get; set; } |
848 | + public int picture_opacity { get; set; } |
849 | + public string primary_color { get; set; } |
850 | + public string secondary_color { get; set; } |
851 | + public string color_shading_type { get; set; } |
852 | + |
853 | + static BackgroundSettings? instance = null; |
854 | + |
855 | + private BackgroundSettings () |
856 | + { |
857 | + base ("org.gnome.desktop.background"); |
858 | + } |
859 | + |
860 | + public static BackgroundSettings get_default () |
861 | + { |
862 | + if (instance == null) |
863 | + instance = new BackgroundSettings (); |
864 | + |
865 | + return instance; |
866 | + } |
867 | + } |
868 | } |
869 | |
870 | === modified file 'src/Widgets/WindowOverview.vala' |
871 | --- src/Widgets/WindowOverview.vala 2013-09-28 22:17:35 +0000 |
872 | +++ src/Widgets/WindowOverview.vala 2013-11-27 18:52:22 +0000 |
873 | @@ -578,12 +578,10 @@ |
874 | |
875 | screen.window_left_monitor.connect (window_left_monitor); |
876 | |
877 | -#if HAS_MUTTER38 |
878 | - plugin.wallpaper. |
879 | -#else |
880 | +#if !HAS_MUTTER38 |
881 | Compositor.get_background_actor_for_screen (screen). |
882 | -#endif |
883 | animate (AnimationMode.EASE_OUT_QUAD, 350, dim_factor : 0.6); |
884 | +#endif |
885 | |
886 | // sort windows by stacking order |
887 | var windows = screen.get_display ().sort_windows_by_stacking (used_windows); |
888 | @@ -693,7 +691,7 @@ |
889 | } else { |
890 | close (true); |
891 | //wait for the animation to finish before switching |
892 | - Timeout.add (400, () => { |
893 | + Clutter.Threads.Timeout.add (400, () => { |
894 | window.get_workspace ().activate_with_focus (window, screen.get_display ().get_current_time ()); |
895 | return false; |
896 | }); |
897 | @@ -722,15 +720,13 @@ |
898 | exposed.selected.disconnect (thumb_selected); |
899 | } |
900 | |
901 | -#if HAS_MUTTER38 |
902 | - plugin.wallpaper. |
903 | -#else |
904 | +#if !HAS_MUTTER38 |
905 | Compositor.get_background_actor_for_screen (screen). |
906 | -#endif |
907 | animate (AnimationMode.EASE_OUT_QUAD, 300, dim_factor : 1.0); |
908 | +#endif |
909 | |
910 | if (animate) { |
911 | - Timeout.add (300, () => { |
912 | + Clutter.Threads.Timeout.add (300, () => { |
913 | visible = false; |
914 | ready = true; |
915 | |
916 | |
917 | === modified file 'src/Widgets/WindowSwitcher.vala' |
918 | --- src/Widgets/WindowSwitcher.vala 2013-08-18 21:09:23 +0000 |
919 | +++ src/Widgets/WindowSwitcher.vala 2013-11-27 18:52:22 +0000 |
920 | @@ -220,6 +220,9 @@ |
921 | var prev_win = current_window; |
922 | if (action == Meta.KeyBindingAction.SWITCH_GROUP || |
923 | action == Meta.KeyBindingAction.SWITCH_WINDOWS || |
924 | +#if HAS_MUTTER38 |
925 | + action == Meta.KeyBindingAction.SWITCH_APPLICATIONS || |
926 | +#endif |
927 | event.get_key_symbol () == Clutter.Key.Right) { |
928 | |
929 | current_window = display.get_tab_next (Meta.TabList.NORMAL, screen, |
930 | @@ -228,6 +231,9 @@ |
931 | |
932 | } else if (action == Meta.KeyBindingAction.SWITCH_GROUP_BACKWARD || |
933 | action == Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD || |
934 | +#if HAS_MUTTER38 |
935 | + action == Meta.KeyBindingAction.SWITCH_APPLICATIONS_BACKWARD || |
936 | +#endif |
937 | event.get_key_symbol () == Clutter.Key.Left) { |
938 | |
939 | current_window = display.get_tab_next (Meta.TabList.NORMAL, screen, |
940 | @@ -255,7 +261,7 @@ |
941 | if (prev_window != current_window) { |
942 | dim_windows (); |
943 | // wait for the dimming to finish |
944 | - Timeout.add (250, () => { |
945 | + Clutter.Threads.Timeout.add (250, () => { |
946 | close (event.time); |
947 | return false; |
948 | }); |
949 | |
950 | === modified file 'src/Widgets/WindowThumb.vala' |
951 | --- src/Widgets/WindowThumb.vala 2013-08-27 06:22:58 +0000 |
952 | +++ src/Widgets/WindowThumb.vala 2013-11-27 18:52:22 +0000 |
953 | @@ -88,7 +88,7 @@ |
954 | window.delete (window.get_screen ().get_display ().get_current_time ()); |
955 | // see if the window is still alive after the animation ended. If it is, it's pretty certain that it |
956 | // popped up some kind of confirmation dialog, so we focus it |
957 | - Timeout.add (AnimationSettings.get_default ().close_duration + WAIT_FOR_CONFIRMATION_DIALOG, () => { |
958 | + Clutter.Threads.Timeout.add (AnimationSettings.get_default ().close_duration + WAIT_FOR_CONFIRMATION_DIALOG, () => { |
959 | if (clone != null && clone.source != null && !(clone.source as Meta.WindowActor).is_destroyed ()) { |
960 | clone.source.opacity = 255; |
961 | selected (window); |
962 | |
963 | === modified file 'src/Widgets/WorkspaceThumb.vala' |
964 | --- src/Widgets/WorkspaceThumb.vala 2013-08-09 12:52:20 +0000 |
965 | +++ src/Widgets/WorkspaceThumb.vala 2013-11-27 18:52:22 +0000 |
966 | @@ -50,6 +50,7 @@ |
967 | |
968 | #if HAS_MUTTER38 |
969 | internal Actor wallpaper; |
970 | + Actor wallpaper_manager; |
971 | #else |
972 | internal Clone wallpaper; |
973 | #endif |
974 | @@ -60,7 +61,11 @@ |
975 | |
976 | uint hover_timer = 0; |
977 | |
978 | +#if HAS_MUTTER38 |
979 | + public WorkspaceThumb (Workspace _workspace, Meta.BackgroundGroup _wallpaper) |
980 | +#else |
981 | public WorkspaceThumb (Workspace _workspace) |
982 | +#endif |
983 | { |
984 | workspace = _workspace; |
985 | screen = workspace.get_screen (); |
986 | @@ -89,9 +94,12 @@ |
987 | |
988 | handle_workspace_switched (-1, screen.get_active_workspace_index (), MotionDirection.LEFT); |
989 | |
990 | - // FIXME find a nice way to draw a border around it, maybe combinable with the indicator using a ShaderEffect |
991 | #if HAS_MUTTER38 |
992 | + wallpaper_manager = new BackgroundManager (screen); |
993 | + //FIXME apparently there are issues with scaling and animating the opacity. The wallpaper will |
994 | + // start flickering when the opacity changes. Wrapping it in a container solves this. |
995 | wallpaper = new Clutter.Actor (); |
996 | + wallpaper.add_child (wallpaper_manager); |
997 | #else |
998 | wallpaper = new Clone (Compositor.get_background_actor_for_screen (screen)); |
999 | #endif |
1000 | @@ -202,6 +210,10 @@ |
1001 | indicator.width = width + 2 * INDICATOR_BORDER; |
1002 | (indicator.content as Canvas).set_size ((int)indicator.width, (int)indicator.height); |
1003 | |
1004 | +#if HAS_MUTTER38 |
1005 | + wallpaper_manager.scale_x = width / swidth; |
1006 | + wallpaper_manager.scale_y = THUMBNAIL_HEIGHT / sheight; |
1007 | +#endif |
1008 | wallpaper.width = width; |
1009 | windows.width = width; |
1010 | |
1011 | @@ -270,7 +282,7 @@ |
1012 | window.delete (screen.get_display ().get_current_time ()); |
1013 | } |
1014 | |
1015 | - GLib.Timeout.add (250, () => { |
1016 | + Clutter.Threads.Timeout.add (250, () => { |
1017 | //wait for confirmation dialogs to popup |
1018 | if (Utils.get_n_windows (workspace) == 0) { |
1019 | workspace.window_added.disconnect (handle_window_added); |
1020 | @@ -486,7 +498,7 @@ |
1021 | return; |
1022 | |
1023 | // we need to wait untill the animation ended, otherwise we get trouble with focus handling |
1024 | - Timeout.add (AnimationSettings.get_default ().workspace_switch_duration + 10, () => { |
1025 | + Clutter.Threads.Timeout.add (AnimationSettings.get_default ().workspace_switch_duration + 10, () => { |
1026 | // check again, maybe something opened |
1027 | if (workspace == null || Utils.get_n_windows (workspace) > 0) |
1028 | return false; |
1029 | @@ -525,7 +537,7 @@ |
1030 | workspace.activate (screen.get_display ().get_current_time ()); |
1031 | |
1032 | // wait for the animation to be finished before closing, for aesthetic reasons |
1033 | - Timeout.add (AnimationSettings.get_default ().workspace_switch_duration, () => { |
1034 | + Clutter.Threads.Timeout.add (AnimationSettings.get_default ().workspace_switch_duration, () => { |
1035 | clicked (); |
1036 | return false; |
1037 | }); |
1038 | @@ -551,7 +563,7 @@ |
1039 | if (hover_timer > 0) |
1040 | GLib.Source.remove (hover_timer); |
1041 | |
1042 | - hover_timer = Timeout.add (CLOSE_BUTTON_DELAY, () => { |
1043 | + hover_timer = Clutter.Threads.Timeout.add (CLOSE_BUTTON_DELAY, () => { |
1044 | close_button.visible = true; |
1045 | close_button.animate (AnimationMode.EASE_OUT_ELASTIC, 400, scale_x : 1.0f, scale_y : 1.0f); |
1046 | return false; |
1047 | |
1048 | === modified file 'src/Widgets/WorkspaceView.vala' |
1049 | --- src/Widgets/WorkspaceView.vala 2013-08-03 11:15:11 +0000 |
1050 | +++ src/Widgets/WorkspaceView.vala 2013-11-27 18:52:22 +0000 |
1051 | @@ -29,7 +29,9 @@ |
1052 | |
1053 | Clutter.Actor thumbnails; |
1054 | Clutter.Actor scroll; |
1055 | +#if !HAS_MUTTER38 |
1056 | Clutter.Actor click_catcher; //invisible plane that catches clicks outside the view |
1057 | +#endif |
1058 | |
1059 | bool animating; // delay closing the popup |
1060 | |
1061 | @@ -67,6 +69,7 @@ |
1062 | scroll.content = new Clutter.Canvas (); |
1063 | (scroll.content as Clutter.Canvas).draw.connect (draw_scroll); |
1064 | |
1065 | +#if !HAS_MUTTER38 |
1066 | click_catcher = new Clutter.Actor (); |
1067 | click_catcher.reactive = true; |
1068 | click_catcher.button_release_event.connect ((e) => { |
1069 | @@ -74,6 +77,7 @@ |
1070 | return true; |
1071 | }); |
1072 | Compositor.get_stage_for_screen (screen).add_child (click_catcher); |
1073 | +#endif |
1074 | |
1075 | add_child (thumbnails); |
1076 | add_child (scroll); |
1077 | @@ -114,7 +118,11 @@ |
1078 | void init_thumbnails () |
1079 | { |
1080 | foreach (var workspace in screen.get_workspaces ()) { |
1081 | +#if HAS_MUTTER38 |
1082 | + var thumb = new WorkspaceThumb (workspace, plugin.background_group); |
1083 | +#else |
1084 | var thumb = new WorkspaceThumb (workspace); |
1085 | +#endif |
1086 | thumb.clicked.connect (hide); |
1087 | thumb.closed.connect (remove_workspace); |
1088 | thumb.window_on_last.connect (add_workspace); |
1089 | @@ -128,6 +136,14 @@ |
1090 | && Utils.get_n_windows (screen.get_workspaces ().first ().data) > 0) |
1091 | add_workspace (); |
1092 | } |
1093 | + |
1094 | +#if HAS_MUTTER38 |
1095 | + bool outside_clicked (Clutter.ButtonEvent event) |
1096 | + { |
1097 | + hide (); |
1098 | + return true; |
1099 | + } |
1100 | +#endif |
1101 | |
1102 | bool draw_background (Cairo.Context cr) |
1103 | { |
1104 | @@ -168,7 +184,11 @@ |
1105 | |
1106 | void create_workspace_thumb (Meta.Workspace workspace) |
1107 | { |
1108 | +#if HAS_MUTTER38 |
1109 | + var thumb = new WorkspaceThumb (workspace, plugin.background_group); |
1110 | +#else |
1111 | var thumb = new WorkspaceThumb (workspace); |
1112 | +#endif |
1113 | thumb.clicked.connect (hide); |
1114 | thumb.closed.connect (remove_workspace); |
1115 | thumb.window_on_last.connect (add_workspace); |
1116 | @@ -390,6 +410,10 @@ |
1117 | |
1118 | plugin.begin_modal (); |
1119 | |
1120 | +#if HAS_MUTTER38 |
1121 | + plugin.ui_group.button_release_event.connect (outside_clicked); |
1122 | +#endif |
1123 | + |
1124 | var area = screen.get_monitor_geometry (screen.get_primary_monitor ()); |
1125 | y = area.height + area.y; |
1126 | x = area.x; |
1127 | @@ -414,14 +438,16 @@ |
1128 | int swidth, sheight; |
1129 | screen.get_size (out swidth, out sheight); |
1130 | |
1131 | +#if !HAS_MUTTER38 |
1132 | click_catcher.width = swidth; |
1133 | click_catcher.height = sheight; |
1134 | click_catcher.x = 0; |
1135 | click_catcher.y = 0; |
1136 | click_catcher.visible = true; |
1137 | +#endif |
1138 | |
1139 | animating = true; |
1140 | - Timeout.add (50, () => { |
1141 | + Clutter.Threads.Timeout.add (50, () => { |
1142 | animating = false; |
1143 | return false; |
1144 | }); //catch hot corner hiding problem |
1145 | @@ -431,13 +457,17 @@ |
1146 | wins.x = 0.0f; |
1147 | |
1148 | animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : (area.height + area.y) - height); |
1149 | - wins.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : -height + 1); |
1150 | + wins.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : -height + 1.01f); |
1151 | } |
1152 | |
1153 | public new void hide () |
1154 | { |
1155 | if (!visible || animating) |
1156 | return; |
1157 | + |
1158 | +#if HAS_MUTTER38 |
1159 | + plugin.ui_group.button_release_event.disconnect (outside_clicked); |
1160 | +#endif |
1161 | |
1162 | float width, height; |
1163 | plugin.get_screen ().get_size (out width, out height); |
1164 | @@ -454,7 +484,9 @@ |
1165 | visible = false; |
1166 | }); |
1167 | |
1168 | +#if !HAS_MUTTER38 |
1169 | click_catcher.visible = false; |
1170 | +#endif |
1171 | |
1172 | var wins = Compositor.get_window_group_for_screen (screen); |
1173 | wins.detach_animation (); |
1174 | |
1175 | === modified file 'src/Zooming.vala' |
1176 | --- src/Zooming.vala 2012-08-28 15:49:58 +0000 |
1177 | +++ src/Zooming.vala 2013-11-27 18:52:22 +0000 |
1178 | @@ -67,7 +67,7 @@ |
1179 | wins.scale_center_x = mx; |
1180 | wins.scale_center_y = my; |
1181 | |
1182 | - mouse_poll_timer = Timeout.add (MOUSE_POLL_TIME, () => { |
1183 | + mouse_poll_timer = Clutter.Threads.Timeout.add (MOUSE_POLL_TIME, () => { |
1184 | client_pointer.get_position (null, out mx, out my); |
1185 | if (wins.scale_center_x == mx && wins.scale_center_y == my) |
1186 | return true; |
1187 | |
1188 | === modified file 'vapi/gdesktopenums-3.0.vapi' |
1189 | --- vapi/gdesktopenums-3.0.vapi 2012-08-19 13:56:07 +0000 |
1190 | +++ vapi/gdesktopenums-3.0.vapi 2013-11-27 18:52:22 +0000 |
1191 | @@ -34,6 +34,20 @@ |
1192 | SMART, |
1193 | STRICT |
1194 | } |
1195 | + [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_CARET_TRACKING_MODE_", has_type_id = false)] |
1196 | + public enum MagnifierCaretTrackingMode { |
1197 | + NONE, |
1198 | + CENTERED, |
1199 | + PROPORTIONAL, |
1200 | + PUSH |
1201 | + } |
1202 | + [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_FOCUS_TRACKING_MODE_", has_type_id = false)] |
1203 | + public enum MagnifierFocusTrackingMode { |
1204 | + NONE, |
1205 | + CENTERED, |
1206 | + PROPORTIONAL, |
1207 | + PUSH |
1208 | + } |
1209 | [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_MOUSE_TRACKING_MODE_", has_type_id = false)] |
1210 | public enum MagnifierMouseTrackingMode { |
1211 | NONE, |
1212 | |
1213 | === added file 'vapi/gnome-desktop-3.0.deps' |
1214 | --- vapi/gnome-desktop-3.0.deps 1970-01-01 00:00:00 +0000 |
1215 | +++ vapi/gnome-desktop-3.0.deps 2013-11-27 18:52:22 +0000 |
1216 | @@ -0,0 +1,7 @@ |
1217 | +atk |
1218 | +cairo |
1219 | +gio-2.0 |
1220 | +gdesktopenums-3.0 |
1221 | +gdk-pixbuf-2.0 |
1222 | +gdk-3.0 |
1223 | +gtk+-3.0 |
1224 | |
1225 | === added file 'vapi/gnome-desktop-3.0.vapi' |
1226 | --- vapi/gnome-desktop-3.0.vapi 1970-01-01 00:00:00 +0000 |
1227 | +++ vapi/gnome-desktop-3.0.vapi 2013-11-27 18:52:22 +0000 |
1228 | @@ -0,0 +1,310 @@ |
1229 | +/* gnome-desktop-3.0.vapi generated by vapigen, do not modify. */ |
1230 | + |
1231 | +[CCode (cprefix = "Gnome", gir_namespace = "GnomeDesktop", gir_version = "3.0", lower_case_cprefix = "gnome_")] |
1232 | +namespace Gnome { |
1233 | + namespace DesktopThumbnail { |
1234 | + [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] |
1235 | + public static bool has_uri (Gdk.Pixbuf pixbuf, string uri); |
1236 | + [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] |
1237 | + public static bool is_valid (Gdk.Pixbuf pixbuf, string uri, long mtime); |
1238 | + [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] |
1239 | + [Deprecated (since = "2.22")] |
1240 | + public static string md5 (string uri); |
1241 | + [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] |
1242 | + public static string path_for_uri (string uri, Gnome.DesktopThumbnailSize size); |
1243 | + [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")] |
1244 | + public static Gdk.Pixbuf scale_down_pixbuf (Gdk.Pixbuf pixbuf, int dest_width, int dest_height); |
1245 | + } |
1246 | + namespace Languages { |
1247 | + [CCode (array_length = false, array_null_terminated = true, cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_all_languages")] |
1248 | + public static string[] get_all_languages (); |
1249 | + [CCode (array_length = false, array_null_terminated = true, cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_all_locales")] |
1250 | + public static string[] get_all_locales (); |
1251 | + [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_country_from_code")] |
1252 | + public static string get_country_from_code (string code, string? translation); |
1253 | + [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_country_from_locale")] |
1254 | + public static string get_country_from_locale (string locale, string? translation); |
1255 | + [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_input_source_from_locale")] |
1256 | + public static bool get_input_source_from_locale (string locale, out unowned string type, out unowned string id); |
1257 | + [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_language_from_code")] |
1258 | + public static string get_language_from_code (string code, string? translation); |
1259 | + [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_language_from_locale")] |
1260 | + public static string get_language_from_locale (string locale, string? translation); |
1261 | + [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_language_has_translations")] |
1262 | + public static bool language_has_translations (string code); |
1263 | + [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_normalize_locale")] |
1264 | + public static string normalize_locale (string locale); |
1265 | + [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_parse_locale")] |
1266 | + public static bool parse_locale (string locale, out string language_codep, out string country_codep, out string codesetp, out string modifierp); |
1267 | + } |
1268 | + [CCode (cheader_filename = "libgnome-desktop/gnome-bg.h", type_id = "gnome_bg_get_type ()")] |
1269 | + public class BG : GLib.Object { |
1270 | + [CCode (has_construct_function = false)] |
1271 | + public BG (); |
1272 | + public bool changes_with_time (); |
1273 | + public Gdk.Pixbuf create_frame_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height, int frame_num); |
1274 | + public Cairo.Surface create_surface (Gdk.Window window, int width, int height, bool root); |
1275 | + public Gdk.Pixbuf create_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height); |
1276 | + public void draw (Gdk.Pixbuf dest, Gdk.Screen screen, bool is_root); |
1277 | + public void get_color (GDesktop.BackgroundShading type, Gdk.Color primary, Gdk.Color secondary); |
1278 | + public bool get_draw_background (); |
1279 | + public unowned string get_filename (); |
1280 | + public bool get_image_size (Gnome.DesktopThumbnailFactory factory, int best_width, int best_height, int width, int height); |
1281 | + public GDesktop.BackgroundStyle get_placement (); |
1282 | + public static Cairo.Surface get_surface_from_root (Gdk.Screen screen); |
1283 | + public bool has_multiple_sizes (); |
1284 | + public bool is_dark (int dest_width, int dest_height); |
1285 | + public void load_from_preferences (GLib.Settings settings); |
1286 | + public void save_to_preferences (GLib.Settings settings); |
1287 | + public void set_color (GDesktop.BackgroundShading type, Gdk.Color primary, Gdk.Color secondary); |
1288 | + public void set_draw_background (bool draw_background); |
1289 | + public void set_filename (string filename); |
1290 | + public void set_placement (GDesktop.BackgroundStyle placement); |
1291 | + public static void set_surface_as_root (Gdk.Screen screen, Cairo.Surface surface); |
1292 | + public static Gnome.BGCrossfade set_surface_as_root_with_crossfade (Gdk.Screen screen, Cairo.Surface surface); |
1293 | + public signal void changed (); |
1294 | + public signal void transitioned (); |
1295 | + } |
1296 | + [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h", type_id = "gnome_bg_crossfade_get_type ()")] |
1297 | + public class BGCrossfade : GLib.Object { |
1298 | + [CCode (has_construct_function = false)] |
1299 | + public BGCrossfade (int width, int height); |
1300 | + public bool is_started (); |
1301 | + public bool set_end_surface (Cairo.Surface surface); |
1302 | + public bool set_start_surface (Cairo.Surface surface); |
1303 | + public void start (Gdk.Window window); |
1304 | + public void stop (); |
1305 | + [NoAccessorMethod] |
1306 | + public int height { get; construct; } |
1307 | + [NoAccessorMethod] |
1308 | + public int width { get; construct; } |
1309 | + public virtual signal void finished (GLib.Object window); |
1310 | + } |
1311 | + [CCode (cheader_filename = "libgnome-desktop/gnome-bg-slide-show.h", type_id = "gnome_bg_slide_show_get_type ()")] |
1312 | + public class BGSlideShow : GLib.Object { |
1313 | + [CCode (has_construct_function = false)] |
1314 | + public BGSlideShow (string filename); |
1315 | + public void get_current_slide (int width, int height, out double progress, out double duration, out bool is_fixed, out unowned string file1, out unowned string file2); |
1316 | + public bool get_has_multiple_sizes (); |
1317 | + public int get_num_slides (); |
1318 | + public bool get_slide (int frame_number, int width, int height, double progress, out double duration, out bool is_fixed, out unowned string file1, out unowned string file2); |
1319 | + public double get_start_time (); |
1320 | + public double get_total_duration (); |
1321 | + public bool load () throws GLib.Error; |
1322 | + public void load_async (GLib.Cancellable? cancellable, GLib.AsyncReadyCallback callback); |
1323 | + [NoAccessorMethod] |
1324 | + public string filename { owned get; construct; } |
1325 | + public bool has_multiple_sizes { get; } |
1326 | + public double start_time { get; } |
1327 | + public double total_duration { get; } |
1328 | + } |
1329 | + [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h", type_id = "gnome_desktop_thumbnail_factory_get_type ()")] |
1330 | + public class DesktopThumbnailFactory : GLib.Object { |
1331 | + [CCode (has_construct_function = false)] |
1332 | + public DesktopThumbnailFactory (Gnome.DesktopThumbnailSize size); |
1333 | + public bool can_thumbnail (string uri, string mime_type, long mtime); |
1334 | + public void create_failed_thumbnail (string uri, long mtime); |
1335 | + public Gdk.Pixbuf generate_thumbnail (string uri, string mime_type); |
1336 | + public bool has_valid_failed_thumbnail (string uri, long mtime); |
1337 | + public string lookup (string uri, long mtime); |
1338 | + public void save_thumbnail (Gdk.Pixbuf thumbnail, string uri, long original_mtime); |
1339 | + } |
1340 | + [CCode (cheader_filename = "libgnome-desktop/gnome-idle-monitor.h", type_id = "gnome_idle_monitor_get_type ()")] |
1341 | + public class IdleMonitor : GLib.Object, GLib.Initable { |
1342 | + [CCode (has_construct_function = false)] |
1343 | + public IdleMonitor (); |
1344 | + public uint add_idle_watch (uint64 interval_msec, owned Gnome.IdleMonitorWatchFunc? callback); |
1345 | + public uint add_user_active_watch (owned Gnome.IdleMonitorWatchFunc? callback); |
1346 | + [CCode (has_construct_function = false)] |
1347 | + public IdleMonitor.for_device (Gdk.Device device) throws GLib.Error; |
1348 | + public uint64 get_idletime (); |
1349 | + public void remove_watch (uint id); |
1350 | + [NoAccessorMethod] |
1351 | + public Gdk.Device device { owned get; construct; } |
1352 | + } |
1353 | + [CCode (cheader_filename = "libgnome-desktop/gnome-pnp-ids.h", type_id = "gnome_pnp_ids_get_type ()")] |
1354 | + public class PnpIds : GLib.Object { |
1355 | + [CCode (has_construct_function = false)] |
1356 | + public PnpIds (); |
1357 | + public string get_pnp_id (string pnp_id); |
1358 | + } |
1359 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr-config.h", type_id = "gnome_rr_config_get_type ()")] |
1360 | + public class RRConfig : GLib.Object { |
1361 | + [CCode (has_construct_function = false)] |
1362 | + protected RRConfig (); |
1363 | + public bool applicable (Gnome.RRScreen screen) throws GLib.Error; |
1364 | + public bool apply (Gnome.RRScreen screen) throws GLib.Error; |
1365 | + public bool apply_persistent (Gnome.RRScreen screen) throws GLib.Error; |
1366 | + [CCode (has_construct_function = false)] |
1367 | + public RRConfig.current (Gnome.RRScreen screen) throws GLib.Error; |
1368 | + public bool ensure_primary (); |
1369 | + public bool equal (Gnome.RRConfig config2); |
1370 | + public bool get_clone (); |
1371 | + [CCode (array_length = false, array_null_terminated = true)] |
1372 | + public unowned Gnome.RROutputInfo[] get_outputs (); |
1373 | + public bool load_current () throws GLib.Error; |
1374 | + public bool match (Gnome.RRConfig config2); |
1375 | + public void sanitize (); |
1376 | + public void set_clone (bool clone); |
1377 | + public Gnome.RRScreen screen { construct; } |
1378 | + } |
1379 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gnome_rr_crtc_get_type ()")] |
1380 | + [Compact] |
1381 | + public class RRCrtc { |
1382 | + public bool can_drive_output (Gnome.RROutput output); |
1383 | + public Gnome.RRMode get_current_mode (); |
1384 | + public Gnome.RRRotation get_current_rotation (); |
1385 | + public bool get_gamma (int size, ushort red, ushort green, ushort blue); |
1386 | + public uint32 get_id (); |
1387 | + public void get_position (out int x, out int y); |
1388 | + public Gnome.RRRotation get_rotations (); |
1389 | + public bool set_gamma (int size, ushort red, ushort green, ushort blue); |
1390 | + public bool supports_rotation (Gnome.RRRotation rotation); |
1391 | + } |
1392 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gnome_rr_mode_get_type ()")] |
1393 | + [Compact] |
1394 | + public class RRMode { |
1395 | + public int get_freq (); |
1396 | + public uint get_height (); |
1397 | + public uint32 get_id (); |
1398 | + public uint get_width (); |
1399 | + } |
1400 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "gnome_rr_output_get_type ()")] |
1401 | + [Compact] |
1402 | + public class RROutput { |
1403 | + public bool can_clone (Gnome.RROutput clone); |
1404 | + public int get_backlight (); |
1405 | + public Gnome.RRCrtc get_crtc (); |
1406 | + public Gnome.RRMode get_current_mode (); |
1407 | + public unowned string get_display_name (); |
1408 | + public uint8 get_edid_data (size_t size); |
1409 | + public uint32 get_id (); |
1410 | + public void get_ids_from_edid (out string vendor, out string product, out string serial); |
1411 | + public bool get_is_primary (); |
1412 | + public unowned string get_name (); |
1413 | + public void get_physical_size (out int width_mm, out int height_mm); |
1414 | + public void get_position (out int x, out int y); |
1415 | + public Gnome.RRCrtc get_possible_crtcs (); |
1416 | + public Gnome.RRMode get_preferred_mode (); |
1417 | + public bool is_builtin_display (); |
1418 | + public Gnome.RRMode list_modes (); |
1419 | + public bool set_backlight (int value) throws GLib.Error; |
1420 | + public bool supports_mode (Gnome.RRMode mode); |
1421 | + } |
1422 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr-config.h", type_id = "gnome_rr_output_info_get_type ()")] |
1423 | + public class RROutputInfo : GLib.Object { |
1424 | + [CCode (has_construct_function = false)] |
1425 | + protected RROutputInfo (); |
1426 | + public double get_aspect_ratio (); |
1427 | + public unowned string get_display_name (); |
1428 | + public void get_geometry (out int x, out int y, out int width, out int height); |
1429 | + public unowned string get_name (); |
1430 | + public int get_preferred_height (); |
1431 | + public int get_preferred_width (); |
1432 | + public bool get_primary (); |
1433 | + public unowned string get_product (); |
1434 | + public int get_refresh_rate (); |
1435 | + public Gnome.RRRotation get_rotation (); |
1436 | + public unowned string get_serial (); |
1437 | + public unowned string get_vendor (); |
1438 | + public bool is_active (); |
1439 | + public bool is_connected (); |
1440 | + public void set_active (bool active); |
1441 | + public void set_geometry (int x, int y, int width, int height); |
1442 | + public void set_primary (bool primary); |
1443 | + public void set_refresh_rate (int rate); |
1444 | + public void set_rotation (Gnome.RRRotation rotation); |
1445 | + } |
1446 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", type_id = "gnome_rr_screen_get_type ()")] |
1447 | + public class RRScreen : GLib.Object, GLib.AsyncInitable, GLib.Initable { |
1448 | + [CCode (has_construct_function = false)] |
1449 | + public RRScreen (Gdk.Screen screen) throws GLib.Error; |
1450 | + public Gnome.RRMode create_clone_modes (); |
1451 | + [CCode (cname = "gnome_rr_screen_new_async", has_construct_function = false)] |
1452 | + public async RRScreen.from_async (Gdk.Screen screen) throws GLib.Error; |
1453 | + public unowned Gnome.RRCrtc get_crtc_by_id (uint32 id); |
1454 | + public bool get_dpms_mode (out Gnome.RRDpmsMode mode) throws GLib.Error; |
1455 | + public unowned Gnome.RROutput get_output_by_id (uint32 id); |
1456 | + public unowned Gnome.RROutput get_output_by_name (string name); |
1457 | + public void get_ranges (out int min_width, out int max_width, out int min_height, out int max_height); |
1458 | + [CCode (array_length = false, array_null_terminated = true)] |
1459 | + public unowned Gnome.RRMode[] list_clone_modes (); |
1460 | + [CCode (array_length = false, array_null_terminated = true)] |
1461 | + public unowned Gnome.RRCrtc[] list_crtcs (); |
1462 | + [CCode (array_length = false, array_null_terminated = true)] |
1463 | + public unowned Gnome.RRMode[] list_modes (); |
1464 | + [CCode (array_length = false, array_null_terminated = true)] |
1465 | + public unowned Gnome.RROutput[] list_outputs (); |
1466 | + public bool refresh () throws GLib.Error; |
1467 | + public bool set_dpms_mode (Gnome.RRDpmsMode mode) throws GLib.Error; |
1468 | + [NoAccessorMethod] |
1469 | + public Gdk.Screen gdk_screen { owned get; construct; } |
1470 | + public virtual signal void changed (); |
1471 | + public virtual signal void output_connected (void* output); |
1472 | + public virtual signal void output_disconnected (void* output); |
1473 | + } |
1474 | + [CCode (cheader_filename = "libgnome-desktop/gnome-wall-clock.h", type_id = "gnome_wall_clock_get_type ()")] |
1475 | + public class WallClock : GLib.Object { |
1476 | + [CCode (has_construct_function = false)] |
1477 | + public WallClock (); |
1478 | + public unowned string get_clock (); |
1479 | + public unowned GLib.TimeZone get_timezone (); |
1480 | + public string clock { get; } |
1481 | + [NoAccessorMethod] |
1482 | + public bool time_only { get; set; } |
1483 | + public GLib.TimeZone timezone { get; } |
1484 | + } |
1485 | + [CCode (cheader_filename = "libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_xkb_info_get_type ()")] |
1486 | + public class XkbInfo : GLib.Object { |
1487 | + [CCode (has_construct_function = false)] |
1488 | + public XkbInfo (); |
1489 | + public unowned string description_for_group (string group_id); |
1490 | + public unowned string description_for_option (string group_id, string id); |
1491 | + public GLib.List<weak string> get_all_layouts (); |
1492 | + public GLib.List<weak string> get_all_option_groups (); |
1493 | + public bool get_layout_info (string id, out unowned string display_name, out unowned string short_name, out unowned string xkb_layout, out unowned string xkb_variant); |
1494 | + public GLib.List<weak string> get_layouts_for_country (string country_code); |
1495 | + public GLib.List<weak string> get_layouts_for_language (string language_code); |
1496 | + public GLib.List<weak string> get_options_for_group (string group_id); |
1497 | + } |
1498 | + [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h", cprefix = "GNOME_DESKTOP_THUMBNAIL_SIZE_", has_type_id = false)] |
1499 | + public enum DesktopThumbnailSize { |
1500 | + NORMAL, |
1501 | + LARGE |
1502 | + } |
1503 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cprefix = "GNOME_RR_DPMS_", has_type_id = false)] |
1504 | + public enum RRDpmsMode { |
1505 | + ON, |
1506 | + STANDBY, |
1507 | + SUSPEND, |
1508 | + OFF, |
1509 | + DISABLED, |
1510 | + UNKNOWN |
1511 | + } |
1512 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cprefix = "GNOME_RR_", has_type_id = false)] |
1513 | + [Flags] |
1514 | + public enum RRRotation { |
1515 | + ROTATION_NEXT, |
1516 | + ROTATION_0, |
1517 | + ROTATION_90, |
1518 | + ROTATION_180, |
1519 | + ROTATION_270, |
1520 | + REFLECT_X, |
1521 | + REFLECT_Y |
1522 | + } |
1523 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cprefix = "GNOME_RR_ERROR_")] |
1524 | + public errordomain RRError { |
1525 | + UNKNOWN, |
1526 | + NO_RANDR_EXTENSION, |
1527 | + RANDR_ERROR, |
1528 | + BOUNDS_ERROR, |
1529 | + CRTC_ASSIGNMENT, |
1530 | + NO_MATCHING_CONFIG, |
1531 | + NO_DPMS_EXTENSION; |
1532 | + public static GLib.Quark quark (); |
1533 | + } |
1534 | + [CCode (cheader_filename = "libgnome-desktop/gnome-idle-monitor.h", instance_pos = 2.9)] |
1535 | + public delegate void IdleMonitorWatchFunc (Gnome.IdleMonitor monitor, uint id); |
1536 | + [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cname = "GNOME_RR_CONNECTOR_TYPE_PANEL")] |
1537 | + public const string RR_CONNECTOR_TYPE_PANEL; |
1538 | +} |
Two obvious issues (running with mutter 3.10.0.1+):
- workspace-switcher is not drawn and not functioning
- CSD windows have black-borders in window-overview (non-transparent native shadows?)