Mir

Merge lp:~alan-griffiths/mir/avoid-possible-error into lp:mir

Proposed by Alan Griffiths
Status: Merged
Approved by: Andreas Pokorny
Approved revision: no longer in the source branch.
Merged at revision: 3006
Proposed branch: lp:~alan-griffiths/mir/avoid-possible-error
Merge into: lp:mir
Diff against target: 29 lines (+7/-7)
1 file modified
examples/server_example_canonical_window_manager.cpp (+7/-7)
To merge this branch: bzr merge lp:~alan-griffiths/mir/avoid-possible-error
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+273809@code.launchpad.net

Commit message

examples: keep titlebar around until it can't be needed.

Description of the change

examples: keep titlebar around until it can't be needed.

Andreas spotted this exception: http://paste.ubuntu.com/12713256/

Which seems to occur because the last surface in the only session is being deleted, the titlebar is first forgotten, then an attempt made to focus on the "next" session which leads to the *same* surface being made active. That leads to an attempt to repaint the titlebar using "info" about the titlebar that was forgotten earlier. Boom!

To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

What I don't see is why I can't reproduce.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

this fixes the exceptions being thrown around during shutdown..
and I am no longer able to reproduce the seg fault that

review: Approve
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

.. that plagued the krillins on ci recently.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/server_example_canonical_window_manager.cpp'
2--- examples/server_example_canonical_window_manager.cpp 2015-10-02 01:56:04 +0000
3+++ examples/server_example_canonical_window_manager.cpp 2015-10-08 10:35:11 +0000
4@@ -595,18 +595,18 @@
5 }
6 }
7
8+ if (!--tools->info_for(session).surfaces && session == tools->focused_session())
9+ {
10+ active_surface_.reset();
11+ tools->focus_next_session();
12+ select_active_surface(tools->focused_surface());
13+ }
14+
15 if (info.titlebar)
16 {
17 tools->forget(info.titlebar);
18 session->destroy_surface(info.titlebar_id);
19 }
20-
21- if (!--tools->info_for(session).surfaces && session == tools->focused_session())
22- {
23- active_surface_.reset();
24- tools->focus_next_session();
25- select_active_surface(tools->focused_surface());
26- }
27 }
28
29 int me::CanonicalWindowManagerPolicyCopy::handle_set_state(std::shared_ptr<ms::Surface> const& surface, MirSurfaceState value)

Subscribers

People subscribed via source and target branches