Merge lp://qastaging/~smspillaz/unity/unity.fix_943456 into lp://qastaging/unity

Proposed by Sam Spilsbury
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 2049
Proposed branch: lp://qastaging/~smspillaz/unity/unity.fix_943456
Merge into: lp://qastaging/unity
Diff against target: 189 lines (+30/-18)
1 file modified
plugins/unityshell/src/unityshell.cpp (+30/-18)
To merge this branch: bzr merge lp://qastaging/~smspillaz/unity/unity.fix_943456
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Neil J. Patel (community) Needs Fixing
Gord Allott (community) Needs Fixing
Sam Spilsbury (community) Approve
Daniel van Vugt Approve
Review via email: mp+95505@code.qastaging.launchpad.net

Commit message

Fix the Alt+F1 or Alt+F2 sending a ";3P" or ";3Q" to the active windows issue, and also fixes some alt holding showing menus. Compiz-core fix needed for complete fix.

Description of the change

== Problem Desc ==

Pressing unity keybindings would result in those keys being replayed in application

== Fix ==

Return true in the action handlers, telling compiz that we actually handled the keys

== Test Coverage ==

Existing key press and key release manual tests / AP tests

UNBLOCK

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This is the same as my fix, which I was about to propose. Except that this one fixes many more key combos. Not just Alt+F1/Alt+F2.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh, nice. This should fix bug 943223 too:

25 panel_controller_->StartFirstMenuShow();
26 - return false;
27 + return true;

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

My previous comment is a *maybe*.

Revision history for this message
Sam Spilsbury (smspillaz) :
review: Approve
Revision history for this message
Gord Allott (gordallott) wrote :

Somehow seems to cause an issue when re-focusing a terminal/sometimes other windows - the terminal gets pushed to an edge, either top or bottom in my experience, confirmed through neil also if you need testers/can't reproduce.

A bit of debugging i noticed that if i removed the PluginAdapter::restoreInputFocus() call from HUDs hide method the issue no longer happens. of course the previously focused window no longer recieves focus when the hud closes if this method is removed.

review: Needs Fixing
Revision history for this message
Neil J. Patel (njpatel) wrote :

I also get the same as Gord, but additionally sometimes the global menu gets stuck in "showing" mode, so even switching apps, I can still see the global menu on the panel (File Edit View ...)

review: Needs Fixing
Revision history for this message
Mirco Müller (macslow) wrote :

I locally merged this branch with current trunk, compiled and ran it. This is the outcome of the test...

Bugs actually fixed by this branch:
 #943456
 #943239
 #943194

Bugs still occuring running this branch:
 #943223

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

> Somehow seems to cause an issue when re-focusing a terminal/sometimes other
> windows - the terminal gets pushed to an edge, either top or bottom in my
> experience, confirmed through neil also if you need testers/can't reproduce.
>
> A bit of debugging i noticed that if i removed the
> PluginAdapter::restoreInputFocus() call from HUDs hide method the issue no
> longer happens. of course the previously focused window no longer recieves
> focus when the hud closes if this method is removed.

This isn't an issue with this branch in particular, but with some other part of the focus code, so it needs to be fixed separately.

Revision history for this message
Tim Penhey (thumper) wrote :

OK. I've tested this branch too.

I've unlinked the Alt+F10 bug that this branch doesn't fix.

Also showing the menus works in gnome-terminal, but not in Qt, XUL apps, or chromium for me now. I did notice a compiz-core branch from Daniel over the weekend that may well impact those apps too. We should check ASAP.

I think this branch is worth landing as is, as it fixes expected interaction between compiz and unity. Yes there may well be focus issues, but that is separate, and shouldn't block this landing.

review: Approve
Revision history for this message
Tim Penhey (thumper) wrote :

I am wondering if we'll still need the forceKeyboardUngrab for the hud reveal with the compiz fix.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

forceKeyboardUngrab is to work around bug 943194. I think we do need it for now, at least until a fix is done for compiz-core (none yet). I will be having another look at bug 943194 and all the Alt issues this week.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

WARNING:
I suspect the forceKeyboardUngrab hack might cause a potentially serious regression. It looks like holding Alt for more than 250 milliseconds will break the grab and disable tap/non-tap detection. So if someone takes more than 250ms to press Alt+something, then that will be detected as a spurious Alt tap and trigger the HUD.

I hope I'm wrong...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Nevermind. I just noticed this which makes the hack safe:

  if (current_time - last_hud_show_time_ > (local::ALT_TAP_DURATION * 1000))
  {
    LOG_DEBUG(logger) << "Tap too long";
    return false;
  }

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

175 + g_timeout_add(local::ALT_TAP_DURATION, forceKeyboardUngrab, (gpointer) this);

This is causing the regression described by bug #948227 :/

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.