[unity 5.6] Using Alt+F1 or Alt+F2 sends a ";3P" or ";3Q" to the active windows

Bug #943456 reported by Sebastien Bacher on 2012-02-29
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Unity
Fix Released
High
Sam Spilsbury
Unity Distro Priority
High
Unassigned
unity (Ubuntu)
High
Unassigned

Bug Description

Using the current 5.6 pre version from the ppa:

- run your preferred command line application under X (g-t, byobu, ...)
- press alt-f2
- the dash "run a command" open but notice that ";3Q" is printed on your command line prompt as well

(the issue is probably not specific to command lines but most applications ignore such key sequences)

Related branches

tags: added: unity-5.6
tags: added: rc-5.4.0+bzr2041ubuntu0+654
removed: unity-5.6
tags: added: unity-5.6
removed: rc-5.4.0+bzr2041ubuntu0+654
Changed in unity:
status: New → Confirmed
Changed in unity (Ubuntu):
status: New → Confirmed
Changed in unity:
importance: Undecided → Medium
Changed in unity (Ubuntu):
importance: Undecided → Medium
Changed in unity:
milestone: none → 5.6.0
Changed in compiz-core:
status: New → Triaged
Changed in compiz-core:
assignee: nobody → Daniel van Vugt (vanvugt)
Changed in compiz-core:
milestone: none → 0.9.7.0
milestone: 0.9.7.0 → 0.9.7.2
status: Triaged → In Progress
importance: Undecided → Medium
Didier Roche (didrocks) wrote :

@Daniel: this doesn't seem to be a compiz issue, I can't reproduce it with unity 5.4 (in precise) + latest compiz in the ppa alone

Didier Roche (didrocks) wrote :

Setting as high as we don't want to release a regression.

Changed in compiz-core:
importance: Medium → High
Changed in unity (Ubuntu):
importance: Medium → High
Changed in unity:
importance: Medium → High
Changed in unity-distro-priority:
status: New → Fix Committed
importance: Undecided → High
Daniel van Vugt (vanvugt) wrote :

This appears to be a Unity bug. Gnome terminal is correctly receiving the Alt+F2 keystroke because Unity has told compiz that it has not consumed the keystroke (returning false):

bool UnityScreen::executeCommand(CompAction* action,
                                 CompAction::State state,
                                 CompOption::Vector& options)
{
  SendExecuteCommand();
  return false;
}

So the terminal will receive the Alt+F2 escape code which is ^[O1;3Q
Gnome terminal at least, does not understand such Alt escape codes in the terminal. So it consumes the standard part of the input up to the semicolon (^[O1), and outputs the rest (;3Q) as regular text.

This bug should be fixed simply by changing UnityScreen::executeCommand to return true. That tells compiz that the key combination should not be passed to the app.

The fact that this bug was never visible before seems to have been a bug in compiz-core, which is obviously now fixed.

no longer affects: compiz-core
Daniel van Vugt (vanvugt) wrote :

For some reason I can't reproduce this bug. And I can't upgrade my precise machine to test the latest packages. But I think you will find this patch is the fix.

The attachment "fix-943456.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch

I notice this happens in oneiric too (unity 4 / compiz 0.9.6). Pressing unused key combinations like Alt+F3 or Alt+F12 outputs part of the control code to the gnome-terminal window.

Daniel van Vugt (vanvugt) wrote :

See also similar bug 944521.

Daniel van Vugt (vanvugt) wrote :

OK, I have found the two causes of this bug. Half in Unity half in compiz.

1. As per comment #3, Unity key callbacks return false, which means compiz should pass the keys on to apps. They should be returning true.

2. Compiz incorrectly passes the keys though to apps even if a plugin has handled it and returned true. But only if a plugin is bound to <modifier> and the user presses <modifier>+<other-key>. Like Unity is bound to <Alt> and you press <Alt+F2>

summary: - [unity 5.6] using alt-f2 send a ";3Q" to the active windows
+ [unity 5.6] Using Alt+F1 or Alt+F2 sends a ";3P" or ";3Q" to the active
+ windows
Changed in compiz-core:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Daniel van Vugt (vanvugt)
milestone: none → 0.9.7.2
Changed in unity:
status: Confirmed → In Progress
assignee: nobody → Daniel van Vugt (vanvugt)
Daniel van Vugt (vanvugt) wrote :

Sorry I made a mistake in setting up my test environment. There is nothing that needs fixing in compiz-core. I can confirm that simply changing the Initiate callbacks in unityshell.cpp to return true will prevent the Alt+Fn key codes from reaching the active window.

I was right in comment #3.

no longer affects: compiz-core
Daniel van Vugt (vanvugt) wrote :

Sam's branch looks right. Could someone please assign this bug to smspillaz? LP won't let me.

Changed in unity:
assignee: Daniel van Vugt (vanvugt) → nobody
Tim Penhey (thumper) on 2012-03-04
Changed in unity:
assignee: nobody → Sam Spilsbury (smspillaz)
Changed in unity:
status: In Progress → Fix Committed
tags: added: alt-key
Didier Roche (didrocks) on 2012-03-12
Changed in unity:
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :
Download full text (4.1 KiB)

This bug was fixed in the package unity - 5.6.0-0ubuntu1

---------------
unity (5.6.0-0ubuntu1) precise; urgency=low

  * New upstream release.
    - compiz crashed with SIGSEGV in g_type_check_instance_cast()
      (LP: #862972)
    - compiz crashed with SIGABRT in __gnu_cxx::__verbose_terminate_handler()
      (LP: #926793)
    - compiz crashed with SIGSEGV in gdk_pixbuf_get_width() (LP: #937421)
    - Unity causes ibus to not work correctly (spaces incorrectly placed)
      (LP: #880876)
    - Dash - update Dash keyboard shortcuts so the 'CTRL + TAB' switches
      between Lenses and 'TAB' by itself moves the focus between categories
      (LP: #891648)
    - HUD - closing a window with <Alt>+<F4> opens the hud (LP: #923410)
    - unity-applications-daemon crashed with SIGSEGV in
      dee_sequence_model_free_row() (LP: #916356)
    - Launcher, Window Management - Launcher reveal should not be triggered
      when dragging a window (LP: #928805)
    - lenses are loaded on start, should be lazy loaded (LP: #929506)
    - Trash icon jumps about when trying to drag an icon onto it (LP: #932365)
    - HUD loses keypresses for the first second after opening (LP: #932906)
    - HUD doesn't give the focus back to the active application after dash/hud
      use (LP: #934061)
    - Launcher - unpinned apps show with empty pips in the launcher as if they
      exist on another workspace (LP: #937898)
    - Unity Dash should support Keywords parameter in .desktop (formerly X
      -GNOME-Keywords or X-AppInstall-Keywords) (LP: #941231)
    - Support FD.o Desktop Actions spec (LP: #942042)
    - Unity hangs when touching my touchpad/trackpad (LP: #942625)
    - [regression] Pressing alt doesn't show the menu title bar in top panel
      (LP: #943194)
    - Alt + F (or other mnemonic) doesn't work in gnome-terminal (LP: #943239)
    - [unity 5.6] Using Alt+F1 or Alt+F2 sends a ";3P" or ";3Q" to the active
      windows (LP: #943456)
    - [unity 5.6] holding alt and pressing a direction opens the alt-tab list
      in a buggy way (LP: #943902)
    - [unity-5.6] can't enter accents (^o->) in the dash since recent updates
      (LP: #944674)
    - Dash - Keyboard navigation for search filters is broken (LP: #844033)
    - Dash - If mouse highlights one icon in grid, keyboard navigation
      highlights another, so there are 2 highlighted icons (LP: #817436)
    - Alt+Tab default delay of 150ms is too long (LP: #888636)
    - Keyboard shortcut - F10 shortcut is used to show menu and this is wrong
      (LP: #878492)
    - Dash - Currently the app lens doesn't show applications that are
      available for purchase (LP: #916121)
    - Chromium is running, but not showing in launcher or alt-tab.
      (LP: #918474)
    - Dash - Different states of rating stars, and dimensions (LP: #924884)
    - alt-tab confused by a multiple instances of an application on different
      workspaces (LP: #925484)
    - Launcher - Icons are not colorized properly (LP: #930949)
    - Remove glow from Alt-tab edge and Search Field image assets
      (LP: #933578)
    - "Left Mouse Drag" and "Middle Mouse Drag" should be translatable
      (LP: #930510)
    - Launcher switcher...

Read more...

Changed in unity (Ubuntu):
status: Confirmed → Fix Released
Didier Roche (didrocks) on 2012-04-17
Changed in unity-distro-priority:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers