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
=== modified file 'playground/demo-shell/window_manager.cpp'
--- playground/demo-shell/window_manager.cpp 2015-05-12 13:59:51 +0000
+++ playground/demo-shell/window_manager.cpp 2015-05-13 07:37:33 +0000
@@ -438,22 +438,26 @@
438438
439 handled = true;439 handled = true;
440 }440 }
441 if (action == mir_pointer_action_motion && vscroll)
442 {
443 float alpha = surf->alpha();
444 alpha += 0.1f * vscroll;
445 if (alpha < 0.0f)
446 alpha = 0.0f;
447 else if (alpha > 1.0f)
448 alpha = 1.0f;
449 surf->set_alpha(alpha);
450 handled = true;
451 }
452441
453 old_pos = surf->top_left();442 old_pos = surf->top_left();
454 old_size = surf->size();443 old_size = surf->size();
455 }444 }
456445
446 if (surf &&
447 (modifiers & mir_input_event_modifier_alt) &&
448 action == mir_pointer_action_motion &&
449 vscroll)
450 {
451 float alpha = surf->alpha();
452 alpha += 0.1f * vscroll;
453 if (alpha < 0.0f)
454 alpha = 0.0f;
455 else if (alpha > 1.0f)
456 alpha = 1.0f;
457 surf->set_alpha(alpha);
458 handled = true;
459 }
460
457 old_cursor = cursor;461 old_cursor = cursor;
458 return handled;462 return handled;
459}463}

Subscribers

People subscribed via source and target branches