Merge lp:~tombeckmann/gala/workspace-appears-focused-crash into lp:gala

Proposed by Tom Beckmann
Status: Merged
Merged at revision: 311
Proposed branch: lp:~tombeckmann/gala/workspace-appears-focused-crash
Merge into: lp:gala
Diff against target: 65 lines (+37/-4)
1 file modified
src/Plugin.vala (+37/-4)
To merge this branch: bzr merge lp:~tombeckmann/gala/workspace-appears-focused-crash
Reviewer Review Type Date Requested Status
Rico Tzschichholz Approve
Review via email: mp+155080@code.launchpad.net

Description of the change

This solves the meta_window_appears_focused crashes happening during workspace switch by making sure a clone is destroied when its source is removed.

To post a comment you must log in.
Revision history for this message
Tom Beckmann (tombeckmann) wrote :
309. By Tom Beckmann

Delete the clones list in watch_windows

310. By Tom Beckmann

Add info about the window if watch_window is called when it should not be called

311. By Tom Beckmann

Add a warning about the closed window

Revision history for this message
Rico Tzschichholz (ricotz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Plugin.vala'
2--- src/Plugin.vala 2013-03-20 16:04:50 +0000
3+++ src/Plugin.vala 2013-03-23 15:25:23 +0000
4@@ -665,6 +665,25 @@
5 Clutter.Actor? out_group;
6 Clutter.Actor? moving_window_container;
7
8+ void watch_window (Meta.Workspace workspace, Meta.Window window)
9+ {
10+ if (clones == null) {
11+ critical ("watch_window called on '%s' while not switching workspaces", window.get_title ());
12+ return;
13+ }
14+
15+ warning ("Dock window '%s' closed while switching workspaces", window.get_title ());
16+
17+ // finding the correct window here is not so easy
18+ // and for those default 400ms we can live with
19+ // some windows disappearing which in fact should never
20+ // happen unless a dock crashes
21+ foreach (var clone in clones) {
22+ clone.destroy ();
23+ }
24+ clones = null;
25+ }
26+
27 public override void switch_workspace (int from, int to, MotionDirection direction)
28 {
29 if (!AnimationSettings.get_default ().enable_animations || AnimationSettings.get_default ().workspace_switch_duration == 0) {
30@@ -744,6 +763,14 @@
31 }
32 }
33
34+ // monitor the workspaces to see whether a window was removed
35+ // in which case we need to stop the clones from drawing
36+ // we monitor every workspace here because finding the ones a
37+ // particular dock belongs to did not seem reliable enough
38+ foreach (var workspace in screen.get_workspaces ()) {
39+ workspace.window_removed.connect (watch_window);
40+ }
41+
42 in_group.set_position (-x2, -y2);
43 group.set_child_above_sibling (in_group, null);
44 if (moving_window_container != null)
45@@ -784,10 +811,16 @@
46 clutter_actor_reparent (window, par.nth_data (i));
47 }
48
49- clones.foreach ((clone) => {
50- clone.destroy ();
51- });
52- clones = null;
53+ foreach (var workspace in screen.get_workspaces ()) {
54+ workspace.window_removed.disconnect (watch_window);
55+ }
56+
57+ if (clones != null) {
58+ foreach (var clone in clones) {
59+ clone.destroy ();
60+ }
61+ clones = null;
62+ }
63
64 win = null;
65 par = null;

Subscribers

People subscribed via source and target branches