Merge lp:~unity-team/unity/places-fixes-17-08-2010 into lp:unity
- places-fixes-17-08-2010
- Merge into trunk
Proposed by
Neil J. Patel
Status: | Merged | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Mirco Müller | ||||||||||||||||||||
Approved revision: | no longer in the source branch. | ||||||||||||||||||||
Merged at revision: | 444 | ||||||||||||||||||||
Proposed branch: | lp:~unity-team/unity/places-fixes-17-08-2010 | ||||||||||||||||||||
Merge into: | lp:unity | ||||||||||||||||||||
Diff against target: |
533 lines (+150/-71) 9 files modified
targets/mutter/Makefile.am (+1/-0) targets/mutter/expose-manager.vala (+15/-0) targets/mutter/plugin.vala (+26/-19) targets/mutter/spaces-manager.vala (+39/-4) targets/mutter/window-management.vala (+0/-1) unity-private/panel/panel-tray.vala (+13/-1) unity-private/panel/panel-window-buttons.vala (+44/-37) unity-private/unity-utils.c (+10/-7) unity-private/utils.vala (+2/-2) |
||||||||||||||||||||
To merge this branch: | bzr merge lp:~unity-team/unity/places-fixes-17-08-2010 | ||||||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mirco Müller | Pending | ||
Review via email: mp+33048@code.launchpad.net |
Commit message
Description of the change
Doesn't fix actually much places stuff, sorry for the mis-naming. The links bugs should provide the low-down on what should be fixed.
To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'targets/mutter/Makefile.am' | |||
2 | --- targets/mutter/Makefile.am 2010-07-12 08:50:07 +0000 | |||
3 | +++ targets/mutter/Makefile.am 2010-08-18 20:18:44 +0000 | |||
4 | @@ -22,6 +22,7 @@ | |||
5 | 22 | -I$(top_srcdir)/unity \ | 22 | -I$(top_srcdir)/unity \ |
6 | 23 | -I$(top_srcdir)/unity-private \ | 23 | -I$(top_srcdir)/unity-private \ |
7 | 24 | -I$(top_srcdir)/src \ | 24 | -I$(top_srcdir)/src \ |
8 | 25 | -DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\" \ | ||
9 | 25 | $(BASE_CFLAGS) \ | 26 | $(BASE_CFLAGS) \ |
10 | 26 | $(MUTTER_CFLAGS) \ | 27 | $(MUTTER_CFLAGS) \ |
11 | 27 | $(MAINTAINER_CFLAGS) | 28 | $(MAINTAINER_CFLAGS) |
12 | 28 | 29 | ||
13 | === modified file 'targets/mutter/expose-manager.vala' | |||
14 | --- targets/mutter/expose-manager.vala 2010-08-18 16:07:48 +0000 | |||
15 | +++ targets/mutter/expose-manager.vala 2010-08-18 20:18:44 +0000 | |||
16 | @@ -70,6 +70,8 @@ | |||
17 | 70 | else | 70 | else |
18 | 71 | clone = new Clutter.Clone (source); | 71 | clone = new Clutter.Clone (source); |
19 | 72 | 72 | ||
20 | 73 | source.destroy.connect (on_source_destroyed); | ||
21 | 74 | |||
22 | 73 | add_actor (clone); | 75 | add_actor (clone); |
23 | 74 | clone.show (); | 76 | clone.show (); |
24 | 75 | clone.reactive = true; | 77 | clone.reactive = true; |
25 | @@ -91,6 +93,11 @@ | |||
26 | 91 | this.leave_event.connect (this.on_mouse_leave); | 93 | this.leave_event.connect (this.on_mouse_leave); |
27 | 92 | this.button_press_event.connect (this.on_button_press); | 94 | this.button_press_event.connect (this.on_button_press); |
28 | 93 | } | 95 | } |
29 | 96 | |||
30 | 97 | private void on_source_destroyed () | ||
31 | 98 | { | ||
32 | 99 | destroy (); | ||
33 | 100 | } | ||
34 | 94 | 101 | ||
35 | 95 | private bool on_button_press (Clutter.Event evnt) | 102 | private bool on_button_press (Clutter.Event evnt) |
36 | 96 | { | 103 | { |
37 | @@ -299,6 +306,8 @@ | |||
38 | 299 | 306 | ||
39 | 300 | expose_group.add_actor (clone); | 307 | expose_group.add_actor (clone); |
40 | 301 | 308 | ||
41 | 309 | clone.destroy.connect (on_clone_destroyed); | ||
42 | 310 | |||
43 | 302 | clone.hovered_opacity = hovered_opacity; | 311 | clone.hovered_opacity = hovered_opacity; |
44 | 303 | clone.unhovered_opacity = unhovered_opacity; | 312 | clone.unhovered_opacity = unhovered_opacity; |
45 | 304 | clone.opacity = unhovered_opacity; | 313 | clone.opacity = unhovered_opacity; |
46 | @@ -327,6 +336,12 @@ | |||
47 | 327 | stage.captured_event.connect (on_stage_captured_event); | 336 | stage.captured_event.connect (on_stage_captured_event); |
48 | 328 | } | 337 | } |
49 | 329 | 338 | ||
50 | 339 | private void on_clone_destroyed () | ||
51 | 340 | { | ||
52 | 341 | if (expose_group.get_children ().length () <= 1) | ||
53 | 342 | end_expose (); | ||
54 | 343 | } | ||
55 | 344 | |||
56 | 330 | public void end_expose () | 345 | public void end_expose () |
57 | 331 | { | 346 | { |
58 | 332 | if (!expose_showing) | 347 | if (!expose_showing) |
59 | 333 | 348 | ||
60 | === modified file 'targets/mutter/plugin.vala' | |||
61 | --- targets/mutter/plugin.vala 2010-08-12 11:41:51 +0000 | |||
62 | +++ targets/mutter/plugin.vala 2010-08-18 20:18:44 +0000 | |||
63 | @@ -133,7 +133,6 @@ | |||
64 | 133 | private Places.Controller places_controller; | 133 | private Places.Controller places_controller; |
65 | 134 | private Places.View places; | 134 | private Places.View places; |
66 | 135 | private Panel.View panel; | 135 | private Panel.View panel; |
67 | 136 | private ActorBlur actor_blur; | ||
68 | 137 | private Clutter.Rectangle dark_box; | 136 | private Clutter.Rectangle dark_box; |
69 | 138 | private unowned Mutter.MetaWindow? focus_window = null; | 137 | private unowned Mutter.MetaWindow? focus_window = null; |
70 | 139 | private unowned Mutter.MetaDisplay? display = null; | 138 | private unowned Mutter.MetaDisplay? display = null; |
71 | @@ -702,11 +701,6 @@ | |||
72 | 702 | this.grab_enabled = grab; | 701 | this.grab_enabled = grab; |
73 | 703 | } | 702 | } |
74 | 704 | 703 | ||
75 | 705 | private bool envvar_is_enabled (string name) | ||
76 | 706 | { | ||
77 | 707 | return (Environment.get_variable (name) != null); | ||
78 | 708 | } | ||
79 | 709 | |||
80 | 710 | private unowned Mutter.MetaWindow? get_window_for_xid (uint32 xid) | 704 | private unowned Mutter.MetaWindow? get_window_for_xid (uint32 xid) |
81 | 711 | { | 705 | { |
82 | 712 | unowned GLib.List<Mutter.Window> mutter_windows = this.plugin.get_windows (); | 706 | unowned GLib.List<Mutter.Window> mutter_windows = this.plugin.get_windows (); |
83 | @@ -788,13 +782,10 @@ | |||
84 | 788 | int width, | 782 | int width, |
85 | 789 | int height) | 783 | int height) |
86 | 790 | { | 784 | { |
87 | 791 | /*FIXME: This doesn't work in Mutter | ||
88 | 792 | if (window.get_data<string> (UNDECORATED_HINT) == null) | 785 | if (window.get_data<string> (UNDECORATED_HINT) == null) |
89 | 793 | { | 786 | { |
92 | 794 | uint32 xid = (uint32)window.get_x_window (); | 787 | Utils.window_set_decorations (Mutter.MetaWindow.get_xwindow (window.get_meta_window ()), 0); |
91 | 795 | Utils.window_set_decorations (xid, 0); | ||
93 | 796 | } | 788 | } |
94 | 797 | */ | ||
95 | 798 | 789 | ||
96 | 799 | this.window_maximized (this, window, x, y, width, height); | 790 | this.window_maximized (this, window, x, y, width, height); |
97 | 800 | 791 | ||
98 | @@ -807,13 +798,10 @@ | |||
99 | 807 | int width, | 798 | int width, |
100 | 808 | int height) | 799 | int height) |
101 | 809 | { | 800 | { |
102 | 810 | /* FIXME: This doesn't work in Mutter | ||
103 | 811 | if (window.get_data<string> (UNDECORATED_HINT) == null) | 801 | if (window.get_data<string> (UNDECORATED_HINT) == null) |
104 | 812 | { | 802 | { |
107 | 813 | uint32 xid = (uint32)window.get_x_window (); | 803 | Utils.window_set_decorations (Mutter.MetaWindow.get_xwindow (window.get_meta_window ()), 1); |
106 | 814 | Utils.window_set_decorations (xid, 1); | ||
108 | 815 | } | 804 | } |
109 | 816 | */ | ||
110 | 817 | 805 | ||
111 | 818 | this.window_unmaximized (this, window, x, y, width, height); | 806 | this.window_unmaximized (this, window, x, y, width, height); |
112 | 819 | 807 | ||
113 | @@ -822,11 +810,30 @@ | |||
114 | 822 | 810 | ||
115 | 823 | public void map (Mutter.Window window) | 811 | public void map (Mutter.Window window) |
116 | 824 | { | 812 | { |
122 | 825 | /* FIXME: This doesn't work in Mutter | 813 | unowned Mutter.MetaWindow win = window.get_meta_window (); |
123 | 826 | uint32 xid = (uint32)window.get_x_window (); | 814 | |
124 | 827 | if (Utils.window_is_decorated (xid) == false) | 815 | if (window.get_window_type () == Mutter.MetaCompWindowType.NORMAL) |
125 | 828 | window.set_data (UNDECORATED_HINT, "%s".printf ("true")); | 816 | { |
126 | 829 | */ | 817 | Idle.add (() => { |
127 | 818 | if (win is Object) | ||
128 | 819 | { | ||
129 | 820 | if (Utils.window_is_decorated (Mutter.MetaWindow.get_xwindow (win)) == false && Mutter.MetaWindow.is_maximized (win) == false) | ||
130 | 821 | { | ||
131 | 822 | window.set_data (UNDECORATED_HINT, "%s".printf ("true")); | ||
132 | 823 | } | ||
133 | 824 | else | ||
134 | 825 | { | ||
135 | 826 | if (Mutter.MetaWindow.is_maximized (win)) | ||
136 | 827 | { | ||
137 | 828 | Utils.window_set_decorations (Mutter.MetaWindow.get_xwindow (win), 0); | ||
138 | 829 | } | ||
139 | 830 | } | ||
140 | 831 | } | ||
141 | 832 | |||
142 | 833 | return false; | ||
143 | 834 | }); | ||
144 | 835 | } | ||
145 | 836 | |||
146 | 830 | this.maximus.process_window (window); | 837 | this.maximus.process_window (window); |
147 | 831 | this.window_mapped (this, window); | 838 | this.window_mapped (this, window); |
148 | 832 | 839 | ||
149 | 833 | 840 | ||
150 | === modified file 'targets/mutter/spaces-manager.vala' | |||
151 | --- targets/mutter/spaces-manager.vala 2010-08-18 03:21:28 +0000 | |||
152 | +++ targets/mutter/spaces-manager.vala 2010-08-18 20:18:44 +0000 | |||
153 | @@ -31,7 +31,7 @@ | |||
154 | 31 | this.parent = _parent; | 31 | this.parent = _parent; |
155 | 32 | parent.notify["showing"].connect (on_notify_showing); | 32 | parent.notify["showing"].connect (on_notify_showing); |
156 | 33 | 33 | ||
158 | 34 | name = "Workspace Overview"; | 34 | name = _("Workspaces"); |
159 | 35 | load_icon_from_icon_name ("workspace-switcher"); | 35 | load_icon_from_icon_name ("workspace-switcher"); |
160 | 36 | } | 36 | } |
161 | 37 | 37 | ||
162 | @@ -52,6 +52,26 @@ | |||
163 | 52 | else | 52 | else |
164 | 53 | parent.show_spaces_picker (); | 53 | parent.show_spaces_picker (); |
165 | 54 | } | 54 | } |
166 | 55 | public override QuicklistController? get_menu_controller () | ||
167 | 56 | { | ||
168 | 57 | return new ApplicationQuicklistController (this); | ||
169 | 58 | } | ||
170 | 59 | |||
171 | 60 | public override void get_menu_actions (ScrollerChildController.menu_cb callback) | ||
172 | 61 | { | ||
173 | 62 | callback (null); | ||
174 | 63 | } | ||
175 | 64 | |||
176 | 65 | public override void get_menu_navigation (ScrollerChildController.menu_cb callback) | ||
177 | 66 | { | ||
178 | 67 | callback (null); | ||
179 | 68 | } | ||
180 | 69 | |||
181 | 70 | public override bool can_drag () | ||
182 | 71 | { | ||
183 | 72 | return true; | ||
184 | 73 | } | ||
185 | 74 | |||
186 | 55 | } | 75 | } |
187 | 56 | 76 | ||
188 | 57 | public class WorkspaceClone : Clutter.Group | 77 | public class WorkspaceClone : Clutter.Group |
189 | @@ -109,7 +129,6 @@ | |||
190 | 109 | Clutter.Actor background; | 129 | Clutter.Actor background; |
191 | 110 | List<Clutter.Actor> clones; | 130 | List<Clutter.Actor> clones; |
192 | 111 | Plugin plugin; | 131 | Plugin plugin; |
193 | 112 | unowned Mutter.MetaScreen screen; | ||
194 | 113 | ScrollerChild _button; | 132 | ScrollerChild _button; |
195 | 114 | SpacesButtonController controller; | 133 | SpacesButtonController controller; |
196 | 115 | 134 | ||
197 | @@ -169,6 +188,8 @@ | |||
198 | 169 | showing = true; | 188 | showing = true; |
199 | 170 | plugin.add_fullscreen_request (this); | 189 | plugin.add_fullscreen_request (this); |
200 | 171 | 190 | ||
201 | 191 | global_shell.get_stage ().captured_event.connect (on_stage_capture_event); | ||
202 | 192 | |||
203 | 172 | if (background is Clutter.Actor) | 193 | if (background is Clutter.Actor) |
204 | 173 | background.destroy (); | 194 | background.destroy (); |
205 | 174 | 195 | ||
206 | @@ -226,6 +247,20 @@ | |||
207 | 226 | (w as Clutter.Actor).opacity = 0; | 247 | (w as Clutter.Actor).opacity = 0; |
208 | 227 | } | 248 | } |
209 | 228 | } | 249 | } |
210 | 250 | |||
211 | 251 | private bool on_stage_capture_event (Clutter.Event event) | ||
212 | 252 | { | ||
213 | 253 | if (event.type == Clutter.EventType.BUTTON_PRESS) | ||
214 | 254 | { | ||
215 | 255 | if (event.button.y <= global_shell.get_panel_height_foobar () || | ||
216 | 256 | event.button.x <= global_shell.get_launcher_width_foobar ()) | ||
217 | 257 | { | ||
218 | 258 | select_workspace (null); | ||
219 | 259 | } | ||
220 | 260 | } | ||
221 | 261 | |||
222 | 262 | return false; | ||
223 | 263 | } | ||
224 | 229 | 264 | ||
225 | 230 | private void select_workspace (Mutter.MetaWorkspace? workspace) { | 265 | private void select_workspace (Mutter.MetaWorkspace? workspace) { |
226 | 231 | if (workspace == null) | 266 | if (workspace == null) |
227 | @@ -240,6 +275,8 @@ | |||
228 | 240 | Mutter.MetaWorkspace.activate (workspace, time_); | 275 | Mutter.MetaWorkspace.activate (workspace, time_); |
229 | 241 | plugin.remove_fullscreen_request (this); | 276 | plugin.remove_fullscreen_request (this); |
230 | 242 | showing = false; | 277 | showing = false; |
231 | 278 | |||
232 | 279 | global_shell.get_stage ().captured_event.disconnect (on_stage_capture_event); | ||
233 | 243 | } | 280 | } |
234 | 244 | 281 | ||
235 | 245 | private Clutter.Actor workspace_clone (Mutter.MetaWorkspace workspace) { | 282 | private Clutter.Actor workspace_clone (Mutter.MetaWorkspace workspace) { |
236 | @@ -249,8 +286,6 @@ | |||
237 | 249 | windows = plugin.plugin.get_windows (); | 286 | windows = plugin.plugin.get_windows (); |
238 | 250 | wsp = new WorkspaceClone (workspace, plugin); | 287 | wsp = new WorkspaceClone (workspace, plugin); |
239 | 251 | 288 | ||
240 | 252 | int active_workspace = Mutter.MetaScreen.get_active_workspace_index (plugin.plugin.get_screen ()); | ||
241 | 253 | |||
242 | 254 | foreach (Mutter.Window window in windows) | 289 | foreach (Mutter.Window window in windows) |
243 | 255 | { | 290 | { |
244 | 256 | if (Mutter.MetaWindow.is_on_all_workspaces (window.get_meta_window ()) || | 291 | if (Mutter.MetaWindow.is_on_all_workspaces (window.get_meta_window ()) || |
245 | 257 | 292 | ||
246 | === modified file 'targets/mutter/window-management.vala' | |||
247 | --- targets/mutter/window-management.vala 2010-07-20 12:59:01 +0000 | |||
248 | +++ targets/mutter/window-management.vala 2010-08-18 20:18:44 +0000 | |||
249 | @@ -22,7 +22,6 @@ | |||
250 | 22 | public class WindowManagement : Object | 22 | public class WindowManagement : Object |
251 | 23 | { | 23 | { |
252 | 24 | private Plugin plugin; | 24 | private Plugin plugin; |
253 | 25 | private int switch_signals_to_send; | ||
254 | 26 | 25 | ||
255 | 27 | private unowned Mutter.Window last_mapped; | 26 | private unowned Mutter.Window last_mapped; |
256 | 28 | 27 | ||
257 | 29 | 28 | ||
258 | === modified file 'unity-private/panel/panel-tray.vala' | |||
259 | --- unity-private/panel/panel-tray.vala 2010-06-17 19:27:41 +0000 | |||
260 | +++ unity-private/panel/panel-tray.vala 2010-08-18 20:18:44 +0000 | |||
261 | @@ -57,7 +57,19 @@ | |||
262 | 57 | string? disable_tray = Environment.get_variable ("UNITY_DISABLE_TRAY"); | 57 | string? disable_tray = Environment.get_variable ("UNITY_DISABLE_TRAY"); |
263 | 58 | 58 | ||
264 | 59 | if (disable_tray == null) | 59 | if (disable_tray == null) |
266 | 60 | this.manager.manage_stage (this.stage); | 60 | { |
267 | 61 | Gdk.error_trap_push (); | ||
268 | 62 | |||
269 | 63 | this.manager.manage_stage (this.stage); | ||
270 | 64 | Gdk.flush (); | ||
271 | 65 | |||
272 | 66 | int err = 0; | ||
273 | 67 | if ((err = Gdk.error_trap_pop ()) != 0) | ||
274 | 68 | { | ||
275 | 69 | warning ("Unable to connect to the system tray: Error code: %d", | ||
276 | 70 | err); | ||
277 | 71 | } | ||
278 | 72 | } | ||
279 | 61 | 73 | ||
280 | 62 | return false; | 74 | return false; |
281 | 63 | } | 75 | } |
282 | 64 | 76 | ||
283 | === modified file 'unity-private/panel/panel-window-buttons.vala' | |||
284 | --- unity-private/panel/panel-window-buttons.vala 2010-07-30 12:46:52 +0000 | |||
285 | +++ unity-private/panel/panel-window-buttons.vala 2010-08-18 20:18:44 +0000 | |||
286 | @@ -25,7 +25,6 @@ | |||
287 | 25 | private Ctk.Text appname; | 25 | private Ctk.Text appname; |
288 | 26 | private WindowButton close; | 26 | private WindowButton close; |
289 | 27 | private WindowButton minimize; | 27 | private WindowButton minimize; |
290 | 28 | private WindowButton maximize; | ||
291 | 29 | private WindowButton unmaximize; | 28 | private WindowButton unmaximize; |
292 | 30 | 29 | ||
293 | 31 | private unowned Bamf.Matcher matcher; | 30 | private unowned Bamf.Matcher matcher; |
294 | @@ -47,28 +46,21 @@ | |||
295 | 47 | appname.max_length = 9; | 46 | appname.max_length = 9; |
296 | 48 | pack (appname, true, true); | 47 | pack (appname, true, true); |
297 | 49 | 48 | ||
299 | 50 | close = new WindowButton ("close.png"); | 49 | close = new WindowButton ("close"); |
300 | 51 | pack (close, false, false); | 50 | pack (close, false, false); |
301 | 52 | close.clicked.connect (() => { | 51 | close.clicked.connect (() => { |
302 | 53 | if (last_xid > 0) | 52 | if (last_xid > 0) |
303 | 54 | global_shell.do_window_action (last_xid, WindowAction.CLOSE); | 53 | global_shell.do_window_action (last_xid, WindowAction.CLOSE); |
304 | 55 | }); | 54 | }); |
305 | 56 | 55 | ||
307 | 57 | minimize = new WindowButton ("minimize.png"); | 56 | minimize = new WindowButton ("minimize"); |
308 | 58 | pack (minimize, false, false); | 57 | pack (minimize, false, false); |
309 | 59 | minimize.clicked.connect (() => { | 58 | minimize.clicked.connect (() => { |
310 | 60 | if (last_xid > 0) | 59 | if (last_xid > 0) |
311 | 61 | global_shell.do_window_action (last_xid, WindowAction.MINIMIZE); | 60 | global_shell.do_window_action (last_xid, WindowAction.MINIMIZE); |
312 | 62 | }); | 61 | }); |
313 | 63 | 62 | ||
322 | 64 | maximize = new WindowButton ("maximize.png"); | 63 | unmaximize = new WindowButton ("unmaximize"); |
315 | 65 | pack (maximize, false, false); | ||
316 | 66 | maximize.clicked.connect (() => { | ||
317 | 67 | if (last_xid > 0) | ||
318 | 68 | global_shell.do_window_action (last_xid, WindowAction.MAXIMIZE); | ||
319 | 69 | }); | ||
320 | 70 | |||
321 | 71 | unmaximize = new WindowButton ("unmaximize.png"); | ||
323 | 72 | pack (unmaximize, false, false); | 64 | pack (unmaximize, false, false); |
324 | 73 | unmaximize.clicked.connect (() => { | 65 | unmaximize.clicked.connect (() => { |
325 | 74 | if (last_xid > 0) | 66 | if (last_xid > 0) |
326 | @@ -91,6 +83,13 @@ | |||
327 | 91 | return false; | 83 | return false; |
328 | 92 | }); | 84 | }); |
329 | 93 | }); | 85 | }); |
330 | 86 | |||
331 | 87 | Idle.add (() => { | ||
332 | 88 | unowned Bamf.Window? win = matcher.get_active_window (); | ||
333 | 89 | on_active_window_changed (null, win as GLib.Object); | ||
334 | 90 | |||
335 | 91 | return false; | ||
336 | 92 | }); | ||
337 | 94 | } | 93 | } |
338 | 95 | 94 | ||
339 | 96 | private void on_active_window_changed (GLib.Object? object, | 95 | private void on_active_window_changed (GLib.Object? object, |
340 | @@ -113,7 +112,6 @@ | |||
341 | 113 | appname.hide (); | 112 | appname.hide (); |
342 | 114 | close.show (); | 113 | close.show (); |
343 | 115 | minimize.show (); | 114 | minimize.show (); |
344 | 116 | maximize.hide (); | ||
345 | 117 | unmaximize.show (); | 115 | unmaximize.show (); |
346 | 118 | } | 116 | } |
347 | 119 | else | 117 | else |
348 | @@ -121,7 +119,6 @@ | |||
349 | 121 | appname.show (); | 119 | appname.show (); |
350 | 122 | close.hide (); | 120 | close.hide (); |
351 | 123 | minimize.hide (); | 121 | minimize.hide (); |
352 | 124 | maximize.hide (); | ||
353 | 125 | unmaximize.hide (); | 122 | unmaximize.hide (); |
354 | 126 | } | 123 | } |
355 | 127 | 124 | ||
356 | @@ -150,7 +147,6 @@ | |||
357 | 150 | appname.hide (); | 147 | appname.hide (); |
358 | 151 | close.hide (); | 148 | close.hide (); |
359 | 152 | minimize.hide (); | 149 | minimize.hide (); |
360 | 153 | maximize.hide (); | ||
361 | 154 | unmaximize.hide (); | 150 | unmaximize.hide (); |
362 | 155 | last_xid = 0; | 151 | last_xid = 0; |
363 | 156 | } | 152 | } |
364 | @@ -168,10 +164,15 @@ | |||
365 | 168 | public class WindowButton : Ctk.Button | 164 | public class WindowButton : Ctk.Button |
366 | 169 | { | 165 | { |
367 | 170 | public static const string AMBIANCE = "/usr/share/themes/Ambiance/metacity-1"; | 166 | public static const string AMBIANCE = "/usr/share/themes/Ambiance/metacity-1"; |
368 | 167 | public static const string AMBIANCE_BETA = "/usr/share/themes/Ambiance-maverick-beta/metacity-1"; | ||
369 | 171 | 168 | ||
370 | 172 | public string filename { get; construct; } | 169 | public string filename { get; construct; } |
371 | 173 | public Clutter.Actor bg; | 170 | public Clutter.Actor bg; |
372 | 174 | 171 | ||
373 | 172 | private bool using_beta = false; | ||
374 | 173 | private int icon_size = 18; | ||
375 | 174 | private string directory = AMBIANCE; | ||
376 | 175 | |||
377 | 175 | public WindowButton (string filename) | 176 | public WindowButton (string filename) |
378 | 176 | { | 177 | { |
379 | 177 | Object (filename:filename); | 178 | Object (filename:filename); |
380 | @@ -179,40 +180,46 @@ | |||
381 | 179 | 180 | ||
382 | 180 | construct | 181 | construct |
383 | 181 | { | 182 | { |
384 | 183 | if (using_beta = FileUtils.test (AMBIANCE_BETA, FileTest.EXISTS)) | ||
385 | 184 | { | ||
386 | 185 | icon_size = 19; | ||
387 | 186 | directory = AMBIANCE_BETA; | ||
388 | 187 | } | ||
389 | 182 | try { | 188 | try { |
393 | 183 | 189 | bg = new Ctk.Image.from_filename (icon_size, | |
394 | 184 | bg = new Ctk.Image.from_filename (20, AMBIANCE + "/" + filename); | 190 | directory + |
395 | 185 | add_actor (bg); | 191 | "/" + |
396 | 192 | filename + | ||
397 | 193 | ".png"); | ||
398 | 194 | set_background_for_state (Ctk.ActorState.STATE_NORMAL, bg); | ||
399 | 195 | bg.show (); | ||
400 | 196 | |||
401 | 197 | bg = new Ctk.Image.from_filename (icon_size, | ||
402 | 198 | directory + | ||
403 | 199 | "/" + | ||
404 | 200 | filename + | ||
405 | 201 | "_focused_prelight.png"); | ||
406 | 202 | set_background_for_state (Ctk.ActorState.STATE_PRELIGHT, bg); | ||
407 | 203 | bg.show (); | ||
408 | 204 | |||
409 | 205 | bg = new Ctk.Image.from_filename (icon_size, | ||
410 | 206 | directory + | ||
411 | 207 | "/" + | ||
412 | 208 | filename + | ||
413 | 209 | "_focused_pressed.png"); | ||
414 | 210 | set_background_for_state (Ctk.ActorState.STATE_ACTIVE, bg); | ||
415 | 186 | bg.show (); | 211 | bg.show (); |
416 | 187 | 212 | ||
417 | 188 | } catch (Error e) { | 213 | } catch (Error e) { |
418 | 189 | warning (@"Unable to load window button theme: You need Ambiance installed: $(e.message)"); | 214 | warning (@"Unable to load window button theme: You need Ambiance installed: $(e.message)"); |
419 | 190 | } | 215 | } |
420 | 191 | |||
421 | 192 | notify["state"].connect (() => { | ||
422 | 193 | switch (state) | ||
423 | 194 | { | ||
424 | 195 | case Ctk.ActorState.STATE_NORMAL: | ||
425 | 196 | bg.opacity = 255; | ||
426 | 197 | break; | ||
427 | 198 | |||
428 | 199 | case Ctk.ActorState.STATE_PRELIGHT: | ||
429 | 200 | bg.opacity = 120; | ||
430 | 201 | break; | ||
431 | 202 | |||
432 | 203 | case Ctk.ActorState.STATE_ACTIVE: | ||
433 | 204 | default: | ||
434 | 205 | bg.opacity = 50; | ||
435 | 206 | break; | ||
436 | 207 | } | ||
437 | 208 | }); | ||
438 | 209 | } | 216 | } |
439 | 210 | 217 | ||
440 | 211 | private override void get_preferred_width (float for_height, | 218 | private override void get_preferred_width (float for_height, |
441 | 212 | out float min_width, | 219 | out float min_width, |
442 | 213 | out float nat_width) | 220 | out float nat_width) |
443 | 214 | { | 221 | { |
445 | 215 | min_width = 20.0f; | 222 | min_width = icon_size; |
446 | 216 | nat_width = min_width; | 223 | nat_width = min_width; |
447 | 217 | } | 224 | } |
448 | 218 | 225 | ||
449 | @@ -220,7 +227,7 @@ | |||
450 | 220 | out float min_height, | 227 | out float min_height, |
451 | 221 | out float nat_height) | 228 | out float nat_height) |
452 | 222 | { | 229 | { |
454 | 223 | min_height = 18.0f; | 230 | min_height = icon_size; |
455 | 224 | nat_height = min_height; | 231 | nat_height = min_height; |
456 | 225 | } | 232 | } |
457 | 226 | } | 233 | } |
458 | 227 | 234 | ||
459 | === modified file 'unity-private/unity-utils.c' | |||
460 | --- unity-private/unity-utils.c 2010-08-17 16:00:00 +0000 | |||
461 | +++ unity-private/unity-utils.c 2010-08-18 20:18:44 +0000 | |||
462 | @@ -55,7 +55,7 @@ | |||
463 | 55 | #define _XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS" | 55 | #define _XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS" |
464 | 56 | 56 | ||
465 | 57 | gboolean | 57 | gboolean |
467 | 58 | utils_window_is_decorated (guint32 xid) | 58 | utils_window_is_decorated (Window xid) |
468 | 59 | { | 59 | { |
469 | 60 | GdkDisplay *display = gdk_display_get_default(); | 60 | GdkDisplay *display = gdk_display_get_default(); |
470 | 61 | Atom hints_atom = None; | 61 | Atom hints_atom = None; |
471 | @@ -76,20 +76,23 @@ | |||
472 | 76 | False, AnyPropertyType, &type, &format, &nitems, | 76 | False, AnyPropertyType, &type, &format, &nitems, |
473 | 77 | &bytes_after, &data); | 77 | &bytes_after, &data); |
474 | 78 | 78 | ||
476 | 79 | if (type == None || !data) return TRUE; | 79 | if (type == None || !data) |
477 | 80 | { | ||
478 | 81 | return TRUE; | ||
479 | 82 | } | ||
480 | 80 | 83 | ||
481 | 81 | hints = (MotifWmHints *)data; | 84 | hints = (MotifWmHints *)data; |
482 | 82 | 85 | ||
483 | 83 | retval = hints->decorations; | 86 | retval = hints->decorations; |
485 | 84 | 87 | ||
486 | 85 | if (data) | 88 | if (data) |
487 | 86 | XFree (data); | 89 | XFree (data); |
488 | 87 | 90 | ||
490 | 88 | return retval; | 91 | return retval == 1; |
491 | 89 | } | 92 | } |
492 | 90 | 93 | ||
493 | 91 | static void | 94 | static void |
495 | 92 | gdk_window_set_mwm_hints (guint32 xid, | 95 | gdk_window_set_mwm_hints (Window xid, |
496 | 93 | MotifWmHints *new_hints) | 96 | MotifWmHints *new_hints) |
497 | 94 | { | 97 | { |
498 | 95 | GdkDisplay *display = gdk_display_get_default(); | 98 | GdkDisplay *display = gdk_display_get_default(); |
499 | @@ -103,7 +106,7 @@ | |||
500 | 103 | 106 | ||
501 | 104 | g_return_if_fail (GDK_IS_DISPLAY (display)); | 107 | g_return_if_fail (GDK_IS_DISPLAY (display)); |
502 | 105 | 108 | ||
504 | 106 | g_debug ("gdk_window_set_mwm_hints: %u %lu\n", xid, new_hints->decorations); | 109 | g_debug ("gdk_window_set_mwm_hints: %lu %lu\n", xid, new_hints->decorations); |
505 | 107 | 110 | ||
506 | 108 | hints_atom = gdk_x11_get_xatom_by_name_for_display (display, | 111 | hints_atom = gdk_x11_get_xatom_by_name_for_display (display, |
507 | 109 | _XA_MOTIF_WM_HINTS); | 112 | _XA_MOTIF_WM_HINTS); |
508 | @@ -148,7 +151,7 @@ | |||
509 | 148 | } | 151 | } |
510 | 149 | 152 | ||
511 | 150 | void | 153 | void |
513 | 151 | utils_window_set_decorations (guint32 xid, | 154 | utils_window_set_decorations (Window xid, |
514 | 152 | GdkWMDecoration decorations) | 155 | GdkWMDecoration decorations) |
515 | 153 | { | 156 | { |
516 | 154 | MotifWmHints *hints; | 157 | MotifWmHints *hints; |
517 | 155 | 158 | ||
518 | === modified file 'unity-private/utils.vala' | |||
519 | --- unity-private/utils.vala 2010-08-17 16:00:00 +0000 | |||
520 | +++ unity-private/utils.vala 2010-08-18 20:18:44 +0000 | |||
521 | @@ -117,10 +117,10 @@ | |||
522 | 117 | string img2_path); | 117 | string img2_path); |
523 | 118 | 118 | ||
524 | 119 | [CCode (lower_case_prefix = "utils_")] | 119 | [CCode (lower_case_prefix = "utils_")] |
526 | 120 | public extern bool window_is_decorated (uint32 xid); | 120 | public extern bool window_is_decorated (X.Window window); |
527 | 121 | 121 | ||
528 | 122 | [CCode (lower_case_prefix = "utils_")] | 122 | [CCode (lower_case_prefix = "utils_")] |
530 | 123 | public extern void window_set_decorations (uint32 xid, uint decorations); | 123 | public extern void window_set_decorations (X.Window window, uint decorations); |
531 | 124 | 124 | ||
532 | 125 | [CCode (lower_case_prefix = "utils_")] | 125 | [CCode (lower_case_prefix = "utils_")] |
533 | 126 | public extern void volume_eject (GLib.Volume volume); | 126 | public extern void volume_eject (GLib.Volume volume); |
Approved