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
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2013-04-08 23:26:54 +0000
+++ plugins/unityshell/src/unityshell.cpp 2013-04-10 18:15:25 +0000
@@ -1867,8 +1867,6 @@
1867{1867{
1868 if (!grab_index_)1868 if (!grab_index_)
1869 grab_index_ = screen->pushGrab (screen->invisibleCursor(), "unity-switcher");1869 grab_index_ = screen->pushGrab (screen->invisibleCursor(), "unity-switcher");
1870 if (!grab_index_)
1871 return false;
18721870
1873 screen->addAction(&optionGetAltTabRight());1871 screen->addAction(&optionGetAltTabRight());
1874 screen->addAction(&optionGetAltTabDetailStart());1872 screen->addAction(&optionGetAltTabDetailStart());
@@ -1929,24 +1927,24 @@
1929 // remove grab before calling hide so workspace switcher doesn't fail1927 // remove grab before calling hide so workspace switcher doesn't fail
1930 screen->removeGrab(grab_index_, NULL);1928 screen->removeGrab(grab_index_, NULL);
1931 grab_index_ = 0;1929 grab_index_ = 0;
1932
1933 screen->removeAction(&optionGetAltTabRight ());
1934 screen->removeAction(&optionGetAltTabDetailStart ());
1935 screen->removeAction(&optionGetAltTabDetailStop ());
1936 screen->removeAction(&optionGetAltTabLeft ());
1937
1938 /* Removing the scroll actions */
1939 CompAction scroll_up;
1940 CompAction scroll_down;
1941 scroll_up.setButton(CompAction::ButtonBinding(local::SCROLL_UP_BUTTON, action->key().modifiers()));
1942 scroll_down.setButton(CompAction::ButtonBinding(local::SCROLL_DOWN_BUTTON, action->key().modifiers()));
1943 screen->removeAction(&scroll_up);
1944 screen->removeAction(&scroll_down);
1945
1946 bool accept_state = (state & CompAction::StateCancel) == 0;
1947 switcher_controller_->Hide(accept_state);
1948 }1930 }
19491931
1932 screen->removeAction(&optionGetAltTabRight ());
1933 screen->removeAction(&optionGetAltTabDetailStart ());
1934 screen->removeAction(&optionGetAltTabDetailStop ());
1935 screen->removeAction(&optionGetAltTabLeft ());
1936
1937 /* Removing the scroll actions */
1938 CompAction scroll_up;
1939 CompAction scroll_down;
1940 scroll_up.setButton(CompAction::ButtonBinding(local::SCROLL_UP_BUTTON, action->key().modifiers()));
1941 scroll_down.setButton(CompAction::ButtonBinding(local::SCROLL_DOWN_BUTTON, action->key().modifiers()));
1942 screen->removeAction(&scroll_up);
1943 screen->removeAction(&scroll_down);
1944
1945 bool accept_state = (state & CompAction::StateCancel) == 0;
1946 switcher_controller_->Hide(accept_state);
1947
1950 action->setState (action->state() & (unsigned)~(CompAction::StateTermKey));1948 action->setState (action->state() & (unsigned)~(CompAction::StateTermKey));
1951 return true;1949 return true;
1952}1950}