Menu interaction in fully maximised window causes the next click on the title bar to restore the window (after 2^31ms of uptime)

Bug #1379960 reported by Simon Arlott on 2014-10-10
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Compiz
Undecided
Unassigned
Nux
Fix Released
Medium
Simon Arlott
Trusty
Triaged
Medium
Unassigned
Unity
Invalid
Undecided
Unassigned
nux (Ubuntu)
Medium
Simon Arlott
Nominated for Trusty by Stephen M. Webb

Bug Description

(Using the Terminal window as an example)
1. Open a Terminal window
2. Maximise a window fully so that its title bar and menu share the top Unity panel
3. Click the "View" menu (the menu opens)
4. Click the "Search" menu (the "View" menu closes)
5. Click anywhere on the title bar
6. The window restores to non-maximised size

It shouldn't do this, only a double-click should restore the window.

Alternative ways to trigger it:
3. Click the "Terminal" menu
4. Click the "Reset" option
5. Click anywhere on the title bar

3. Click the "Terminal" menu
4. Click inside the main area of the application
5. Click anywhere on the title bar

It looks like something is going wrong with the double-click detection when a menu is opened and then closed.

Version: Ubuntu 14.04.1
unity 7.2.2+14.04.20140714-0ubuntu1.1
xorg 1:7.7+1ubuntu8

Related branches

Simon Arlott (sa.me.uk) wrote :

This only happens after the system has been running for a while, so either a long running service stops behaving correctly or a software upgrade causes it to stop working correctly. I logged in as a Guest Session and the problem still occurred, but it doesn't happen immediately after a reboot.

Simon Arlott (sa.me.uk) wrote :

Even restarting Xorg doesn't fix this, only a reboot resolves it.

com/canonical/unity/integrated-menus/double-click-wait is set to the default (0ms)

If I set it to 300ms, then menu opening is delayed by 300ms but step 6 (The window restores to non-maximised size) occurs immediately upon clicking as soon as the button is pressed (even if it is not released).

Simon Arlott (sa.me.uk) wrote :

This is a bug in libnux-4.0-0 on amd64, caused by the code in GraphicsDisplay::MousePress (NuxGraphics/GraphicsDisplayX11.cpp) which converts the unsigned long timestamp to a signed int:

if ((double_click_counter_ == 1) && ((int)current_time - (int)last_click_time_ < double_click_time_delay))

The timestamp is in milliseconds, so it becomes negative after about 24.86 days.

The comparison works ok until the final click on the title bar, when last_click_time_ is 0.
Subtracting 0 from the negative current_time results in a value that is always less than double_click_time_delay.
The unnecessary cast to int should be removed.

Version:
libnux-4.0-0 4.0.7+14.10.20141007-0ubuntu1

Simon Arlott (sa.me.uk) wrote :

The bug affects unity via compiz (which uses libnux).

Version:
compiz 1:0.9.12+14.10.20140918-0ubuntu1

Simon Arlott (sa.me.uk) wrote :
summary: Menu interaction in fully maximised window causes the next click on the
- title bar to restore the window
+ title bar to restore the window (after 2^31ms of uptime)
Paul Sladen (sladen) wrote :

Simon: excellent work. I have a particular fondness for reading the write-ups on this time of bug. It reminds me a little of the infamous "Doesn't print on Tuesdays" (bug #248619).

Once again, kudos to gradually narrowing down how to replicate it, then finding it and finally offering the patch.

Changed in nux:
status: New → Confirmed
affects: unity (Ubuntu) → nux (Ubuntu)
Changed in nux (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium

The attachment "Patch for nux-4.0.7+14.10.20141007" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in compiz:
status: New → Invalid
Changed in unity:
status: New → Invalid
Changed in nux:
status: Confirmed → In Progress
Changed in nux (Ubuntu):
status: Confirmed → In Progress
Changed in nux:
importance: Undecided → Medium
milestone: none → 4.0.7
assignee: nobody → Simon Arlott (sa.me.uk)
Changed in nux (Ubuntu):
assignee: nobody → Simon Arlott (sa.me.uk)
Stephen M. Webb (bregma) on 2015-08-11
Changed in nux:
status: In Progress → Fix Committed
Stephen M. Webb (bregma) on 2015-08-12
Changed in nux:
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nux - 4.0.7+15.10.20150802-0ubuntu1

---------------
nux (4.0.7+15.10.20150802-0ubuntu1) wily; urgency=medium

  [ CI Train Bot ]
  * New rebuild forced.

  [ Simon Arlott ]
  * fix the size of timeout values on 64-bit platforms (thanks Simon
    Arlott) (LP: #1379960)

  [ Stephen M. Webb ]
  * fixed a FTBFS when using GCC-5

 -- CI Train Bot <email address hidden> Sun, 02 Aug 2015 14:35:23 +0000

Changed in nux (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers