Merge lp:~alan-griffiths/miral/workaround-1627697 into lp:miral

Proposed by Alan Griffiths
Status: Merged
Approved by: Gerry Boland
Approved revision: 362
Merged at revision: 370
Proposed branch: lp:~alan-griffiths/miral/workaround-1627697
Merge into: lp:miral
Diff against target: 56 lines (+21/-0)
2 files modified
miral-shell/titlebar_window_manager.cpp (+16/-0)
miral-shell/titlebar_window_manager.h (+5/-0)
To merge this branch: bzr merge lp:~alan-griffiths/miral/workaround-1627697
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+306774@code.launchpad.net

Commit message

Workaround for gnome-terminal crashes on resize (lp:1627697)

Description of the change

Workaround for gnome-terminal crashes on resize (lp:1627697)

Empirically 20ms avoids a problem without visual glitches.

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

I'd prefer you explain the change in the commit message, not just pointing to a bug report

Is this a workaround for a toolkit problem?

How did you derive the 20 milliseconds? Can it be a resize event per frame instead?

review: Needs Information
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> I'd prefer you explain the change in the commit message, not just pointing to
> a bug report
>
> Is this a workaround for a toolkit problem?

Likely. Andreas has it on his list to investigate (gnome-terminal works in unusual ways).

> How did you derive the 20 milliseconds? Can it be a resize event per frame
> instead?

WM doesn't have access to frame timings.

Revision history for this message
Gerry Boland (gerboland) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'miral-shell/titlebar_window_manager.cpp'
2--- miral-shell/titlebar_window_manager.cpp 2016-09-23 12:09:50 +0000
3+++ miral-shell/titlebar_window_manager.cpp 2016-09-26 16:12:05 +0000
4@@ -78,6 +78,14 @@
5
6 if (mir_pointer_event_button_state(event, mir_pointer_button_tertiary))
7 {
8+ { // Workaround for lp:1627697
9+ auto now = std::chrono::steady_clock::now();
10+ if (resizing && now < last_resize+std::chrono::milliseconds(20))
11+ return true;
12+
13+ last_resize = now;
14+ }
15+
16 if (!resizing)
17 tools.select_active_window(tools.window_at(old_cursor));
18 is_resize_event = resize(tools.active_window(), cursor, old_cursor);
19@@ -217,6 +225,14 @@
20 auto new_pos = window.top_left() + delta;
21 Size new_size{new_width, new_height};
22
23+ { // Workaround for lp:1627697
24+ auto now = std::chrono::steady_clock::now();
25+ if (pinching && now < last_resize+std::chrono::milliseconds(20))
26+ return true;
27+
28+ last_resize = now;
29+ }
30+
31 WindowSpecification modifications;
32 modifications.top_left() = new_pos;
33 modifications.size() = new_size;
34
35=== modified file 'miral-shell/titlebar_window_manager.h'
36--- miral-shell/titlebar_window_manager.h 2016-09-16 14:23:18 +0000
37+++ miral-shell/titlebar_window_manager.h 2016-09-26 16:12:05 +0000
38@@ -23,6 +23,8 @@
39
40 #include "spinner/splash.h"
41
42+#include <chrono>
43+
44 namespace miral { class InternalClientLauncher; }
45
46 using namespace mir::geometry;
47@@ -98,6 +100,9 @@
48 Displacement& delta,
49 Width& new_width,
50 Height& new_height) const;
51+
52+ // Workaround for lp:1627697
53+ std::chrono::steady_clock::time_point last_resize;
54 };
55
56 #endif //MIRAL_SHELL_TITLEBAR_WINDOW_MANAGER_H

Subscribers

People subscribed via source and target branches