Merge lp:~gala-dev/gala/mutter38 into lp:gala

Proposed by Rico Tzschichholz
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
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"

To post a comment you must log in.
Revision history for this message
Rico Tzschichholz (ricotz) wrote :

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?)

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

It appears to be running without problems for me now with libmutter 3.10.1.1-0ubuntu1~saucy1, so I'll ask for a review and testers again. Please disregard the grey flickering on the wallpapers though, that's a problem that most likely has to be fixed in libmutter or, if that's not possible, with some trickery on our side. The rest should be working as it did in luna again. Please tell me if any component doesn't.

lp:~gala-dev/gala/mutter38 updated
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-contstruction

377. By Tom Beckmann

fix wallpaper on second monitor being moved away, fix cache to actually enable waiting for a loading texture

Revision history for this message
Cody Garver (codygarver) wrote :

I think

add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DGNOME_DESKTOP_USE_UNSTABLE_API)

should become

add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
add_definitions(-DGNOME_DESKTOP_USE_UNSTABLE_API)

Maybe with some comments above the lines

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

> I think
>
> add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"
> -DGNOME_DESKTOP_USE_UNSTABLE_API)
>
> should become
>
> add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
> add_definitions(-DGNOME_DESKTOP_USE_UNSTABLE_API)
>
> Maybe with some comments above the lines

This is not needed. They would have called it "add_definition" then ;)

Revision history for this message
Cody Garver (codygarver) :
review: Approve
lp:~gala-dev/gala/mutter38 updated
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

Revision history for this message
Cody Garver (codygarver) wrote :

I get this when I unplug from external display: http://imageshack.us/a/img197/4814/i5yq.png

review: Needs Fixing
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Cody Garver (codygarver) wrote :

I am unable to reproduce my problem on a fresh install

review: Approve
lp:~gala-dev/gala/mutter38 updated
386. By Rico Tzschichholz

Use MT-safe Clutter.Threads.Timeout.add () instead of GLib.Timeout.add ()

Revision history for this message
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.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-11-16 16:18:45 +0000
+++ CMakeLists.txt 2013-11-27 18:52:22 +0000
@@ -31,10 +31,10 @@
31list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)31list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
3232
33configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala)33configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala)
34add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")34add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\" -DGNOME_DESKTOP_USE_UNSTABLE_API -w)
3535
36find_package(PkgConfig)36find_package(PkgConfig)
37pkg_check_modules(DEPS REQUIRED libmutter>=3.4 granite clutter-1.0>=1.9.16 clutter-gtk-1.0 libbamf3 xfixes gee-1.0 plank)37pkg_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)
3838
39set (MUTTER36_FLAGS "")39set (MUTTER36_FLAGS "")
40pkg_check_modules(MUTTER36 QUIET libmutter>=3.5)40pkg_check_modules(MUTTER36 QUIET libmutter>=3.5)
@@ -84,6 +84,11 @@
84 src/TextShadowEffect.vala84 src/TextShadowEffect.vala
85 src/Utils.vala85 src/Utils.vala
86 src/Zooming.vala86 src/Zooming.vala
87 src/Background/Background.vala
88 src/Background/BackgroundCache.vala
89 src/Background/BackgroundManager.vala
90 src/Background/SlideShow.vala
91 src/Background/SystemBackground.vala
87 src/Widgets/AppIcon.vala92 src/Widgets/AppIcon.vala
88 src/Widgets/WindowOverview.vala93 src/Widgets/WindowOverview.vala
89 src/Widgets/WindowSwitcher.vala94 src/Widgets/WindowSwitcher.vala
@@ -99,6 +104,7 @@
99 clutter-gtk-1.0104 clutter-gtk-1.0
100 gdk-x11-3.0105 gdk-x11-3.0
101 gdesktopenums-3.0106 gdesktopenums-3.0
107 gnome-desktop-3.0
102 xfixes-4.0108 xfixes-4.0
103OPTIONS109OPTIONS
104 -g110 -g
105111
=== modified file 'data/texture.png'
106Binary files data/texture.png 2013-02-17 00:38:16 +0000 and data/texture.png 2013-11-27 18:52:22 +0000 differ112Binary files data/texture.png 2013-02-17 00:38:16 +0000 and data/texture.png 2013-11-27 18:52:22 +0000 differ
=== added directory 'src/Background'
=== added file 'src/Background/Background.vala'
--- src/Background/Background.vala 1970-01-01 00:00:00 +0000
+++ src/Background/Background.vala 2013-11-27 18:52:22 +0000
@@ -0,0 +1,194 @@
1//
2// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17
18namespace Gala
19{
20#if HAS_MUTTER38
21 /**
22 * Group that holds a pattern at the very bottom and then an image showing the
23 * current wallpaper above (and one more additional image for transitions).
24 * It listens to changes on the provided settings object and updates accordingly.
25 */
26 public class Background : Meta.BackgroundGroup
27 {
28 const uint ANIMATION_TRANSITION_DURATION = 1500;
29
30 public Meta.Screen screen { get; construct; }
31 public int monitor { get; construct; }
32 public Settings settings { get; construct; }
33
34 Meta.BackgroundActor pattern;
35 Clutter.Actor? image = null;
36
37 public Background (Meta.Screen screen, int monitor, Settings settings)
38 {
39 Object (screen: screen, monitor: monitor, settings: settings);
40 }
41
42 construct
43 {
44 pattern = new Meta.BackgroundActor ();
45 pattern.add_constraint (new Clutter.BindConstraint (this, Clutter.BindCoordinate.SIZE, 0));
46 add_child (pattern);
47
48 load (null);
49
50 settings.changed.connect (load);
51 }
52
53 ~Background ()
54 {
55 settings.changed.disconnect (load);
56 }
57
58 /**
59 * (Re)loads all components if key_changed is null or only the key_changed component
60 */
61 void load (string? key_changed)
62 {
63 var all = key_changed == null;
64 var cache = BackgroundCache.get_default ();
65
66 // update images
67 if (all || key_changed == "picture-uri" || key_changed == "picture-options") {
68 var style = style_string_to_enum (settings.get_string ("picture-options"));
69 var uri = settings.get_string ("picture-uri");
70
71 string filename;
72 if (GLib.Uri.parse_scheme (uri) != null)
73 filename = File.new_for_uri (uri).get_path ();
74 else
75 filename = uri;
76
77 // no image at all or malformed picture-uri
78 if (filename == null || filename == "" || style == GDesktop.BackgroundStyle.NONE) {
79 set_current (null);
80 // animation
81 } else if (filename.has_suffix (".xml")) {
82 var slides = new SlideShow (filename, screen, 0, style);
83
84 slides.load.begin ((obj, res) => {
85 if (!slides.load.end (res))
86 set_current (null);
87 else
88 set_current (slides);
89 });
90 // normal wallpaper
91 } else {
92 cache.load_image.begin (filename, monitor, style, (obj, res) => {
93 var content = cache.load_image.end (res);
94 if (content == null) {
95 set_current (null);
96 return;
97 }
98
99 var new_image = new Meta.BackgroundActor ();
100 new_image.content = content;
101 set_current (new_image);
102 });
103 }
104 }
105
106 // update image opacity
107 if (all || key_changed == "picture-opacity") {
108 if (image != null)
109 image.opacity = (uint8)(settings.get_int ("picture-opacity") / 100.0 * 255);
110 }
111
112 // update pattern
113 if (all
114 || key_changed == "primary-color"
115 || key_changed == "secondary-color"
116 || key_changed == "color-shading-type") {
117 var primary_color = Clutter.Color.from_string (settings.get_string ("primary-color"));
118 var secondary_color = Clutter.Color.from_string (settings.get_string ("secondary-color"));
119 var shading_type = shading_string_to_enum (settings.get_string ("color-shading-type"));
120 pattern.content = cache.load_pattern (monitor, primary_color, secondary_color, shading_type);
121 }
122 }
123
124 /**
125 * Fade a new image over the old, then destroy the old one and replace it with the new one
126 * if new_image is null, fade out and destroy the current image to show the pattern
127 */
128 void set_current (Clutter.Actor? new_image)
129 {
130 if (new_image == null) {
131 if (image != null)
132 image.animate (Clutter.AnimationMode.EASE_OUT_QUAD, ANIMATION_TRANSITION_DURATION,
133 opacity: 0).completed.connect (() => {
134 image.destroy ();
135 });
136 return;
137 }
138
139 new_image.opacity = 0;
140 new_image.add_constraint (new Clutter.BindConstraint (this, Clutter.BindCoordinate.SIZE, 0));
141 insert_child_above (new_image, null);
142
143 var dest_opacity = (uint8)(settings.get_int ("picture-opacity") / 100.0 * 255);
144 new_image.animate (Clutter.AnimationMode.EASE_OUT_QUAD, ANIMATION_TRANSITION_DURATION,
145 opacity: dest_opacity).completed.connect (() => {
146 if (image != null)
147 image.destroy ();
148 image = new_image;
149 });
150 }
151
152 /**
153 * translates the string returned from gsettings for the color-shading-type key to the
154 * appropriate GDesktop.BackgroundShading enum value
155 */
156 static GDesktop.BackgroundShading shading_string_to_enum (string shading)
157 {
158 switch (shading) {
159 case "horizontal":
160 return GDesktop.BackgroundShading.HORIZONTAL;
161 case "vertical":
162 return GDesktop.BackgroundShading.VERTICAL;
163 }
164
165 return GDesktop.BackgroundShading.SOLID;
166 }
167
168 /**
169 * translates the string returned from gsettings for the picture-options key to the
170 * appropriate GDesktop.BackgroundStyle enum value
171 */
172 static GDesktop.BackgroundStyle style_string_to_enum (string style)
173 {
174 switch (style) {
175 case "wallpaper":
176 return GDesktop.BackgroundStyle.WALLPAPER;
177 case "centered":
178 return GDesktop.BackgroundStyle.CENTERED;
179 case "scaled":
180 return GDesktop.BackgroundStyle.SCALED;
181 case "stretched":
182 return GDesktop.BackgroundStyle.STRETCHED;
183 case "zoom":
184 return GDesktop.BackgroundStyle.ZOOM;
185 case "spanned":
186 return GDesktop.BackgroundStyle.SPANNED;
187 }
188
189 return GDesktop.BackgroundStyle.NONE;
190 }
191 }
192#endif
193}
194
0195
=== added file 'src/Background/BackgroundCache.vala'
--- src/Background/BackgroundCache.vala 1970-01-01 00:00:00 +0000
+++ src/Background/BackgroundCache.vala 2013-11-27 18:52:22 +0000
@@ -0,0 +1,119 @@
1//
2// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17
18namespace Gala
19{
20#if HAS_MUTTER38
21 public class BackgroundCache : Object
22 {
23 struct WaitingCallback
24 {
25 SourceFunc func;
26 string hash;
27 }
28
29 static BackgroundCache? instance = null;
30
31 public static void init (Meta.Screen screen)
32 {
33 instance = new BackgroundCache (screen);
34 }
35
36 public static BackgroundCache get_default ()
37 requires (instance != null)
38 {
39 return instance;
40 }
41
42 public Meta.Screen screen { get; construct; }
43
44 Gee.HashMap<string,Meta.Background> image_cache;
45 Gee.HashMap<string,Meta.Background> pattern_cache;
46 Gee.LinkedList<WaitingCallback?> waiting_callbacks;
47
48 BackgroundCache (Meta.Screen screen)
49 {
50 Object (screen: screen);
51 }
52
53 construct
54 {
55 image_cache = new Gee.HashMap<string,Meta.Background> ();
56 pattern_cache = new Gee.HashMap<string,Meta.Background> ();
57 waiting_callbacks = new Gee.LinkedList<WaitingCallback?> ();
58 }
59
60 public async Meta.Background? load_image (string file, int monitor,
61 GDesktop.BackgroundStyle style)
62 {
63 string hash = "%s#%i".printf (file, style);
64 Meta.Background? content = image_cache.get (hash);
65
66 if (content != null) {
67 // the content has been created, but the file is still loading, so we wait
68 if (content.get_filename () == null) {
69 waiting_callbacks.add ({ load_image.callback, hash });
70 yield;
71 }
72
73 return content.copy (monitor, Meta.BackgroundEffects.NONE);
74 }
75
76 content = new Meta.Background (screen, monitor, Meta.BackgroundEffects.NONE);
77
78 image_cache.set (hash, content);
79
80 try {
81 yield content.load_file_async (file, style, null);
82 } catch (Error e) {
83 warning (e.message);
84 return null;
85 }
86
87 foreach (var callback in waiting_callbacks) {
88 if (callback.hash == hash) {
89 callback.func ();
90 waiting_callbacks.remove (callback);
91 }
92 }
93
94 return content;
95 }
96
97 public Meta.Background load_pattern (int monitor, Clutter.Color primary, Clutter.Color secondary,
98 GDesktop.BackgroundShading shading_type)
99 {
100 string hash = "%s#%s#%i".printf (primary.to_string (), secondary.to_string (), shading_type);
101 Meta.Background? content = pattern_cache.get (hash);
102
103 if (content != null)
104 return content.copy (monitor, Meta.BackgroundEffects.NONE);
105
106 content = new Meta.Background (screen, monitor, Meta.BackgroundEffects.NONE);
107 if (shading_type == GDesktop.BackgroundShading.SOLID)
108 content.load_color (primary);
109 else
110 content.load_gradient (shading_type, primary, secondary);
111
112 pattern_cache.set (hash, content);
113
114 return content;
115 }
116 }
117#endif
118}
119
0120
=== added file 'src/Background/BackgroundManager.vala'
--- src/Background/BackgroundManager.vala 1970-01-01 00:00:00 +0000
+++ src/Background/BackgroundManager.vala 2013-11-27 18:52:22 +0000
@@ -0,0 +1,61 @@
1//
2// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17
18namespace Gala
19{
20#if HAS_MUTTER38
21 public class BackgroundManager : Meta.BackgroundGroup
22 {
23 public Meta.Screen screen { get; construct; }
24
25 public BackgroundManager (Meta.Screen screen)
26 {
27 Object (screen: screen);
28 }
29
30 construct
31 {
32 screen.monitors_changed.connect (update);
33
34 update ();
35 }
36
37 ~BackgroundManager ()
38 {
39 screen.monitors_changed.disconnect (update);
40 }
41
42 void update ()
43 {
44 remove_all_children ();
45
46 var settings = BackgroundSettings.get_default ().schema;
47
48 for (var i = 0; i < screen.get_n_monitors (); i++) {
49 var geom = screen.get_monitor_geometry (i);
50 var background = new Background (screen, i, settings);
51
52 background.set_position (geom.x, geom.y);
53 background.set_size (geom.width, geom.height);
54
55 add_child (background);
56 }
57 }
58 }
59#endif
60}
61
062
=== added file 'src/Background/SlideShow.vala'
--- src/Background/SlideShow.vala 1970-01-01 00:00:00 +0000
+++ src/Background/SlideShow.vala 2013-11-27 18:52:22 +0000
@@ -0,0 +1,163 @@
1//
2// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17
18namespace Gala
19{
20#if HAS_MUTTER38
21 public class SlideShow : Meta.BackgroundGroup
22 {
23 const double ANIMATION_OPACITY_STEP_INCREMENT = 4.0;
24 const double ANIMATION_MIN_WAKEUP_INTERVAL = 1.0;
25
26 public string file { get; construct set; }
27 public Meta.Screen screen { get; construct set; }
28 public int monitor { get; construct set; }
29 public GDesktop.BackgroundStyle style { get; construct set; }
30
31 Gnome.BGSlideShow? animation = null;
32
33 double animation_duration = 0.0;
34 double animation_progress = 0.0;
35
36 uint update_animation_timeout_id;
37
38 Meta.BackgroundActor image_from;
39 Meta.BackgroundActor image_to;
40
41 public SlideShow (string file, Meta.Screen screen, int monitor, GDesktop.BackgroundStyle style)
42 {
43 Object (file: file, screen: screen, monitor: monitor, style: style);
44 }
45
46 construct
47 {
48 var geom = screen.get_monitor_geometry (monitor);
49 width = geom.width;
50 height = geom.height;
51
52 image_to = new Meta.BackgroundActor ();
53 image_from = new Meta.BackgroundActor ();
54
55 add_child (image_from);
56 add_child (image_to);
57 }
58
59 ~SlideShow ()
60 {
61 if (update_animation_timeout_id > 0)
62 Source.remove (update_animation_timeout_id);
63 }
64
65 public async bool load ()
66 {
67 animation = new Gnome.BGSlideShow (file);
68 try {
69 animation.load_async (null, (obj, res) => {
70 load.callback ();
71 });
72 yield;
73
74 yield update_animation ();
75
76 return true;
77 } catch (Error e) {
78 warning (e.message);
79 }
80
81 return false;
82 }
83
84 /**
85 * SlideShow animation related functions
86 */
87 async void update_animation ()
88 {
89 if (animation == null)
90 return;
91
92 update_animation_timeout_id = 0;
93
94 bool is_fixed;
95 string file_from, file_to;
96 double progress, duration;
97 animation.get_current_slide ((int)width, (int)height, out progress,
98 out duration, out is_fixed, out file_from, out file_to);
99
100 animation_duration = duration;
101 animation_progress = progress;
102
103 if (file_from == null && file_to == null) {
104 queue_update_animation ();
105 return;
106 }
107
108 if (image_from.content == null
109 || (image_from.content as Meta.Background).get_filename () != file_from) {
110 yield update_image (image_from, file_from);
111 }
112 if (image_to.content == null
113 || (image_to.content as Meta.Background).get_filename () != file_to) {
114 yield update_image (image_to, file_to);
115 }
116
117 update_animation_progress ();
118 }
119
120 /**
121 * Returns the passed orig_image with the correct content or a new one if orig_image was null
122 */
123 async void update_image (Meta.BackgroundActor image, string? file)
124 {
125 if (file == null) {
126 image.visible = false;
127 return;
128 }
129
130 image.visible = true;
131 image.content = yield BackgroundCache.get_default ().load_image (file, monitor, style);
132 }
133
134 void queue_update_animation ()
135 {
136 if (update_animation_timeout_id != 0 || animation_duration == 0.0)
137 return;
138
139 var n_steps = 255 / ANIMATION_OPACITY_STEP_INCREMENT;
140 var time_per_step = (uint)((animation_duration * 1000) / n_steps);
141 var interval = uint.max ((uint)(ANIMATION_MIN_WAKEUP_INTERVAL * 1000), time_per_step);
142
143 if (interval > uint.MAX)
144 return;
145
146 update_animation_timeout_id = Clutter.Threads.Timeout.add (interval, () => {
147 update_animation_timeout_id = 0;
148 update_animation.begin ();
149 return false;
150 });
151 }
152
153 void update_animation_progress ()
154 {
155 if (image_to != null)
156 image_to.opacity = (uint)(animation_progress * 255);
157
158 queue_update_animation ();
159 }
160 }
161#endif
162}
163
0164
=== added file 'src/Background/SystemBackground.vala'
--- src/Background/SystemBackground.vala 1970-01-01 00:00:00 +0000
+++ src/Background/SystemBackground.vala 2013-11-27 18:52:22 +0000
@@ -0,0 +1,39 @@
1//
2// Copyright (C) 2013 Tom Beckmann, Rico Tzschichholz
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17
18namespace Gala
19{
20#if HAS_MUTTER38
21 public class SystemBackground : Meta.BackgroundActor
22 {
23 public SystemBackground ()
24 {
25 Object ();
26 }
27
28 construct
29 {
30 var cache = BackgroundCache.get_default ();
31 cache.load_image.begin (Config.PKGDATADIR + "/texture.png", 0,
32 GDesktop.BackgroundStyle.WALLPAPER, (obj, res) => {
33 content = cache.load_image.end (res);
34 });
35 }
36 }
37#endif
38}
39
040
=== modified file 'src/Plugin.vala'
--- src/Plugin.vala 2013-09-28 22:17:35 +0000
+++ src/Plugin.vala 2013-11-27 18:52:22 +0000
@@ -51,8 +51,8 @@
51 ScreenSaver? screensaver;51 ScreenSaver? screensaver;
52 52
53#if HAS_MUTTER3853#if HAS_MUTTER38
54 // FIXME we need a proper-sized background for every monitor54 public Meta.BackgroundGroup background_group { get; private set; }
55 public BackgroundActor wallpaper { get; private set; }55 public Clutter.Actor ui_group { get; private set; }
56#endif56#endif
57 57
58 Window? moving; //place for the window that is being moved over58 Window? moving; //place for the window that is being moved over
@@ -90,6 +90,9 @@
90 var screen = get_screen ();90 var screen = get_screen ();
91 91
92 DBus.init (this);92 DBus.init (this);
93#if HAS_MUTTER38
94 BackgroundCache.init (screen);
95#endif
93 96
94 // Due to a bug which enables access to the stage when using multiple monitors97 // Due to a bug which enables access to the stage when using multiple monitors
95 // in the screensaver, we have to listen for changes and make sure the input area98 // in the screensaver, we have to listen for changes and make sure the input area
@@ -102,12 +105,41 @@
102 105
103 var stage = Compositor.get_stage_for_screen (screen) as Clutter.Stage;106 var stage = Compositor.get_stage_for_screen (screen) as Clutter.Stage;
104 107
105 string color = new Settings ("org.gnome.desktop.background").get_string ("primary-color");108 var color = BackgroundSettings.get_default ().primary_color;
106 stage.background_color = Clutter.Color.from_string (color);109 stage.background_color = Clutter.Color.from_string (color);
107 110
108 if (Prefs.get_dynamic_workspaces ())111 if (Prefs.get_dynamic_workspaces ())
109 screen.override_workspace_layout (ScreenCorner.TOPLEFT, false, 1, -1);112 screen.override_workspace_layout (ScreenCorner.TOPLEFT, false, 1, -1);
110 113
114#if HAS_MUTTER38
115 /* our layer structure, copied from gnome-shell (from bottom to top):
116 * stage
117 * + system background
118 * + ui group
119 * +-- window group
120 * +---- background manager
121 * +-- shell elements
122 * +-- top window group
123 */
124
125 var system_background = new SystemBackground ();
126 system_background.add_constraint (new Clutter.BindConstraint (stage,
127 Clutter.BindCoordinate.ALL, 0));
128 stage.insert_child_below (system_background, null);
129
130 ui_group = new Clutter.Actor ();
131 ui_group.reactive = true;
132 stage.add_child (ui_group);
133
134 var window_group = Compositor.get_window_group_for_screen (screen);
135 stage.remove_child (window_group);
136 ui_group.add_child (window_group);
137
138 background_group = new BackgroundManager (screen);
139 window_group.add_child (background_group);
140 window_group.set_child_below_sibling (background_group, null);
141#endif
142
111 workspace_view = new WorkspaceView (this);143 workspace_view = new WorkspaceView (this);
112 workspace_view.visible = false;144 workspace_view.visible = false;
113 145
@@ -116,13 +148,18 @@
116 zooming = new Zooming (this);148 zooming = new Zooming (this);
117 window_overview = new WindowOverview (this);149 window_overview = new WindowOverview (this);
118 150
151#if HAS_MUTTER38
152 ui_group.add_child (workspace_view);
153 ui_group.add_child (winswitcher);
154 ui_group.add_child (window_overview);
155
156 var top_window_group = Compositor.get_top_window_group_for_screen (screen);
157 stage.remove_child (top_window_group);
158 ui_group.add_child (top_window_group);
159#else
119 stage.add_child (workspace_view);160 stage.add_child (workspace_view);
120 stage.add_child (winswitcher);161 stage.add_child (winswitcher);
121 stage.add_child (window_overview);162 stage.add_child (window_overview);
122
123#if HAS_MUTTER38
124 // FIXME create a background for every monitor and keep them updated and properly sized
125 wallpaper = new BackgroundActor ();
126#endif163#endif
127 164
128 /*keybindings*/165 /*keybindings*/
@@ -189,8 +226,15 @@
189 workspace_view.show (true);226 workspace_view.show (true);
190 });227 });
191 228
229#if HAS_MUTTER38
230 //FIXME we have to investigate this. Apparently alt-tab is now bound to switch-applications
231 // instead of windows, which we should probably handle too
232 KeyBinding.set_custom_handler ("switch-applications", winswitcher.handle_switch_windows);
233 KeyBinding.set_custom_handler ("switch-applications-backward", winswitcher.handle_switch_windows);
234#else
192 KeyBinding.set_custom_handler ("switch-windows", winswitcher.handle_switch_windows);235 KeyBinding.set_custom_handler ("switch-windows", winswitcher.handle_switch_windows);
193 KeyBinding.set_custom_handler ("switch-windows-backward", winswitcher.handle_switch_windows);236 KeyBinding.set_custom_handler ("switch-windows-backward", winswitcher.handle_switch_windows);
237#endif
194 238
195 KeyBinding.set_custom_handler ("switch-to-workspace-up", () => {});239 KeyBinding.set_custom_handler ("switch-to-workspace-up", () => {});
196 KeyBinding.set_custom_handler ("switch-to-workspace-down", () => {});240 KeyBinding.set_custom_handler ("switch-to-workspace-down", () => {});
@@ -217,6 +261,9 @@
217261
218#if HAS_MUTTER38262#if HAS_MUTTER38
219 stage.show ();263 stage.show ();
264
265 // let the session manager move to the next phase
266 Meta.register_with_session ();
220 267
221 return false;268 return false;
222#endif269#endif
@@ -281,7 +328,7 @@
281 else328 else
282 Utils.set_input_area (screen, InputArea.NONE);329 Utils.set_input_area (screen, InputArea.NONE);
283 }330 }
284 331
285 public uint32[] get_all_xids ()332 public uint32[] get_all_xids ()
286 {333 {
287 var list = new Gee.ArrayList<uint32> ();334 var list = new Gee.ArrayList<uint32> ();
@@ -346,6 +393,10 @@
346#else393#else
347 base.begin_modal (x_get_stage_window (Compositor.get_stage_for_screen (screen)), {}, 0, display.get_current_time ());394 base.begin_modal (x_get_stage_window (Compositor.get_stage_for_screen (screen)), {}, 0, display.get_current_time ());
348#endif395#endif
396
397#if HAS_MUTTER38
398 Meta.Util.disable_unredirect_for_screen (screen);
399#endif
349 }400 }
350 401
351 public new void end_modal ()402 public new void end_modal ()
@@ -355,7 +406,12 @@
355 return;406 return;
356 407
357 update_input_area ();408 update_input_area ();
358 base.end_modal (get_screen ().get_display ().get_current_time ());409
410 var screen = get_screen ();
411 base.end_modal (screen.get_display ().get_current_time ());
412#if HAS_MUTTER38
413 Meta.Util.enable_unredirect_for_screen (screen);
414#endif
359 }415 }
360 416
361 public void get_current_cursor_position (out int x, out int y)417 public void get_current_cursor_position (out int x, out int y)
@@ -786,7 +842,7 @@
786 /*workspace switcher*/842 /*workspace switcher*/
787 List<WindowActor>? win;843 List<WindowActor>? win;
788 List<Clutter.Actor>? par; //class space for kill func844 List<Clutter.Actor>? par; //class space for kill func
789 List<Clutter.Clone>? clones;845 List<Clutter.Actor>? clones;
790 Clutter.Actor? in_group;846 Clutter.Actor? in_group;
791 Clutter.Actor? out_group;847 Clutter.Actor? out_group;
792 Clutter.Actor? moving_window_container;848 Clutter.Actor? moving_window_container;
@@ -834,6 +890,8 @@
834 var group = Compositor.get_window_group_for_screen (screen);890 var group = Compositor.get_window_group_for_screen (screen);
835#if !HAS_MUTTER38891#if !HAS_MUTTER38
836 var wallpaper = Compositor.get_background_actor_for_screen (screen);892 var wallpaper = Compositor.get_background_actor_for_screen (screen);
893#else
894 var wallpaper = background_group;
837#endif895#endif
838 896
839 in_group = new Clutter.Actor ();897 in_group = new Clutter.Actor ();
@@ -985,6 +1043,8 @@
985 1043
986#if !HAS_MUTTER381044#if !HAS_MUTTER38
987 var wallpaper = Compositor.get_background_actor_for_screen (screen);1045 var wallpaper = Compositor.get_background_actor_for_screen (screen);
1046#else
1047 var wallpaper = background_group;
988#endif1048#endif
989 wallpaper.detach_animation ();1049 wallpaper.detach_animation ();
990 wallpaper.x = 0.0f;1050 wallpaper.x = 0.0f;
@@ -1003,6 +1063,15 @@
1003 {1063 {
1004 return x_handle_event (event) != 0;1064 return x_handle_event (event) != 0;
1005 }1065 }
1066
1067#if HAS_MUTTER38
1068 public override bool keybinding_filter (Meta.KeyBinding binding)
1069 {
1070 // for now we'll just block all keybindings if we're in modal mode,
1071 // do something useful with this later
1072 return modal_count > 0;
1073 }
1074#endif
1006 1075
1007 public override unowned PluginInfo? plugin_info ()1076 public override unowned PluginInfo? plugin_info ()
1008 {1077 {
10091078
=== modified file 'src/Settings.vala'
--- src/Settings.vala 2013-02-10 14:01:15 +0000
+++ src/Settings.vala 2013-11-27 18:52:22 +0000
@@ -151,4 +151,29 @@
151 return instance;151 return instance;
152 }152 }
153 }153 }
154
155 public class BackgroundSettings : Granite.Services.Settings
156 {
157 public string picture_options { get; set; }
158 public string picture_uri { get; set; }
159 public int picture_opacity { get; set; }
160 public string primary_color { get; set; }
161 public string secondary_color { get; set; }
162 public string color_shading_type { get; set; }
163
164 static BackgroundSettings? instance = null;
165
166 private BackgroundSettings ()
167 {
168 base ("org.gnome.desktop.background");
169 }
170
171 public static BackgroundSettings get_default ()
172 {
173 if (instance == null)
174 instance = new BackgroundSettings ();
175
176 return instance;
177 }
178 }
154}179}
155180
=== modified file 'src/Widgets/WindowOverview.vala'
--- src/Widgets/WindowOverview.vala 2013-09-28 22:17:35 +0000
+++ src/Widgets/WindowOverview.vala 2013-11-27 18:52:22 +0000
@@ -578,12 +578,10 @@
578578
579 screen.window_left_monitor.connect (window_left_monitor);579 screen.window_left_monitor.connect (window_left_monitor);
580 580
581#if HAS_MUTTER38581#if !HAS_MUTTER38
582 plugin.wallpaper.
583#else
584 Compositor.get_background_actor_for_screen (screen).582 Compositor.get_background_actor_for_screen (screen).
585#endif
586 animate (AnimationMode.EASE_OUT_QUAD, 350, dim_factor : 0.6);583 animate (AnimationMode.EASE_OUT_QUAD, 350, dim_factor : 0.6);
584#endif
587 585
588 // sort windows by stacking order586 // sort windows by stacking order
589 var windows = screen.get_display ().sort_windows_by_stacking (used_windows);587 var windows = screen.get_display ().sort_windows_by_stacking (used_windows);
@@ -693,7 +691,7 @@
693 } else {691 } else {
694 close (true);692 close (true);
695 //wait for the animation to finish before switching693 //wait for the animation to finish before switching
696 Timeout.add (400, () => {694 Clutter.Threads.Timeout.add (400, () => {
697 window.get_workspace ().activate_with_focus (window, screen.get_display ().get_current_time ());695 window.get_workspace ().activate_with_focus (window, screen.get_display ().get_current_time ());
698 return false;696 return false;
699 });697 });
@@ -722,15 +720,13 @@
722 exposed.selected.disconnect (thumb_selected);720 exposed.selected.disconnect (thumb_selected);
723 }721 }
724 722
725#if HAS_MUTTER38723#if !HAS_MUTTER38
726 plugin.wallpaper.
727#else
728 Compositor.get_background_actor_for_screen (screen).724 Compositor.get_background_actor_for_screen (screen).
729#endif
730 animate (AnimationMode.EASE_OUT_QUAD, 300, dim_factor : 1.0);725 animate (AnimationMode.EASE_OUT_QUAD, 300, dim_factor : 1.0);
726#endif
731 727
732 if (animate) {728 if (animate) {
733 Timeout.add (300, () => {729 Clutter.Threads.Timeout.add (300, () => {
734 visible = false;730 visible = false;
735 ready = true;731 ready = true;
736 732
737733
=== modified file 'src/Widgets/WindowSwitcher.vala'
--- src/Widgets/WindowSwitcher.vala 2013-08-18 21:09:23 +0000
+++ src/Widgets/WindowSwitcher.vala 2013-11-27 18:52:22 +0000
@@ -220,6 +220,9 @@
220 var prev_win = current_window;220 var prev_win = current_window;
221 if (action == Meta.KeyBindingAction.SWITCH_GROUP ||221 if (action == Meta.KeyBindingAction.SWITCH_GROUP ||
222 action == Meta.KeyBindingAction.SWITCH_WINDOWS || 222 action == Meta.KeyBindingAction.SWITCH_WINDOWS ||
223#if HAS_MUTTER38
224 action == Meta.KeyBindingAction.SWITCH_APPLICATIONS ||
225#endif
223 event.get_key_symbol () == Clutter.Key.Right) {226 event.get_key_symbol () == Clutter.Key.Right) {
224 227
225 current_window = display.get_tab_next (Meta.TabList.NORMAL, screen, 228 current_window = display.get_tab_next (Meta.TabList.NORMAL, screen,
@@ -228,6 +231,9 @@
228 231
229 } else if (action == Meta.KeyBindingAction.SWITCH_GROUP_BACKWARD ||232 } else if (action == Meta.KeyBindingAction.SWITCH_GROUP_BACKWARD ||
230 action == Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD ||233 action == Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD ||
234#if HAS_MUTTER38
235 action == Meta.KeyBindingAction.SWITCH_APPLICATIONS_BACKWARD ||
236#endif
231 event.get_key_symbol () == Clutter.Key.Left) {237 event.get_key_symbol () == Clutter.Key.Left) {
232 238
233 current_window = display.get_tab_next (Meta.TabList.NORMAL, screen, 239 current_window = display.get_tab_next (Meta.TabList.NORMAL, screen,
@@ -255,7 +261,7 @@
255 if (prev_window != current_window) {261 if (prev_window != current_window) {
256 dim_windows ();262 dim_windows ();
257 // wait for the dimming to finish263 // wait for the dimming to finish
258 Timeout.add (250, () => {264 Clutter.Threads.Timeout.add (250, () => {
259 close (event.time);265 close (event.time);
260 return false;266 return false;
261 });267 });
262268
=== modified file 'src/Widgets/WindowThumb.vala'
--- src/Widgets/WindowThumb.vala 2013-08-27 06:22:58 +0000
+++ src/Widgets/WindowThumb.vala 2013-11-27 18:52:22 +0000
@@ -88,7 +88,7 @@
88 window.delete (window.get_screen ().get_display ().get_current_time ());88 window.delete (window.get_screen ().get_display ().get_current_time ());
89 // see if the window is still alive after the animation ended. If it is, it's pretty certain that it89 // see if the window is still alive after the animation ended. If it is, it's pretty certain that it
90 // popped up some kind of confirmation dialog, so we focus it90 // popped up some kind of confirmation dialog, so we focus it
91 Timeout.add (AnimationSettings.get_default ().close_duration + WAIT_FOR_CONFIRMATION_DIALOG, () => {91 Clutter.Threads.Timeout.add (AnimationSettings.get_default ().close_duration + WAIT_FOR_CONFIRMATION_DIALOG, () => {
92 if (clone != null && clone.source != null && !(clone.source as Meta.WindowActor).is_destroyed ()) {92 if (clone != null && clone.source != null && !(clone.source as Meta.WindowActor).is_destroyed ()) {
93 clone.source.opacity = 255;93 clone.source.opacity = 255;
94 selected (window);94 selected (window);
9595
=== modified file 'src/Widgets/WorkspaceThumb.vala'
--- src/Widgets/WorkspaceThumb.vala 2013-08-09 12:52:20 +0000
+++ src/Widgets/WorkspaceThumb.vala 2013-11-27 18:52:22 +0000
@@ -50,6 +50,7 @@
50 50
51#if HAS_MUTTER3851#if HAS_MUTTER38
52 internal Actor wallpaper;52 internal Actor wallpaper;
53 Actor wallpaper_manager;
53#else54#else
54 internal Clone wallpaper;55 internal Clone wallpaper;
55#endif56#endif
@@ -60,7 +61,11 @@
60 61
61 uint hover_timer = 0;62 uint hover_timer = 0;
62 63
64#if HAS_MUTTER38
65 public WorkspaceThumb (Workspace _workspace, Meta.BackgroundGroup _wallpaper)
66#else
63 public WorkspaceThumb (Workspace _workspace)67 public WorkspaceThumb (Workspace _workspace)
68#endif
64 {69 {
65 workspace = _workspace;70 workspace = _workspace;
66 screen = workspace.get_screen ();71 screen = workspace.get_screen ();
@@ -89,9 +94,12 @@
89 94
90 handle_workspace_switched (-1, screen.get_active_workspace_index (), MotionDirection.LEFT);95 handle_workspace_switched (-1, screen.get_active_workspace_index (), MotionDirection.LEFT);
91 96
92 // FIXME find a nice way to draw a border around it, maybe combinable with the indicator using a ShaderEffect
93#if HAS_MUTTER3897#if HAS_MUTTER38
98 wallpaper_manager = new BackgroundManager (screen);
99 //FIXME apparently there are issues with scaling and animating the opacity. The wallpaper will
100 // start flickering when the opacity changes. Wrapping it in a container solves this.
94 wallpaper = new Clutter.Actor ();101 wallpaper = new Clutter.Actor ();
102 wallpaper.add_child (wallpaper_manager);
95#else103#else
96 wallpaper = new Clone (Compositor.get_background_actor_for_screen (screen));104 wallpaper = new Clone (Compositor.get_background_actor_for_screen (screen));
97#endif105#endif
@@ -202,6 +210,10 @@
202 indicator.width = width + 2 * INDICATOR_BORDER;210 indicator.width = width + 2 * INDICATOR_BORDER;
203 (indicator.content as Canvas).set_size ((int)indicator.width, (int)indicator.height);211 (indicator.content as Canvas).set_size ((int)indicator.width, (int)indicator.height);
204212
213#if HAS_MUTTER38
214 wallpaper_manager.scale_x = width / swidth;
215 wallpaper_manager.scale_y = THUMBNAIL_HEIGHT / sheight;
216#endif
205 wallpaper.width = width;217 wallpaper.width = width;
206 windows.width = width;218 windows.width = width;
207219
@@ -270,7 +282,7 @@
270 window.delete (screen.get_display ().get_current_time ());282 window.delete (screen.get_display ().get_current_time ());
271 }283 }
272 284
273 GLib.Timeout.add (250, () => {285 Clutter.Threads.Timeout.add (250, () => {
274 //wait for confirmation dialogs to popup286 //wait for confirmation dialogs to popup
275 if (Utils.get_n_windows (workspace) == 0) {287 if (Utils.get_n_windows (workspace) == 0) {
276 workspace.window_added.disconnect (handle_window_added);288 workspace.window_added.disconnect (handle_window_added);
@@ -486,7 +498,7 @@
486 return;498 return;
487 499
488 // we need to wait untill the animation ended, otherwise we get trouble with focus handling500 // we need to wait untill the animation ended, otherwise we get trouble with focus handling
489 Timeout.add (AnimationSettings.get_default ().workspace_switch_duration + 10, () => {501 Clutter.Threads.Timeout.add (AnimationSettings.get_default ().workspace_switch_duration + 10, () => {
490 // check again, maybe something opened502 // check again, maybe something opened
491 if (workspace == null || Utils.get_n_windows (workspace) > 0)503 if (workspace == null || Utils.get_n_windows (workspace) > 0)
492 return false;504 return false;
@@ -525,7 +537,7 @@
525 workspace.activate (screen.get_display ().get_current_time ());537 workspace.activate (screen.get_display ().get_current_time ());
526 538
527 // wait for the animation to be finished before closing, for aesthetic reasons539 // wait for the animation to be finished before closing, for aesthetic reasons
528 Timeout.add (AnimationSettings.get_default ().workspace_switch_duration, () => {540 Clutter.Threads.Timeout.add (AnimationSettings.get_default ().workspace_switch_duration, () => {
529 clicked ();541 clicked ();
530 return false;542 return false;
531 });543 });
@@ -551,7 +563,7 @@
551 if (hover_timer > 0)563 if (hover_timer > 0)
552 GLib.Source.remove (hover_timer);564 GLib.Source.remove (hover_timer);
553 565
554 hover_timer = Timeout.add (CLOSE_BUTTON_DELAY, () => {566 hover_timer = Clutter.Threads.Timeout.add (CLOSE_BUTTON_DELAY, () => {
555 close_button.visible = true;567 close_button.visible = true;
556 close_button.animate (AnimationMode.EASE_OUT_ELASTIC, 400, scale_x : 1.0f, scale_y : 1.0f);568 close_button.animate (AnimationMode.EASE_OUT_ELASTIC, 400, scale_x : 1.0f, scale_y : 1.0f);
557 return false;569 return false;
558570
=== modified file 'src/Widgets/WorkspaceView.vala'
--- src/Widgets/WorkspaceView.vala 2013-08-03 11:15:11 +0000
+++ src/Widgets/WorkspaceView.vala 2013-11-27 18:52:22 +0000
@@ -29,7 +29,9 @@
29 29
30 Clutter.Actor thumbnails;30 Clutter.Actor thumbnails;
31 Clutter.Actor scroll;31 Clutter.Actor scroll;
32#if !HAS_MUTTER38
32 Clutter.Actor click_catcher; //invisible plane that catches clicks outside the view33 Clutter.Actor click_catcher; //invisible plane that catches clicks outside the view
34#endif
33 35
34 bool animating; // delay closing the popup36 bool animating; // delay closing the popup
35 37
@@ -67,6 +69,7 @@
67 scroll.content = new Clutter.Canvas ();69 scroll.content = new Clutter.Canvas ();
68 (scroll.content as Clutter.Canvas).draw.connect (draw_scroll);70 (scroll.content as Clutter.Canvas).draw.connect (draw_scroll);
69 71
72#if !HAS_MUTTER38
70 click_catcher = new Clutter.Actor ();73 click_catcher = new Clutter.Actor ();
71 click_catcher.reactive = true;74 click_catcher.reactive = true;
72 click_catcher.button_release_event.connect ((e) => {75 click_catcher.button_release_event.connect ((e) => {
@@ -74,6 +77,7 @@
74 return true;77 return true;
75 });78 });
76 Compositor.get_stage_for_screen (screen).add_child (click_catcher);79 Compositor.get_stage_for_screen (screen).add_child (click_catcher);
80#endif
77 81
78 add_child (thumbnails);82 add_child (thumbnails);
79 add_child (scroll);83 add_child (scroll);
@@ -114,7 +118,11 @@
114 void init_thumbnails ()118 void init_thumbnails ()
115 {119 {
116 foreach (var workspace in screen.get_workspaces ()) {120 foreach (var workspace in screen.get_workspaces ()) {
121#if HAS_MUTTER38
122 var thumb = new WorkspaceThumb (workspace, plugin.background_group);
123#else
117 var thumb = new WorkspaceThumb (workspace);124 var thumb = new WorkspaceThumb (workspace);
125#endif
118 thumb.clicked.connect (hide);126 thumb.clicked.connect (hide);
119 thumb.closed.connect (remove_workspace);127 thumb.closed.connect (remove_workspace);
120 thumb.window_on_last.connect (add_workspace);128 thumb.window_on_last.connect (add_workspace);
@@ -128,6 +136,14 @@
128 && Utils.get_n_windows (screen.get_workspaces ().first ().data) > 0)136 && Utils.get_n_windows (screen.get_workspaces ().first ().data) > 0)
129 add_workspace ();137 add_workspace ();
130 }138 }
139
140#if HAS_MUTTER38
141 bool outside_clicked (Clutter.ButtonEvent event)
142 {
143 hide ();
144 return true;
145 }
146#endif
131 147
132 bool draw_background (Cairo.Context cr)148 bool draw_background (Cairo.Context cr)
133 {149 {
@@ -168,7 +184,11 @@
168 184
169 void create_workspace_thumb (Meta.Workspace workspace)185 void create_workspace_thumb (Meta.Workspace workspace)
170 {186 {
187#if HAS_MUTTER38
188 var thumb = new WorkspaceThumb (workspace, plugin.background_group);
189#else
171 var thumb = new WorkspaceThumb (workspace);190 var thumb = new WorkspaceThumb (workspace);
191#endif
172 thumb.clicked.connect (hide);192 thumb.clicked.connect (hide);
173 thumb.closed.connect (remove_workspace);193 thumb.closed.connect (remove_workspace);
174 thumb.window_on_last.connect (add_workspace);194 thumb.window_on_last.connect (add_workspace);
@@ -390,6 +410,10 @@
390 410
391 plugin.begin_modal ();411 plugin.begin_modal ();
392 412
413#if HAS_MUTTER38
414 plugin.ui_group.button_release_event.connect (outside_clicked);
415#endif
416
393 var area = screen.get_monitor_geometry (screen.get_primary_monitor ());417 var area = screen.get_monitor_geometry (screen.get_primary_monitor ());
394 y = area.height + area.y;418 y = area.height + area.y;
395 x = area.x;419 x = area.x;
@@ -414,14 +438,16 @@
414 int swidth, sheight;438 int swidth, sheight;
415 screen.get_size (out swidth, out sheight);439 screen.get_size (out swidth, out sheight);
416 440
441#if !HAS_MUTTER38
417 click_catcher.width = swidth;442 click_catcher.width = swidth;
418 click_catcher.height = sheight;443 click_catcher.height = sheight;
419 click_catcher.x = 0;444 click_catcher.x = 0;
420 click_catcher.y = 0;445 click_catcher.y = 0;
421 click_catcher.visible = true;446 click_catcher.visible = true;
447#endif
422 448
423 animating = true;449 animating = true;
424 Timeout.add (50, () => {450 Clutter.Threads.Timeout.add (50, () => {
425 animating = false;451 animating = false;
426 return false;452 return false;
427 }); //catch hot corner hiding problem453 }); //catch hot corner hiding problem
@@ -431,13 +457,17 @@
431 wins.x = 0.0f;457 wins.x = 0.0f;
432 458
433 animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : (area.height + area.y) - height);459 animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : (area.height + area.y) - height);
434 wins.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : -height + 1);460 wins.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 250, y : -height + 1.01f);
435 }461 }
436 462
437 public new void hide ()463 public new void hide ()
438 {464 {
439 if (!visible || animating)465 if (!visible || animating)
440 return;466 return;
467
468#if HAS_MUTTER38
469 plugin.ui_group.button_release_event.disconnect (outside_clicked);
470#endif
441 471
442 float width, height;472 float width, height;
443 plugin.get_screen ().get_size (out width, out height);473 plugin.get_screen ().get_size (out width, out height);
@@ -454,7 +484,9 @@
454 visible = false;484 visible = false;
455 });485 });
456 486
487#if !HAS_MUTTER38
457 click_catcher.visible = false;488 click_catcher.visible = false;
489#endif
458 490
459 var wins = Compositor.get_window_group_for_screen (screen);491 var wins = Compositor.get_window_group_for_screen (screen);
460 wins.detach_animation ();492 wins.detach_animation ();
461493
=== modified file 'src/Zooming.vala'
--- src/Zooming.vala 2012-08-28 15:49:58 +0000
+++ src/Zooming.vala 2013-11-27 18:52:22 +0000
@@ -67,7 +67,7 @@
67 wins.scale_center_x = mx;67 wins.scale_center_x = mx;
68 wins.scale_center_y = my;68 wins.scale_center_y = my;
69 69
70 mouse_poll_timer = Timeout.add (MOUSE_POLL_TIME, () => {70 mouse_poll_timer = Clutter.Threads.Timeout.add (MOUSE_POLL_TIME, () => {
71 client_pointer.get_position (null, out mx, out my);71 client_pointer.get_position (null, out mx, out my);
72 if (wins.scale_center_x == mx && wins.scale_center_y == my)72 if (wins.scale_center_x == mx && wins.scale_center_y == my)
73 return true;73 return true;
7474
=== modified file 'vapi/gdesktopenums-3.0.vapi'
--- vapi/gdesktopenums-3.0.vapi 2012-08-19 13:56:07 +0000
+++ vapi/gdesktopenums-3.0.vapi 2013-11-27 18:52:22 +0000
@@ -34,6 +34,20 @@
34 SMART,34 SMART,
35 STRICT35 STRICT
36 }36 }
37 [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_CARET_TRACKING_MODE_", has_type_id = false)]
38 public enum MagnifierCaretTrackingMode {
39 NONE,
40 CENTERED,
41 PROPORTIONAL,
42 PUSH
43 }
44 [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_FOCUS_TRACKING_MODE_", has_type_id = false)]
45 public enum MagnifierFocusTrackingMode {
46 NONE,
47 CENTERED,
48 PROPORTIONAL,
49 PUSH
50 }
37 [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_MOUSE_TRACKING_MODE_", has_type_id = false)]51 [CCode (cheader_filename = "gsettings-desktop-schemas/gdesktop-enums.h", cprefix = "G_DESKTOP_MAGNIFIER_MOUSE_TRACKING_MODE_", has_type_id = false)]
38 public enum MagnifierMouseTrackingMode {52 public enum MagnifierMouseTrackingMode {
39 NONE,53 NONE,
4054
=== added file 'vapi/gnome-desktop-3.0.deps'
--- vapi/gnome-desktop-3.0.deps 1970-01-01 00:00:00 +0000
+++ vapi/gnome-desktop-3.0.deps 2013-11-27 18:52:22 +0000
@@ -0,0 +1,7 @@
1atk
2cairo
3gio-2.0
4gdesktopenums-3.0
5gdk-pixbuf-2.0
6gdk-3.0
7gtk+-3.0
08
=== added file 'vapi/gnome-desktop-3.0.vapi'
--- vapi/gnome-desktop-3.0.vapi 1970-01-01 00:00:00 +0000
+++ vapi/gnome-desktop-3.0.vapi 2013-11-27 18:52:22 +0000
@@ -0,0 +1,310 @@
1/* gnome-desktop-3.0.vapi generated by vapigen, do not modify. */
2
3[CCode (cprefix = "Gnome", gir_namespace = "GnomeDesktop", gir_version = "3.0", lower_case_cprefix = "gnome_")]
4namespace Gnome {
5 namespace DesktopThumbnail {
6 [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")]
7 public static bool has_uri (Gdk.Pixbuf pixbuf, string uri);
8 [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")]
9 public static bool is_valid (Gdk.Pixbuf pixbuf, string uri, long mtime);
10 [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")]
11 [Deprecated (since = "2.22")]
12 public static string md5 (string uri);
13 [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")]
14 public static string path_for_uri (string uri, Gnome.DesktopThumbnailSize size);
15 [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h")]
16 public static Gdk.Pixbuf scale_down_pixbuf (Gdk.Pixbuf pixbuf, int dest_width, int dest_height);
17 }
18 namespace Languages {
19 [CCode (array_length = false, array_null_terminated = true, cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_all_languages")]
20 public static string[] get_all_languages ();
21 [CCode (array_length = false, array_null_terminated = true, cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_all_locales")]
22 public static string[] get_all_locales ();
23 [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_country_from_code")]
24 public static string get_country_from_code (string code, string? translation);
25 [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_country_from_locale")]
26 public static string get_country_from_locale (string locale, string? translation);
27 [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_input_source_from_locale")]
28 public static bool get_input_source_from_locale (string locale, out unowned string type, out unowned string id);
29 [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_language_from_code")]
30 public static string get_language_from_code (string code, string? translation);
31 [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_get_language_from_locale")]
32 public static string get_language_from_locale (string locale, string? translation);
33 [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_language_has_translations")]
34 public static bool language_has_translations (string code);
35 [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_normalize_locale")]
36 public static string normalize_locale (string locale);
37 [CCode (cheader_filename = "libgnome-desktop/gnome-languages.h", cname = "gnome_parse_locale")]
38 public static bool parse_locale (string locale, out string language_codep, out string country_codep, out string codesetp, out string modifierp);
39 }
40 [CCode (cheader_filename = "libgnome-desktop/gnome-bg.h", type_id = "gnome_bg_get_type ()")]
41 public class BG : GLib.Object {
42 [CCode (has_construct_function = false)]
43 public BG ();
44 public bool changes_with_time ();
45 public Gdk.Pixbuf create_frame_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height, int frame_num);
46 public Cairo.Surface create_surface (Gdk.Window window, int width, int height, bool root);
47 public Gdk.Pixbuf create_thumbnail (Gnome.DesktopThumbnailFactory factory, Gdk.Screen screen, int dest_width, int dest_height);
48 public void draw (Gdk.Pixbuf dest, Gdk.Screen screen, bool is_root);
49 public void get_color (GDesktop.BackgroundShading type, Gdk.Color primary, Gdk.Color secondary);
50 public bool get_draw_background ();
51 public unowned string get_filename ();
52 public bool get_image_size (Gnome.DesktopThumbnailFactory factory, int best_width, int best_height, int width, int height);
53 public GDesktop.BackgroundStyle get_placement ();
54 public static Cairo.Surface get_surface_from_root (Gdk.Screen screen);
55 public bool has_multiple_sizes ();
56 public bool is_dark (int dest_width, int dest_height);
57 public void load_from_preferences (GLib.Settings settings);
58 public void save_to_preferences (GLib.Settings settings);
59 public void set_color (GDesktop.BackgroundShading type, Gdk.Color primary, Gdk.Color secondary);
60 public void set_draw_background (bool draw_background);
61 public void set_filename (string filename);
62 public void set_placement (GDesktop.BackgroundStyle placement);
63 public static void set_surface_as_root (Gdk.Screen screen, Cairo.Surface surface);
64 public static Gnome.BGCrossfade set_surface_as_root_with_crossfade (Gdk.Screen screen, Cairo.Surface surface);
65 public signal void changed ();
66 public signal void transitioned ();
67 }
68 [CCode (cheader_filename = "libgnome-desktop/gnome-bg-crossfade.h", type_id = "gnome_bg_crossfade_get_type ()")]
69 public class BGCrossfade : GLib.Object {
70 [CCode (has_construct_function = false)]
71 public BGCrossfade (int width, int height);
72 public bool is_started ();
73 public bool set_end_surface (Cairo.Surface surface);
74 public bool set_start_surface (Cairo.Surface surface);
75 public void start (Gdk.Window window);
76 public void stop ();
77 [NoAccessorMethod]
78 public int height { get; construct; }
79 [NoAccessorMethod]
80 public int width { get; construct; }
81 public virtual signal void finished (GLib.Object window);
82 }
83 [CCode (cheader_filename = "libgnome-desktop/gnome-bg-slide-show.h", type_id = "gnome_bg_slide_show_get_type ()")]
84 public class BGSlideShow : GLib.Object {
85 [CCode (has_construct_function = false)]
86 public BGSlideShow (string filename);
87 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);
88 public bool get_has_multiple_sizes ();
89 public int get_num_slides ();
90 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);
91 public double get_start_time ();
92 public double get_total_duration ();
93 public bool load () throws GLib.Error;
94 public void load_async (GLib.Cancellable? cancellable, GLib.AsyncReadyCallback callback);
95 [NoAccessorMethod]
96 public string filename { owned get; construct; }
97 public bool has_multiple_sizes { get; }
98 public double start_time { get; }
99 public double total_duration { get; }
100 }
101 [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h", type_id = "gnome_desktop_thumbnail_factory_get_type ()")]
102 public class DesktopThumbnailFactory : GLib.Object {
103 [CCode (has_construct_function = false)]
104 public DesktopThumbnailFactory (Gnome.DesktopThumbnailSize size);
105 public bool can_thumbnail (string uri, string mime_type, long mtime);
106 public void create_failed_thumbnail (string uri, long mtime);
107 public Gdk.Pixbuf generate_thumbnail (string uri, string mime_type);
108 public bool has_valid_failed_thumbnail (string uri, long mtime);
109 public string lookup (string uri, long mtime);
110 public void save_thumbnail (Gdk.Pixbuf thumbnail, string uri, long original_mtime);
111 }
112 [CCode (cheader_filename = "libgnome-desktop/gnome-idle-monitor.h", type_id = "gnome_idle_monitor_get_type ()")]
113 public class IdleMonitor : GLib.Object, GLib.Initable {
114 [CCode (has_construct_function = false)]
115 public IdleMonitor ();
116 public uint add_idle_watch (uint64 interval_msec, owned Gnome.IdleMonitorWatchFunc? callback);
117 public uint add_user_active_watch (owned Gnome.IdleMonitorWatchFunc? callback);
118 [CCode (has_construct_function = false)]
119 public IdleMonitor.for_device (Gdk.Device device) throws GLib.Error;
120 public uint64 get_idletime ();
121 public void remove_watch (uint id);
122 [NoAccessorMethod]
123 public Gdk.Device device { owned get; construct; }
124 }
125 [CCode (cheader_filename = "libgnome-desktop/gnome-pnp-ids.h", type_id = "gnome_pnp_ids_get_type ()")]
126 public class PnpIds : GLib.Object {
127 [CCode (has_construct_function = false)]
128 public PnpIds ();
129 public string get_pnp_id (string pnp_id);
130 }
131 [CCode (cheader_filename = "libgnome-desktop/gnome-rr-config.h", type_id = "gnome_rr_config_get_type ()")]
132 public class RRConfig : GLib.Object {
133 [CCode (has_construct_function = false)]
134 protected RRConfig ();
135 public bool applicable (Gnome.RRScreen screen) throws GLib.Error;
136 public bool apply (Gnome.RRScreen screen) throws GLib.Error;
137 public bool apply_persistent (Gnome.RRScreen screen) throws GLib.Error;
138 [CCode (has_construct_function = false)]
139 public RRConfig.current (Gnome.RRScreen screen) throws GLib.Error;
140 public bool ensure_primary ();
141 public bool equal (Gnome.RRConfig config2);
142 public bool get_clone ();
143 [CCode (array_length = false, array_null_terminated = true)]
144 public unowned Gnome.RROutputInfo[] get_outputs ();
145 public bool load_current () throws GLib.Error;
146 public bool match (Gnome.RRConfig config2);
147 public void sanitize ();
148 public void set_clone (bool clone);
149 public Gnome.RRScreen screen { construct; }
150 }
151 [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 ()")]
152 [Compact]
153 public class RRCrtc {
154 public bool can_drive_output (Gnome.RROutput output);
155 public Gnome.RRMode get_current_mode ();
156 public Gnome.RRRotation get_current_rotation ();
157 public bool get_gamma (int size, ushort red, ushort green, ushort blue);
158 public uint32 get_id ();
159 public void get_position (out int x, out int y);
160 public Gnome.RRRotation get_rotations ();
161 public bool set_gamma (int size, ushort red, ushort green, ushort blue);
162 public bool supports_rotation (Gnome.RRRotation rotation);
163 }
164 [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 ()")]
165 [Compact]
166 public class RRMode {
167 public int get_freq ();
168 public uint get_height ();
169 public uint32 get_id ();
170 public uint get_width ();
171 }
172 [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 ()")]
173 [Compact]
174 public class RROutput {
175 public bool can_clone (Gnome.RROutput clone);
176 public int get_backlight ();
177 public Gnome.RRCrtc get_crtc ();
178 public Gnome.RRMode get_current_mode ();
179 public unowned string get_display_name ();
180 public uint8 get_edid_data (size_t size);
181 public uint32 get_id ();
182 public void get_ids_from_edid (out string vendor, out string product, out string serial);
183 public bool get_is_primary ();
184 public unowned string get_name ();
185 public void get_physical_size (out int width_mm, out int height_mm);
186 public void get_position (out int x, out int y);
187 public Gnome.RRCrtc get_possible_crtcs ();
188 public Gnome.RRMode get_preferred_mode ();
189 public bool is_builtin_display ();
190 public Gnome.RRMode list_modes ();
191 public bool set_backlight (int value) throws GLib.Error;
192 public bool supports_mode (Gnome.RRMode mode);
193 }
194 [CCode (cheader_filename = "libgnome-desktop/gnome-rr-config.h", type_id = "gnome_rr_output_info_get_type ()")]
195 public class RROutputInfo : GLib.Object {
196 [CCode (has_construct_function = false)]
197 protected RROutputInfo ();
198 public double get_aspect_ratio ();
199 public unowned string get_display_name ();
200 public void get_geometry (out int x, out int y, out int width, out int height);
201 public unowned string get_name ();
202 public int get_preferred_height ();
203 public int get_preferred_width ();
204 public bool get_primary ();
205 public unowned string get_product ();
206 public int get_refresh_rate ();
207 public Gnome.RRRotation get_rotation ();
208 public unowned string get_serial ();
209 public unowned string get_vendor ();
210 public bool is_active ();
211 public bool is_connected ();
212 public void set_active (bool active);
213 public void set_geometry (int x, int y, int width, int height);
214 public void set_primary (bool primary);
215 public void set_refresh_rate (int rate);
216 public void set_rotation (Gnome.RRRotation rotation);
217 }
218 [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", type_id = "gnome_rr_screen_get_type ()")]
219 public class RRScreen : GLib.Object, GLib.AsyncInitable, GLib.Initable {
220 [CCode (has_construct_function = false)]
221 public RRScreen (Gdk.Screen screen) throws GLib.Error;
222 public Gnome.RRMode create_clone_modes ();
223 [CCode (cname = "gnome_rr_screen_new_async", has_construct_function = false)]
224 public async RRScreen.from_async (Gdk.Screen screen) throws GLib.Error;
225 public unowned Gnome.RRCrtc get_crtc_by_id (uint32 id);
226 public bool get_dpms_mode (out Gnome.RRDpmsMode mode) throws GLib.Error;
227 public unowned Gnome.RROutput get_output_by_id (uint32 id);
228 public unowned Gnome.RROutput get_output_by_name (string name);
229 public void get_ranges (out int min_width, out int max_width, out int min_height, out int max_height);
230 [CCode (array_length = false, array_null_terminated = true)]
231 public unowned Gnome.RRMode[] list_clone_modes ();
232 [CCode (array_length = false, array_null_terminated = true)]
233 public unowned Gnome.RRCrtc[] list_crtcs ();
234 [CCode (array_length = false, array_null_terminated = true)]
235 public unowned Gnome.RRMode[] list_modes ();
236 [CCode (array_length = false, array_null_terminated = true)]
237 public unowned Gnome.RROutput[] list_outputs ();
238 public bool refresh () throws GLib.Error;
239 public bool set_dpms_mode (Gnome.RRDpmsMode mode) throws GLib.Error;
240 [NoAccessorMethod]
241 public Gdk.Screen gdk_screen { owned get; construct; }
242 public virtual signal void changed ();
243 public virtual signal void output_connected (void* output);
244 public virtual signal void output_disconnected (void* output);
245 }
246 [CCode (cheader_filename = "libgnome-desktop/gnome-wall-clock.h", type_id = "gnome_wall_clock_get_type ()")]
247 public class WallClock : GLib.Object {
248 [CCode (has_construct_function = false)]
249 public WallClock ();
250 public unowned string get_clock ();
251 public unowned GLib.TimeZone get_timezone ();
252 public string clock { get; }
253 [NoAccessorMethod]
254 public bool time_only { get; set; }
255 public GLib.TimeZone timezone { get; }
256 }
257 [CCode (cheader_filename = "libgnome-desktop/gnome-xkb-info.h", type_id = "gnome_xkb_info_get_type ()")]
258 public class XkbInfo : GLib.Object {
259 [CCode (has_construct_function = false)]
260 public XkbInfo ();
261 public unowned string description_for_group (string group_id);
262 public unowned string description_for_option (string group_id, string id);
263 public GLib.List<weak string> get_all_layouts ();
264 public GLib.List<weak string> get_all_option_groups ();
265 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);
266 public GLib.List<weak string> get_layouts_for_country (string country_code);
267 public GLib.List<weak string> get_layouts_for_language (string language_code);
268 public GLib.List<weak string> get_options_for_group (string group_id);
269 }
270 [CCode (cheader_filename = "libgnome-desktop/gnome-desktop-thumbnail.h", cprefix = "GNOME_DESKTOP_THUMBNAIL_SIZE_", has_type_id = false)]
271 public enum DesktopThumbnailSize {
272 NORMAL,
273 LARGE
274 }
275 [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cprefix = "GNOME_RR_DPMS_", has_type_id = false)]
276 public enum RRDpmsMode {
277 ON,
278 STANDBY,
279 SUSPEND,
280 OFF,
281 DISABLED,
282 UNKNOWN
283 }
284 [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cprefix = "GNOME_RR_", has_type_id = false)]
285 [Flags]
286 public enum RRRotation {
287 ROTATION_NEXT,
288 ROTATION_0,
289 ROTATION_90,
290 ROTATION_180,
291 ROTATION_270,
292 REFLECT_X,
293 REFLECT_Y
294 }
295 [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cprefix = "GNOME_RR_ERROR_")]
296 public errordomain RRError {
297 UNKNOWN,
298 NO_RANDR_EXTENSION,
299 RANDR_ERROR,
300 BOUNDS_ERROR,
301 CRTC_ASSIGNMENT,
302 NO_MATCHING_CONFIG,
303 NO_DPMS_EXTENSION;
304 public static GLib.Quark quark ();
305 }
306 [CCode (cheader_filename = "libgnome-desktop/gnome-idle-monitor.h", instance_pos = 2.9)]
307 public delegate void IdleMonitorWatchFunc (Gnome.IdleMonitor monitor, uint id);
308 [CCode (cheader_filename = "libgnome-desktop/gnome-rr.h", cname = "GNOME_RR_CONNECTOR_TYPE_PANEL")]
309 public const string RR_CONNECTOR_TYPE_PANEL;
310}

Subscribers

People subscribed via source and target branches