Merge lp:~alan-griffiths/miral/fix-1673038 into lp:miral

Proposed by Alan Griffiths
Status: Merged
Approved by: Brandon Schaefer
Approved revision: 536
Merged at revision: 536
Proposed branch: lp:~alan-griffiths/miral/fix-1673038
Merge into: lp:miral
Diff against target: 33 lines (+19/-5)
1 file modified
miral-shell/decoration_provider.cpp (+19/-5)
To merge this branch: bzr merge lp:~alan-griffiths/miral/fix-1673038
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
Cemil Azizoglu (community) Approve
Review via email: mp+319919@code.launchpad.net

Commit message

[miral-shell] Handle a titlebar decoration being deleted before it is fully created and painted for the first time.

To post a comment you must log in.
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

ok

review: Approve
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'miral-shell/decoration_provider.cpp'
2--- miral-shell/decoration_provider.cpp 2017-03-08 10:19:10 +0000
3+++ miral-shell/decoration_provider.cpp 2017-03-15 12:40:13 +0000
4@@ -401,11 +401,25 @@
5 });
6 }
7
8- enqueue_work([this, window]
9- {
10- std::lock_guard<decltype(mutex)> lock{mutex};
11- window_to_titlebar.erase(window);
12- });
13+ if (data->titlebar.load())
14+ {
15+ enqueue_work([this, window]
16+ {
17+ std::lock_guard<decltype(mutex)> lock{mutex};
18+ window_to_titlebar.erase(window);
19+ });
20+ }
21+ else
22+ {
23+ data->on_create = [this, window](MirWindow*)
24+ {
25+ enqueue_work([this, window]
26+ {
27+ std::lock_guard<decltype(mutex)> lock{mutex};
28+ window_to_titlebar.erase(window);
29+ });
30+ };
31+ }
32 }
33 }
34

Subscribers

People subscribed via source and target branches