Merge lp:~vanvugt/unity/fix-953783-trunk into lp:unity

Proposed by Daniel van Vugt
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: no longer in the source branch.
Merged at revision: 2110
Proposed branch: lp:~vanvugt/unity/fix-953783-trunk
Merge into: lp:unity
Diff against target: 82 lines (+30/-5)
2 files modified
manual-tests/AltCombos.txt (+10/-0)
plugins/unityshell/src/unityshell.cpp (+20/-5)
To merge this branch: bzr merge lp:~vanvugt/unity/fix-953783-trunk
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+97353@code.launchpad.net

Description of the change

Don't absorb Alt+ArrowKey (et al) events if you're not doing anything with
them. Ensures unused events get sent to the active window. (LP: #953783)

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

works well here. The code makes sense and I distro-patched it for ubuntu for now. Approving.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'manual-tests/AltCombos.txt'
--- manual-tests/AltCombos.txt 1970-01-01 00:00:00 +0000
+++ manual-tests/AltCombos.txt 2012-03-14 09:20:23 +0000
@@ -0,0 +1,10 @@
1Alt+Arrow keys not passed to application
2----------------------------------------
3Tests that Alt+ArrowKey events are correctly passed to the active window
4when Unity is not responding to them.
5
6#. Open gnome-terminal
7#. While holding Alt, tap arrow keys: Up, Down, Right, Left
8
9Outcome
10 The terminal should show the keycodes were received as text "ABCD".
011
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-03-13 20:44:08 +0000
+++ plugins/unityshell/src/unityshell.cpp 2012-03-14 09:20:23 +0000
@@ -1767,33 +1767,45 @@
1767bool UnityScreen::altTabPrevAllInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)1767bool UnityScreen::altTabPrevAllInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
1768{1768{
1769 if (switcher_controller_->Visible())1769 if (switcher_controller_->Visible())
1770 {
1770 switcher_controller_->Prev();1771 switcher_controller_->Prev();
1772 return true;
1773 }
17711774
1772 return true;1775 return false;
1773}1776}
17741777
1775bool UnityScreen::altTabPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)1778bool UnityScreen::altTabPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
1776{1779{
1777 if (switcher_controller_->Visible())1780 if (switcher_controller_->Visible())
1781 {
1778 switcher_controller_->Prev();1782 switcher_controller_->Prev();
1783 return true;
1784 }
17791785
1780 return true;1786 return false;
1781}1787}
17821788
1783bool UnityScreen::altTabDetailStartInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)1789bool UnityScreen::altTabDetailStartInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
1784{1790{
1785 if (switcher_controller_->Visible())1791 if (switcher_controller_->Visible())
1792 {
1786 switcher_controller_->SetDetail(true);1793 switcher_controller_->SetDetail(true);
1794 return true;
1795 }
17871796
1788 return true;1797 return false;
1789}1798}
17901799
1791bool UnityScreen::altTabDetailStopInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)1800bool UnityScreen::altTabDetailStopInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
1792{1801{
1793 if (switcher_controller_->Visible())1802 if (switcher_controller_->Visible())
1803 {
1794 switcher_controller_->SetDetail(false);1804 switcher_controller_->SetDetail(false);
1805 return true;
1806 }
17951807
1796 return true;1808 return false;
1797}1809}
17981810
1799bool UnityScreen::altTabNextWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)1811bool UnityScreen::altTabNextWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
@@ -1813,9 +1825,12 @@
1813bool UnityScreen::altTabPrevWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)1825bool UnityScreen::altTabPrevWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)
1814{1826{
1815 if (switcher_controller_->Visible())1827 if (switcher_controller_->Visible())
1828 {
1816 switcher_controller_->PrevDetail();1829 switcher_controller_->PrevDetail();
1830 return true;
1831 }
18171832
1818 return true;1833 return false;
1819}1834}
18201835
1821bool UnityScreen::launcherSwitcherForwardInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)1836bool UnityScreen::launcherSwitcherForwardInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options)