Merge lp:~azzar1/unity/fix-dnd-alttab into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 3350
Proposed branch: lp:~azzar1/unity/fix-dnd-alttab
Merge into: lp:unity
Diff against target: 53 lines (+16/-18)
1 file modified
plugins/unityshell/src/unityshell.cpp (+16/-18)
To merge this branch: bzr merge lp:~azzar1/unity/fix-dnd-alttab
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Marco Trevisan (Treviño) Approve
Review via email: mp+158182@code.launchpad.net

Commit message

Allow alt-tabbing during a dnd operation.

Description of the change

== Problem ==
#111939: Alt-Tab - Not possible to alt-tab during a drag-and-drop operation.

== Fix ==
Don't require mouse grabbing during alt-tab. Try to get it, but if the mouse is already grabbed (during the dnd the mouse grabbing belongs to the source window), perform the alt-tab anyway.

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
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks good to me

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2013-04-08 23:26:54 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2013-04-10 18:15:25 +0000
4@@ -1867,8 +1867,6 @@
5 {
6 if (!grab_index_)
7 grab_index_ = screen->pushGrab (screen->invisibleCursor(), "unity-switcher");
8- if (!grab_index_)
9- return false;
10
11 screen->addAction(&optionGetAltTabRight());
12 screen->addAction(&optionGetAltTabDetailStart());
13@@ -1929,24 +1927,24 @@
14 // remove grab before calling hide so workspace switcher doesn't fail
15 screen->removeGrab(grab_index_, NULL);
16 grab_index_ = 0;
17-
18- screen->removeAction(&optionGetAltTabRight ());
19- screen->removeAction(&optionGetAltTabDetailStart ());
20- screen->removeAction(&optionGetAltTabDetailStop ());
21- screen->removeAction(&optionGetAltTabLeft ());
22-
23- /* Removing the scroll actions */
24- CompAction scroll_up;
25- CompAction scroll_down;
26- scroll_up.setButton(CompAction::ButtonBinding(local::SCROLL_UP_BUTTON, action->key().modifiers()));
27- scroll_down.setButton(CompAction::ButtonBinding(local::SCROLL_DOWN_BUTTON, action->key().modifiers()));
28- screen->removeAction(&scroll_up);
29- screen->removeAction(&scroll_down);
30-
31- bool accept_state = (state & CompAction::StateCancel) == 0;
32- switcher_controller_->Hide(accept_state);
33 }
34
35+ screen->removeAction(&optionGetAltTabRight ());
36+ screen->removeAction(&optionGetAltTabDetailStart ());
37+ screen->removeAction(&optionGetAltTabDetailStop ());
38+ screen->removeAction(&optionGetAltTabLeft ());
39+
40+ /* Removing the scroll actions */
41+ CompAction scroll_up;
42+ CompAction scroll_down;
43+ scroll_up.setButton(CompAction::ButtonBinding(local::SCROLL_UP_BUTTON, action->key().modifiers()));
44+ scroll_down.setButton(CompAction::ButtonBinding(local::SCROLL_DOWN_BUTTON, action->key().modifiers()));
45+ screen->removeAction(&scroll_up);
46+ screen->removeAction(&scroll_down);
47+
48+ bool accept_state = (state & CompAction::StateCancel) == 0;
49+ switcher_controller_->Hide(accept_state);
50+
51 action->setState (action->state() & (unsigned)~(CompAction::StateTermKey));
52 return true;
53 }