Merge lp:~unity-team/unity/death-to-wncky into lp:unity
- death-to-wncky
- Merge into trunk
Proposed by
Jason Smith
Status: | Merged |
---|---|
Approved by: | Gord Allott |
Approved revision: | no longer in the source branch. |
Merged at revision: | 326 |
Proposed branch: | lp:~unity-team/unity/death-to-wncky |
Merge into: | lp:unity |
Diff against target: |
592 lines (+106/-263) 11 files modified
configure.ac (+0/-1) targets/mutter/Makefile.am (+0/-1) targets/mutter/expose-manager.vala (+30/-35) targets/mutter/plugin.vala (+70/-211) targets/mutter/window-management.vala (+5/-9) targets/unity/Makefile.am (+0/-1) targets/unity/main.vala (+0/-1) tests/ui/Makefile.am (+0/-1) tests/unit/Makefile.am (+0/-1) unity-private/testing/test-window.vala (+1/-1) unity/Makefile.am (+0/-1) |
To merge this branch: | bzr merge lp:~unity-team/unity/death-to-wncky |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gord Allott (community) | Approve | ||
Review via email: mp+27217@code.launchpad.net |
Commit message
Description of the change
Removes build deps on libwnck except in the testing case.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'configure.ac' | |||
2 | --- configure.ac 2010-06-08 08:55:30 +0000 | |||
3 | +++ configure.ac 2010-06-10 00:36:28 +0000 | |||
4 | @@ -107,7 +107,6 @@ | |||
5 | 107 | gconf-2.0 | 107 | gconf-2.0 |
6 | 108 | indicator | 108 | indicator |
7 | 109 | libbamf >= 0.2 | 109 | libbamf >= 0.2 |
8 | 110 | libwnck-1.0 >= 2.28.0 | ||
9 | 111 | unique-1.0 | 110 | unique-1.0 |
10 | 112 | unity-misc | 111 | unity-misc |
11 | 113 | x11) | 112 | x11) |
12 | 114 | 113 | ||
13 | === modified file 'targets/mutter/Makefile.am' | |||
14 | --- targets/mutter/Makefile.am 2010-06-04 11:23:01 +0000 | |||
15 | +++ targets/mutter/Makefile.am 2010-06-10 00:36:28 +0000 | |||
16 | @@ -44,7 +44,6 @@ | |||
17 | 44 | --pkg gee-1.0 \ | 44 | --pkg gee-1.0 \ |
18 | 45 | --pkg indicator \ | 45 | --pkg indicator \ |
19 | 46 | --pkg mutter-2.28 \ | 46 | --pkg mutter-2.28 \ |
20 | 47 | --pkg libwnck-1.0 \ | ||
21 | 48 | --pkg unique-1.0 \ | 47 | --pkg unique-1.0 \ |
22 | 49 | --pkg x11 \ | 48 | --pkg x11 \ |
23 | 50 | --pkg unity-const \ | 49 | --pkg unity-const \ |
24 | 51 | 50 | ||
25 | === modified file 'targets/mutter/expose-manager.vala' | |||
26 | --- targets/mutter/expose-manager.vala 2010-04-26 13:47:08 +0000 | |||
27 | +++ targets/mutter/expose-manager.vala 2010-06-10 00:36:28 +0000 | |||
28 | @@ -26,7 +26,7 @@ | |||
29 | 26 | private Clutter.Actor darken_box; | 26 | private Clutter.Actor darken_box; |
30 | 27 | private bool hovered; | 27 | private bool hovered; |
31 | 28 | 28 | ||
33 | 29 | public unowned Mutter.Window source { get; private set; } | 29 | public unowned Clutter.Actor source { get; private set; } |
34 | 30 | 30 | ||
35 | 31 | public uint8 hovered_opacity { get; set; } | 31 | public uint8 hovered_opacity { get; set; } |
36 | 32 | public uint8 unhovered_opacity { get; set; } | 32 | public uint8 unhovered_opacity { get; set; } |
37 | @@ -41,7 +41,7 @@ | |||
38 | 41 | } | 41 | } |
39 | 42 | } | 42 | } |
40 | 43 | 43 | ||
42 | 44 | public ExposeClone (Mutter.Window source) | 44 | public ExposeClone (Clutter.Actor source) |
43 | 45 | { | 45 | { |
44 | 46 | darken = 0; | 46 | darken = 0; |
45 | 47 | hovered_opacity = 255; | 47 | hovered_opacity = 255; |
46 | @@ -130,7 +130,7 @@ | |||
47 | 130 | { | 130 | { |
48 | 131 | } | 131 | } |
49 | 132 | 132 | ||
51 | 133 | public void start_expose (SList<Wnck.Window> windows) | 133 | public void start_expose (SList<Clutter.Actor> windows) |
52 | 134 | { | 134 | { |
53 | 135 | var controller = Launcher.QuicklistController.get_default (); | 135 | var controller = Launcher.QuicklistController.get_default (); |
54 | 136 | if (controller.menu_is_open ()) | 136 | if (controller.menu_is_open ()) |
55 | @@ -150,36 +150,28 @@ | |||
56 | 150 | expose_group.raise_top (); | 150 | expose_group.raise_top (); |
57 | 151 | expose_group.show (); | 151 | expose_group.show (); |
58 | 152 | 152 | ||
61 | 153 | unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows (); | 153 | foreach (Clutter.Actor actor in windows) |
60 | 154 | foreach (Mutter.Window w in mutter_windows) | ||
62 | 155 | { | 154 | { |
90 | 156 | bool keep = false; | 155 | if (!(actor is Mutter.Window) || |
91 | 157 | ulong xid = (ulong) Mutter.MetaWindow.get_xwindow (w.get_meta_window ()); | 156 | ((actor as Mutter.Window).get_window_type () != Mutter.MetaCompWindowType.NORMAL && |
92 | 158 | foreach (Wnck.Window window in windows) | 157 | (actor as Mutter.Window).get_window_type () != Mutter.MetaCompWindowType.DIALOG && |
93 | 159 | { | 158 | (actor as Mutter.Window).get_window_type () != Mutter.MetaCompWindowType.MODAL_DIALOG)) |
94 | 160 | if (window.get_xid () == xid) | 159 | continue; |
95 | 161 | { | 160 | |
96 | 162 | keep = true; | 161 | ExposeClone clone = new ExposeClone (actor); |
97 | 163 | break; | 162 | clone.set_position (actor.x, actor.y); |
98 | 164 | } | 163 | clone.set_size (actor.width, actor.height); |
99 | 165 | } | 164 | exposed_windows.append (clone); |
100 | 166 | 165 | clone.reactive = true; | |
101 | 167 | if (keep) | 166 | |
102 | 168 | { | 167 | expose_group.add_actor (clone); |
103 | 169 | ExposeClone clone = new ExposeClone (w); | 168 | |
104 | 170 | clone.set_position (w.x, w.y); | 169 | clone.hovered_opacity = hovered_opacity; |
105 | 171 | clone.set_size (w.width, w.height); | 170 | clone.unhovered_opacity = unhovered_opacity; |
106 | 172 | exposed_windows.append (clone); | 171 | clone.opacity = unhovered_opacity; |
107 | 173 | clone.reactive = true; | 172 | clone.darken = darken; |
108 | 174 | 173 | ||
109 | 175 | expose_group.add_actor (clone); | 174 | clone.enter_event.connect (() => { |
83 | 176 | |||
84 | 177 | clone.hovered_opacity = hovered_opacity; | ||
85 | 178 | clone.unhovered_opacity = unhovered_opacity; | ||
86 | 179 | clone.opacity = unhovered_opacity; | ||
87 | 180 | clone.darken = darken; | ||
88 | 181 | |||
89 | 182 | clone.enter_event.connect (() => { | ||
110 | 183 | var ql_controller = Launcher.QuicklistController.get_default (); | 175 | var ql_controller = Launcher.QuicklistController.get_default (); |
111 | 184 | if (ql_controller.menu_is_open () && this.menu_in_hover_close_state) | 176 | if (ql_controller.menu_is_open () && this.menu_in_hover_close_state) |
112 | 185 | { | 177 | { |
113 | @@ -188,7 +180,7 @@ | |||
114 | 188 | return false; | 180 | return false; |
115 | 189 | }); | 181 | }); |
116 | 190 | 182 | ||
118 | 191 | clone.leave_event.connect (() => { | 183 | clone.leave_event.connect (() => { |
119 | 192 | var ql_controller = Launcher.QuicklistController.get_default (); | 184 | var ql_controller = Launcher.QuicklistController.get_default (); |
120 | 193 | if (ql_controller.menu_is_open () && this.menu_in_hover_close_state) | 185 | if (ql_controller.menu_is_open () && this.menu_in_hover_close_state) |
121 | 194 | { | 186 | { |
122 | @@ -196,8 +188,11 @@ | |||
123 | 196 | } | 188 | } |
124 | 197 | return false; | 189 | return false; |
125 | 198 | }); | 190 | }); |
128 | 199 | } | 191 | } |
129 | 200 | 192 | ||
130 | 193 | unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows (); | ||
131 | 194 | foreach (Mutter.Window w in mutter_windows) | ||
132 | 195 | { | ||
133 | 201 | if (w.get_window_type () == Mutter.MetaCompWindowType.DESKTOP) | 196 | if (w.get_window_type () == Mutter.MetaCompWindowType.DESKTOP) |
134 | 202 | continue; | 197 | continue; |
135 | 203 | 198 | ||
136 | 204 | 199 | ||
137 | === modified file 'targets/mutter/plugin.vala' | |||
138 | --- targets/mutter/plugin.vala 2010-06-08 13:50:40 +0000 | |||
139 | +++ targets/mutter/plugin.vala 2010-06-10 00:36:28 +0000 | |||
140 | @@ -238,12 +238,6 @@ | |||
141 | 238 | this.background.lower_bottom (); | 238 | this.background.lower_bottom (); |
142 | 239 | this.background.show (); | 239 | this.background.show (); |
143 | 240 | 240 | ||
144 | 241 | /* Allows us to activate windows, essential as we are the WM */ | ||
145 | 242 | /* | ||
146 | 243 | LibLauncher.Application.set_window_activate_func (this.on_window_activated, | ||
147 | 244 | this.plugin); | ||
148 | 245 | */ | ||
149 | 246 | |||
150 | 247 | this.launcher = new Launcher.Launcher (this); | 241 | this.launcher = new Launcher.Launcher (this); |
151 | 248 | this.launcher.get_view ().opacity = 0; | 242 | this.launcher.get_view ().opacity = 0; |
152 | 249 | 243 | ||
153 | @@ -297,100 +291,9 @@ | |||
154 | 297 | } | 291 | } |
155 | 298 | 292 | ||
156 | 299 | this.ensure_input_region (); | 293 | this.ensure_input_region (); |
157 | 300 | |||
158 | 301 | Wnck.Screen.get_default ().active_window_changed.connect (on_active_window_changed); | ||
159 | 302 | |||
160 | 303 | if (Wnck.Screen.get_default ().get_active_window () != null) | ||
161 | 304 | Wnck.Screen.get_default ().get_active_window ().state_changed.connect (on_active_window_state_changed); | ||
162 | 305 | |||
163 | 306 | return false; | 294 | return false; |
164 | 307 | } | 295 | } |
165 | 308 | 296 | ||
166 | 309 | private static void on_window_activated (Wnck.Window window, | ||
167 | 310 | uint32 timestamp, | ||
168 | 311 | void *data) | ||
169 | 312 | { | ||
170 | 313 | Mutter.Plugin plugin = data as Mutter.Plugin; | ||
171 | 314 | |||
172 | 315 | unowned GLib.List<Mutter.Window> mutter_windows = plugin.get_windows (); | ||
173 | 316 | foreach (Mutter.Window w in mutter_windows) | ||
174 | 317 | { | ||
175 | 318 | ulong xid = (ulong) Mutter.MetaWindow.get_xwindow (w.get_meta_window ()); | ||
176 | 319 | if (window.get_xid () == xid) | ||
177 | 320 | { | ||
178 | 321 | unowned Mutter.MetaWindow win = w.get_meta_window (); | ||
179 | 322 | |||
180 | 323 | Mutter.MetaWorkspace.activate (Mutter.MetaWindow.get_workspace(win), | ||
181 | 324 | timestamp); | ||
182 | 325 | Mutter.MetaWindow.activate (win, timestamp); | ||
183 | 326 | break; | ||
184 | 327 | } | ||
185 | 328 | } | ||
186 | 329 | } | ||
187 | 330 | |||
188 | 331 | private void on_active_window_state_changed (Wnck.WindowState change_mask, Wnck.WindowState new_state) | ||
189 | 332 | { | ||
190 | 333 | check_fullscreen_obstruction (); | ||
191 | 334 | } | ||
192 | 335 | |||
193 | 336 | private void on_active_window_changed (Wnck.Window? previous_window) | ||
194 | 337 | { | ||
195 | 338 | if (previous_window != null) | ||
196 | 339 | previous_window.state_changed.disconnect (on_active_window_state_changed); | ||
197 | 340 | |||
198 | 341 | |||
199 | 342 | Wnck.Window current = Wnck.Screen.get_default ().get_active_window (); | ||
200 | 343 | if (current == null) | ||
201 | 344 | return; | ||
202 | 345 | |||
203 | 346 | current.state_changed.connect (on_active_window_state_changed); | ||
204 | 347 | |||
205 | 348 | check_fullscreen_obstruction (); | ||
206 | 349 | } | ||
207 | 350 | |||
208 | 351 | /* | ||
209 | 352 | private void on_launcher_changed_event (LauncherView? last, LauncherView? current) | ||
210 | 353 | { | ||
211 | 354 | if (last != null) | ||
212 | 355 | { | ||
213 | 356 | last.menu_opened.disconnect (on_launcher_menu_opened); | ||
214 | 357 | last.menu_closed.disconnect (on_launcher_menu_closed); | ||
215 | 358 | } | ||
216 | 359 | |||
217 | 360 | if (current != null) | ||
218 | 361 | { | ||
219 | 362 | current.menu_opened.connect (on_launcher_menu_opened); | ||
220 | 363 | current.menu_closed.connect (on_launcher_menu_closed); | ||
221 | 364 | } | ||
222 | 365 | |||
223 | 366 | check_fullscreen_obstruction (); | ||
224 | 367 | } | ||
225 | 368 | */ | ||
226 | 369 | /* | ||
227 | 370 | |||
228 | 371 | private void on_launcher_menu_opened (LauncherView sender) | ||
229 | 372 | { | ||
230 | 373 | if (sender != quicklauncher.manager.active_launcher || sender == null) | ||
231 | 374 | return; | ||
232 | 375 | |||
233 | 376 | if (sender.model is ApplicationModel && sender.model.is_active) | ||
234 | 377 | { | ||
235 | 378 | if (QuicklistController.get_default ().menu_is_open ()) | ||
236 | 379 | expose_windows ((sender.model as ApplicationModel).windows); | ||
237 | 380 | } | ||
238 | 381 | } | ||
239 | 382 | */ | ||
240 | 383 | /* | ||
241 | 384 | |||
242 | 385 | private void on_launcher_menu_closed (LauncherView sender) | ||
243 | 386 | { | ||
244 | 387 | if (sender != quicklauncher.manager.active_launcher) | ||
245 | 388 | return; | ||
246 | 389 | |||
247 | 390 | dexpose_windows (); | ||
248 | 391 | } | ||
249 | 392 | */ | ||
250 | 393 | |||
251 | 394 | private void got_screensaver_changed (dynamic DBus.Object screensaver, bool changed) | 297 | private void got_screensaver_changed (dynamic DBus.Object screensaver, bool changed) |
252 | 395 | { | 298 | { |
253 | 396 | if (changed) | 299 | if (changed) |
254 | @@ -410,51 +313,23 @@ | |||
255 | 410 | } | 313 | } |
256 | 411 | } | 314 | } |
257 | 412 | 315 | ||
258 | 413 | bool window_is_obstructing (Wnck.Window window) | ||
259 | 414 | { | ||
260 | 415 | if (window.is_fullscreen ()) | ||
261 | 416 | return true; | ||
262 | 417 | |||
263 | 418 | /* Sometimes we're not getting the fullscreen hint updating fast enough | ||
264 | 419 | * but the geometry seems to mostly be in sync. Seeing if the window is | ||
265 | 420 | * size-wise fullscreen seems to give us a good fallback when the props | ||
266 | 421 | * aren't in-sync. | ||
267 | 422 | * The -2.0 is because we have some variation when converting float to int | ||
268 | 423 | * from the stage. | ||
269 | 424 | */ | ||
270 | 425 | int x, y, w, h; | ||
271 | 426 | window.get_geometry (out x, out y, out w, out h); | ||
272 | 427 | |||
273 | 428 | if (w >= (int)this.stage.width - 2.0 | ||
274 | 429 | && h >= (int)this.stage.height - 2.0) | ||
275 | 430 | return true; | ||
276 | 431 | |||
277 | 432 | /* Finally try figuring out if the window is fullscreen in Mutter | ||
278 | 433 | * itself */ | ||
279 | 434 | unowned GLib.List<Mutter.Window> mutter_windows = plugin.get_windows (); | ||
280 | 435 | foreach (Mutter.Window win in mutter_windows) | ||
281 | 436 | { | ||
282 | 437 | ulong xid = (ulong) Mutter.MetaWindow.get_xwindow (win.get_meta_window ()); | ||
283 | 438 | if (xid == window.get_xid ()) | ||
284 | 439 | { | ||
285 | 440 | if (win.width >= ((int)this.stage.width - 2.0) && | ||
286 | 441 | win.height >= ((int)this.stage.height - 2.0)) | ||
287 | 442 | { | ||
288 | 443 | return true; | ||
289 | 444 | } | ||
290 | 445 | } | ||
291 | 446 | } | ||
292 | 447 | |||
293 | 448 | return false; | ||
294 | 449 | } | ||
295 | 450 | |||
296 | 451 | void check_fullscreen_obstruction () | 316 | void check_fullscreen_obstruction () |
297 | 452 | { | 317 | { |
300 | 453 | Wnck.Window current = Wnck.Screen.get_default ().get_active_window (); | 318 | Mutter.Window focus = null; |
301 | 454 | if (current == null) | 319 | bool fullscreen = false; |
302 | 320 | |||
303 | 321 | unowned GLib.List<Mutter.Window> mutter_windows = plugin.get_windows (); | ||
304 | 322 | foreach (Mutter.Window w in mutter_windows) | ||
305 | 323 | { | ||
306 | 324 | if (Mutter.MetaWindow.has_focus (w.get_meta_window ())) | ||
307 | 325 | focus = w; | ||
308 | 326 | } | ||
309 | 327 | |||
310 | 328 | if (focus == null) | ||
311 | 455 | return; | 329 | return; |
314 | 456 | 330 | ||
315 | 457 | if (window_is_obstructing (current)) | 331 | (focus.get_meta_window () as GLib.Object).get ("fullscreen", ref fullscreen); |
316 | 332 | if (fullscreen) | ||
317 | 458 | { | 333 | { |
318 | 459 | this.launcher.get_view ().animate (Clutter.AnimationMode.EASE_IN_SINE, 200, "x", -100f); | 334 | this.launcher.get_view ().animate (Clutter.AnimationMode.EASE_IN_SINE, 200, "x", -100f); |
319 | 460 | this.panel.animate (Clutter.AnimationMode.EASE_IN_SINE, 200, "opacity", 0); | 335 | this.panel.animate (Clutter.AnimationMode.EASE_IN_SINE, 200, "opacity", 0); |
320 | @@ -576,24 +451,12 @@ | |||
321 | 576 | return; | 451 | return; |
322 | 577 | } | 452 | } |
323 | 578 | 453 | ||
324 | 454 | GLib.SList <Clutter.Actor> windows = null; | ||
325 | 455 | |||
326 | 579 | unowned GLib.List<Mutter.Window> mutter_windows = this.plugin.get_windows (); | 456 | unowned GLib.List<Mutter.Window> mutter_windows = this.plugin.get_windows (); |
327 | 580 | |||
328 | 581 | GLib.SList <Wnck.Window> windows = null; | ||
329 | 582 | |||
330 | 583 | foreach (Mutter.Window window in mutter_windows) | 457 | foreach (Mutter.Window window in mutter_windows) |
331 | 584 | { | 458 | { |
344 | 585 | int type = window.get_window_type (); | 459 | windows.append (window as Clutter.Actor); |
333 | 586 | |||
334 | 587 | if (type == Mutter.MetaWindowType.NORMAL || | ||
335 | 588 | type == Mutter.MetaWindowType.DIALOG || | ||
336 | 589 | type == Mutter.MetaWindowType.MODAL_DIALOG | ||
337 | 590 | ) | ||
338 | 591 | { | ||
339 | 592 | ulong xid = (ulong) Mutter.MetaWindow.get_xwindow (window.get_meta_window ()); | ||
340 | 593 | Wnck.Window wnck_window = Wnck.Window.get (xid); | ||
341 | 594 | if (wnck_window is Wnck.Window) | ||
342 | 595 | windows.append (wnck_window); | ||
343 | 596 | } | ||
345 | 597 | } | 460 | } |
346 | 598 | 461 | ||
347 | 599 | this.expose_windows (windows, 80); | 462 | this.expose_windows (windows, 80); |
348 | @@ -609,58 +472,69 @@ | |||
349 | 609 | for (int i = 0; i < xids.length; i++) | 472 | for (int i = 0; i < xids.length; i++) |
350 | 610 | { | 473 | { |
351 | 611 | uint32 xid = xids.index (i); | 474 | uint32 xid = xids.index (i); |
355 | 612 | Wnck.Window window = Wnck.Window.get (xid); | 475 | |
356 | 613 | if (window is Wnck.Window) | 476 | unowned GLib.List<Mutter.Window> mutter_windows = this.plugin.get_windows (); |
357 | 614 | window.close (Clutter.get_current_event_time ()); | 477 | foreach (Mutter.Window window in mutter_windows) |
358 | 478 | { | ||
359 | 479 | uint32 wxid = (uint32) Mutter.MetaWindow.get_xwindow (window.get_meta_window ()); | ||
360 | 480 | if (wxid == xid) | ||
361 | 481 | { | ||
362 | 482 | Mutter.MetaWindow.delete (window.get_meta_window (), Clutter.get_current_event_time ()); | ||
363 | 483 | } | ||
364 | 484 | } | ||
365 | 615 | } | 485 | } |
366 | 616 | } | 486 | } |
367 | 617 | 487 | ||
372 | 618 | public void expose_xids (Array<uint32> xids) | 488 | public void expose_xids (Array<uint32> xids) |
373 | 619 | { | 489 | { |
374 | 620 | SList<Wnck.Window> windows = new SList<Wnck.Window> (); | 490 | SList<Clutter.Actor> windows = new SList<Clutter.Actor> (); |
375 | 621 | for (int i = 0; i < xids.length; i++) | 491 | for (int i = 0; i < xids.length; i++) |
376 | 622 | { | 492 | { |
377 | 623 | uint32 xid = xids.index (i); | 493 | uint32 xid = xids.index (i); |
381 | 624 | Wnck.Window window = Wnck.Window.get (xid); | 494 | |
382 | 625 | if (window is Wnck.Window) | 495 | unowned GLib.List<Mutter.Window> mutter_windows = plugin.get_windows (); |
383 | 626 | windows.append (window); | 496 | foreach (Mutter.Window w in mutter_windows) |
384 | 497 | { | ||
385 | 498 | uint32 wxid = (uint32) Mutter.MetaWindow.get_xwindow (w.get_meta_window ()); | ||
386 | 499 | if (wxid == xid) | ||
387 | 500 | { | ||
388 | 501 | windows.append (w); | ||
389 | 502 | break; | ||
390 | 503 | } | ||
391 | 504 | } | ||
392 | 627 | } | 505 | } |
395 | 628 | expose_windows (windows); | 506 | |
396 | 629 | } | 507 | expose_windows (windows); |
397 | 508 | } | ||
398 | 630 | 509 | ||
403 | 631 | public void stop_expose () | 510 | public void stop_expose () |
404 | 632 | { | 511 | { |
405 | 633 | dexpose_windows (); | 512 | dexpose_windows (); |
406 | 634 | } | 513 | } |
407 | 635 | 514 | ||
408 | 636 | public void show_window (uint32 xid) | 515 | public void show_window (uint32 xid) |
409 | 637 | { | 516 | { |
412 | 638 | Wnck.Window window = Wnck.Window.get (xid); | 517 | unowned GLib.List<Mutter.Window> mutter_windows = this.plugin.get_windows (); |
413 | 639 | if (window is Wnck.Window) | 518 | |
414 | 519 | foreach (Mutter.Window mutter_window in mutter_windows) | ||
415 | 640 | { | 520 | { |
439 | 641 | unowned GLib.List<Mutter.Window> mutter_windows = this.plugin.get_windows (); | 521 | ulong window_xid = (ulong) Mutter.MetaWindow.get_xwindow (mutter_window.get_meta_window ()); |
440 | 642 | 522 | if (window_xid != xid) | |
441 | 643 | foreach (Mutter.Window mutter_window in mutter_windows) | 523 | continue; |
442 | 644 | { | 524 | |
443 | 645 | int type = mutter_window.get_window_type (); | 525 | int type = mutter_window.get_window_type (); |
444 | 646 | 526 | ||
445 | 647 | if (type == Mutter.MetaWindowType.NORMAL || | 527 | if (type != Mutter.MetaWindowType.NORMAL && |
446 | 648 | type == Mutter.MetaWindowType.DIALOG || | 528 | type != Mutter.MetaWindowType.DIALOG && |
447 | 649 | type == Mutter.MetaWindowType.MODAL_DIALOG | 529 | type != Mutter.MetaWindowType.MODAL_DIALOG) |
448 | 650 | ) | 530 | continue; |
449 | 651 | { | 531 | |
450 | 652 | ulong window_xid = (ulong) Mutter.MetaWindow.get_xwindow (mutter_window.get_meta_window ()); | 532 | uint32 time_; |
451 | 653 | if (window_xid == xid) | 533 | unowned Mutter.MetaWindow meta = mutter_window.get_meta_window (); |
452 | 654 | { | 534 | |
453 | 655 | uint32 time_; | 535 | time_ = Mutter.MetaDisplay.get_current_time (Mutter.MetaWindow.get_display (meta)); |
454 | 656 | unowned Mutter.MetaWindow meta = mutter_window.get_meta_window (); | 536 | Mutter.MetaWorkspace.activate (Mutter.MetaWindow.get_workspace (meta), time_); |
455 | 657 | 537 | Mutter.MetaWindow.activate (meta, time_); | |
433 | 658 | time_ = Mutter.MetaDisplay.get_current_time (Mutter.MetaWindow.get_display (meta)); | ||
434 | 659 | Mutter.MetaWorkspace.activate (Mutter.MetaWindow.get_workspace (meta), time_); | ||
435 | 660 | Mutter.MetaWindow.activate (meta, time_); | ||
436 | 661 | } | ||
437 | 662 | } | ||
438 | 663 | } | ||
456 | 664 | } | 538 | } |
457 | 665 | } | 539 | } |
458 | 666 | 540 | ||
459 | @@ -674,7 +548,7 @@ | |||
460 | 674 | return this.panel.get_indicators_width (); | 548 | return this.panel.get_indicators_width (); |
461 | 675 | } | 549 | } |
462 | 676 | 550 | ||
464 | 677 | public void expose_windows (GLib.SList<Wnck.Window> windows, | 551 | public void expose_windows (GLib.SList<Clutter.Actor> windows, |
465 | 678 | int left_buffer = 250) | 552 | int left_buffer = 250) |
466 | 679 | { | 553 | { |
467 | 680 | expose_manager.left_buffer = left_buffer; | 554 | expose_manager.left_buffer = left_buffer; |
468 | @@ -801,21 +675,6 @@ | |||
469 | 801 | { | 675 | { |
470 | 802 | this.maximus.process_window (window); | 676 | this.maximus.process_window (window); |
471 | 803 | this.window_mapped (this, window); | 677 | this.window_mapped (this, window); |
472 | 804 | |||
473 | 805 | /* | ||
474 | 806 | int type = window.get_window_type (); | ||
475 | 807 | |||
476 | 808 | if (type == Mutter.MetaWindowType.NORMAL || | ||
477 | 809 | type == Mutter.MetaWindowType.DIALOG || | ||
478 | 810 | type == Mutter.MetaWindowType.MODAL_DIALOG | ||
479 | 811 | ) | ||
480 | 812 | { | ||
481 | 813 | ulong xid = (ulong) Mutter.MetaWindow.get_xwindow (window.get_meta_window ()); | ||
482 | 814 | Wnck.Window wnck_window = Wnck.Window.get (xid); | ||
483 | 815 | if (wnck_window is Wnck.Window) | ||
484 | 816 | Launcher.Session.get_default ().update_windows (wnck_window); | ||
485 | 817 | } | ||
486 | 818 | */ | ||
487 | 819 | } | 678 | } |
488 | 820 | 679 | ||
489 | 821 | public void destroy (Mutter.Window window) | 680 | public void destroy (Mutter.Window window) |
490 | 822 | 681 | ||
491 | === modified file 'targets/mutter/window-management.vala' | |||
492 | --- targets/mutter/window-management.vala 2010-03-16 20:37:10 +0000 | |||
493 | +++ targets/mutter/window-management.vala 2010-06-10 00:36:28 +0000 | |||
494 | @@ -295,20 +295,16 @@ | |||
495 | 295 | 295 | ||
496 | 296 | int speed = get_animation_speed (window); | 296 | int speed = get_animation_speed (window); |
497 | 297 | 297 | ||
498 | 298 | ulong xid = (ulong) Mutter.MetaWindow.get_xwindow (window.get_meta_window ()); | ||
499 | 299 | Wnck.Window wnck_window = Wnck.Window.get (xid); | ||
500 | 300 | |||
501 | 301 | Mutter.MetaRectangle rect = {0, 0, 0, 0}; | 298 | Mutter.MetaRectangle rect = {0, 0, 0, 0}; |
504 | 302 | if (wnck_window is Wnck.Window && | 299 | if (Mutter.MetaWindow.get_icon_geometry (window.get_meta_window (), rect)) |
503 | 303 | Mutter.MetaWindow.get_icon_geometry (window.get_meta_window (), rect)) | ||
505 | 304 | { | 300 | { |
508 | 305 | int x, y, w, h; | 301 | rect = {0, 0, 0, 0}; |
509 | 306 | wnck_window.get_geometry (out x, out y, out w, out h); | 302 | Mutter.MetaWindow.get_outer_rect (window.get_meta_window (), rect); |
510 | 307 | actor.set ("scale-gravity", Clutter.Gravity.CENTER); | 303 | actor.set ("scale-gravity", Clutter.Gravity.CENTER); |
511 | 308 | anim = actor.animate (Clutter.AnimationMode.EASE_IN_SINE, speed, | 304 | anim = actor.animate (Clutter.AnimationMode.EASE_IN_SINE, speed, |
512 | 309 | "opacity", 255, | 305 | "opacity", 255, |
515 | 310 | "x", (float) x, | 306 | "x", (float) rect.x, |
516 | 311 | "y", (float) y, | 307 | "y", (float) rect.y, |
517 | 312 | "scale-x", 1f, | 308 | "scale-x", 1f, |
518 | 313 | "scale-y", 1f); | 309 | "scale-y", 1f); |
519 | 314 | } | 310 | } |
520 | 315 | 311 | ||
521 | === modified file 'targets/unity/Makefile.am' | |||
522 | --- targets/unity/Makefile.am 2010-06-04 16:13:17 +0000 | |||
523 | +++ targets/unity/Makefile.am 2010-06-10 00:36:28 +0000 | |||
524 | @@ -44,7 +44,6 @@ | |||
525 | 44 | --pkg x11 \ | 44 | --pkg x11 \ |
526 | 45 | --pkg gtk+-2.0 \ | 45 | --pkg gtk+-2.0 \ |
527 | 46 | --pkg gee-1.0 \ | 46 | --pkg gee-1.0 \ |
528 | 47 | --pkg libwnck-1.0 \ | ||
529 | 48 | --pkg unique-1.0 \ | 47 | --pkg unique-1.0 \ |
530 | 49 | --pkg unity \ | 48 | --pkg unity \ |
531 | 50 | --pkg unity-const \ | 49 | --pkg unity-const \ |
532 | 51 | 50 | ||
533 | === modified file 'targets/unity/main.vala' | |||
534 | --- targets/unity/main.vala 2010-04-07 15:39:23 +0000 | |||
535 | +++ targets/unity/main.vala 2010-06-10 00:36:28 +0000 | |||
536 | @@ -191,7 +191,6 @@ | |||
537 | 191 | }); | 191 | }); |
538 | 192 | } | 192 | } |
539 | 193 | 193 | ||
540 | 194 | Wnck.set_client_type (Wnck.ClientType.PAGER); | ||
541 | 195 | Gtk.main (); | 194 | Gtk.main (); |
542 | 196 | 195 | ||
543 | 197 | /* Restore envvar */ | 196 | /* Restore envvar */ |
544 | 198 | 197 | ||
545 | === modified file 'tests/ui/Makefile.am' | |||
546 | --- tests/ui/Makefile.am 2010-06-09 03:02:57 +0000 | |||
547 | +++ tests/ui/Makefile.am 2010-06-10 00:36:28 +0000 | |||
548 | @@ -38,7 +38,6 @@ | |||
549 | 38 | --pkg indicator \ | 38 | --pkg indicator \ |
550 | 39 | --pkg clutk-0.3 \ | 39 | --pkg clutk-0.3 \ |
551 | 40 | --pkg launcher-0.3 \ | 40 | --pkg launcher-0.3 \ |
552 | 41 | --pkg libwnck-1.0 \ | ||
553 | 42 | --pkg test-const \ | 41 | --pkg test-const \ |
554 | 43 | --pkg unique-1.0 \ | 42 | --pkg unique-1.0 \ |
555 | 44 | --pkg unity \ | 43 | --pkg unity \ |
556 | 45 | 44 | ||
557 | === modified file 'tests/unit/Makefile.am' | |||
558 | --- tests/unit/Makefile.am 2010-06-04 17:03:39 +0000 | |||
559 | +++ tests/unit/Makefile.am 2010-06-10 00:36:28 +0000 | |||
560 | @@ -39,7 +39,6 @@ | |||
561 | 39 | --pkg indicator \ | 39 | --pkg indicator \ |
562 | 40 | --pkg clutk-0.3 \ | 40 | --pkg clutk-0.3 \ |
563 | 41 | --pkg launcher-0.3 \ | 41 | --pkg launcher-0.3 \ |
564 | 42 | --pkg libwnck-1.0 \ | ||
565 | 43 | --pkg test-const \ | 42 | --pkg test-const \ |
566 | 44 | --pkg unique-1.0 \ | 43 | --pkg unique-1.0 \ |
567 | 45 | --pkg unity \ | 44 | --pkg unity \ |
568 | 46 | 45 | ||
569 | === modified file 'unity-private/testing/test-window.vala' | |||
570 | --- unity-private/testing/test-window.vala 2010-06-02 22:38:51 +0000 | |||
571 | +++ unity-private/testing/test-window.vala 2010-06-10 00:36:28 +0000 | |||
572 | @@ -237,7 +237,7 @@ | |||
573 | 237 | /* | 237 | /* |
574 | 238 | * UNDERLAY WINDOW MANAGEMENT | 238 | * UNDERLAY WINDOW MANAGEMENT |
575 | 239 | */ | 239 | */ |
577 | 240 | public void on_active_window_changed (Wnck.Window? previous_window) | 240 | private void on_active_window_changed (Wnck.Window? previous_window) |
578 | 241 | { | 241 | { |
579 | 242 | Wnck.Window new_window = this.wnck_screen.get_active_window (); | 242 | Wnck.Window new_window = this.wnck_screen.get_active_window (); |
580 | 243 | if (new_window == null) | 243 | if (new_window == null) |
581 | 244 | 244 | ||
582 | === modified file 'unity/Makefile.am' | |||
583 | --- unity/Makefile.am 2010-06-03 10:22:01 +0000 | |||
584 | +++ unity/Makefile.am 2010-06-10 00:36:28 +0000 | |||
585 | @@ -49,7 +49,6 @@ | |||
586 | 49 | --pkg gtk+-2.0 \ | 49 | --pkg gtk+-2.0 \ |
587 | 50 | --pkg gee-1.0 \ | 50 | --pkg gee-1.0 \ |
588 | 51 | --pkg Bamf-0.2 \ | 51 | --pkg Bamf-0.2 \ |
589 | 52 | --pkg libwnck-1.0 \ | ||
590 | 53 | --pkg unique-1.0 \ | 52 | --pkg unique-1.0 \ |
591 | 54 | --pkg unity-const \ | 53 | --pkg unity-const \ |
592 | 55 | $(MAINTAINER_VALAFLAGS) | 54 | $(MAINTAINER_VALAFLAGS) |
seems to work okay for me, approved