Mir

Merge lp:~vanvugt/mir/fix-1454518 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 2570
Proposed branch: lp:~vanvugt/mir/fix-1454518
Merge into: lp:mir
Diff against target: 41 lines (+15/-11)
1 file modified
playground/demo-shell/window_manager.cpp (+15/-11)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1454518
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Alexandros Frantzis (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+258964@code.launchpad.net

Commit message

Fix opacity controls to correctly respond to Alt+mousewheel again.
In r2564 they were accidentally changed to only respond to the scroll
wheel when a button was also held down (LP: #1454518)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

OK.

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

OK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'playground/demo-shell/window_manager.cpp'
2--- playground/demo-shell/window_manager.cpp 2015-05-12 13:59:51 +0000
3+++ playground/demo-shell/window_manager.cpp 2015-05-13 07:37:33 +0000
4@@ -438,22 +438,26 @@
5
6 handled = true;
7 }
8- if (action == mir_pointer_action_motion && vscroll)
9- {
10- float alpha = surf->alpha();
11- alpha += 0.1f * vscroll;
12- if (alpha < 0.0f)
13- alpha = 0.0f;
14- else if (alpha > 1.0f)
15- alpha = 1.0f;
16- surf->set_alpha(alpha);
17- handled = true;
18- }
19
20 old_pos = surf->top_left();
21 old_size = surf->size();
22 }
23
24+ if (surf &&
25+ (modifiers & mir_input_event_modifier_alt) &&
26+ action == mir_pointer_action_motion &&
27+ vscroll)
28+ {
29+ float alpha = surf->alpha();
30+ alpha += 0.1f * vscroll;
31+ if (alpha < 0.0f)
32+ alpha = 0.0f;
33+ else if (alpha > 1.0f)
34+ alpha = 1.0f;
35+ surf->set_alpha(alpha);
36+ handled = true;
37+ }
38+
39 old_cursor = cursor;
40 return handled;
41 }

Subscribers

People subscribed via source and target branches