Show Desktop state does not toggle when there are no windows

Bug #1079460 reported by Francis Ginther
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ayatana Design
Fix Committed
High
John Lea
Unity
Fix Released
High
Brandon Schaefer
unity (Ubuntu)
Fix Released
High
Brandon Schaefer

Bug Description

Super+Ctrl+d (or whatever show desktop is bound to) does not toggle the state of PluginAdapter._in_show_desktop when there are no windows open. This can be observed with the attached autopilot test, test_queryshowdesktop.py.

[Test Case]
0. Copy test_queryshowdesktop.py to $unity_source/tests/autopilot/unity/tests/
1. Open some windows.
2. from a ssh or other remote login:
2.a. export DISPLAY=:0.0
2.b. cd $unity_source/tests/autopilot
2.c. autopilot run -v unity.tests.test_queryshowdesktop

Observe - "showdesktop state" should follow with what is stated in the test log output.

3. Close all windows on the unity display.
4. repeat 2.c.

Observe - the test will fail because it cannot leave showdesktop mode once it's entered. Note, the showdesktop state is initially 0 meaning disabled, meaning that closing all the windows does not enable showdesktop mode.
Expected - showdesktop state should continue to toggle with the show desktop key.

If this is expected behavior, some autopilot tests need some work.

Related branches

Revision history for this message
Francis Ginther (fginther) wrote :
description: updated
Omer Akram (om26er)
Changed in unity:
importance: Undecided → Low
Revision history for this message
Francis Ginther (fginther) wrote :

I believe this is the root cause of a large number of autopilot failures when run via the ssh method (when there are no windows open on the unity desktop). The failures have stack traces similar to this:
Traceback (most recent call last):
  File "/home/fginther/work/unity/unity/tests/autopilot/unity/tests/__init__.py", line 109, in check_test_behavior
    self.window_manager.leave_show_desktop()
  File "/home/fginther/work/unity/unity/tests/autopilot/unity/emulators/window_manager.py", line 46, in leave_show_desktop
    self.showdesktop_active.wait_for(False)
  File "/usr/lib/python2.7/dist-packages/autopilot/introspection/dbus.py", line 172, in wait_for
    % (self.parent.__class__.__name__, self.name, failure_msg))
AssertionError: After 10 seconds test on WindowManager.showdesktop_active failed: False != dbus.Boolean(True, variant_level=1)

The log will also show:
13:07:42.891 INFO __init__:83 - Checking system state for badly behaving test...
13:07:53.501 WARNING __init__:108 - Test left the system in show desktop mode, e
xiting it...
13:07:53.580 INFO window_manager:41 - Leaving show desktop mode.
13:07:53.581 DEBUG X11:125 - Pressing keys 'Ctrl+Super+d' with delay 0.200000
13:07:53.581 DEBUG X11:212 - Sending press event for key: Control_L
13:07:53.783 DEBUG X11:212 - Sending press event for key: Super_L
13:07:53.985 DEBUG X11:212 - Sending press event for key: d
13:07:54.187 DEBUG X11:144 - Releasing keys 'Ctrl+Super+d' with delay 0.200000
13:07:54.188 DEBUG X11:215 - Sending release event for key: d
13:07:54.390 DEBUG X11:215 - Sending release event for key: Super_L
13:07:54.593 DEBUG X11:215 - Sending release event for key: Control_L

The general problem is that autopilot checks the state of showdesktop at the end of each test and attempts to leave it if it is set. As this can't be done when there are no windows open, there is a chance of this failure at the end of each test.

Revision history for this message
Martin Mrazik (mrazik) wrote :

I'm changing the importance of this to High (but I'm even tempted to change it to Critical).

This might not have a huge impact to ordinary users but it has a big impact on the testability of unity. Given that we want to have continuous deployment of unity releases with fully automated testing then testability support is critical. Please talk to me in case you disagree with the importance.

Changed in unity:
importance: Low → High
Revision history for this message
Francis Ginther (fginther) wrote :

This may not be something that can be easily 'fixed', it may just be the way it is. So, a change to the unity autopilot tests to get back into the desired showdesktop state after running a test is here:
https://code.launchpad.net/~fginther/unity/autopilot-showdesktop-cleanup/+merge/134756

This isn't a 100% solution as a test can still get into a state where it cannot leave showdesktop active mode.

Revision history for this message
Francis Ginther (fginther) wrote :

We really Ayatana design to provide input on the proper behavior of show desktop mode. Some scenarios and questions to consider:
 - changing showdesktop mode while no windows are open
 - opening the first window
 - closing the last window
 - opening a new window when existing windows are minimized due to show desktop mode being active
 - initial mode after login
 - What actions can alter the state of showdesktop mode?

Changed in unity:
milestone: none → 7.0.0
John Lea (johnlea)
Changed in ayatana-design:
status: New → Fix Committed
Changed in unity:
status: New → Triaged
Changed in ayatana-design:
importance: Undecided → High
assignee: nobody → John Lea (johnlea)
John Lea (johnlea)
Changed in unity (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

One of the failing tests because of this problem has the following bug assigned: #1082444 .

Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.0.0 → 7.0.1
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Manually testing this now, and show desktop toggles fine for me. Must have been fixed with the new changes that went into showdesktop. So ill link that branch as a fix for this.

Im not able to run test_queryshowdesktop.py, but I've a print statement in ::ShowDesktop(), and it is toggling just fine on an empty desktop.

If you have a list of any failing tests that you still see attributed to this, let me know!

The branch where the new show desktop stuff landed:
https://code.launchpad.net/~brandontschaefer/unity/show-desktop-fix/+merge/172399

Related bug:
Bug 966030

Changed in unity (Ubuntu):
assignee: nobody → Brandon Schaefer (brandontschaefer)
Changed in unity:
assignee: nobody → Brandon Schaefer (brandontschaefer)
status: Triaged → Fix Committed
Changed in unity (Ubuntu):
status: Triaged → Fix Committed
Changed in unity:
status: Fix Committed → Fix Released
Changed in unity (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Also to note, there is new behavior for show desktop. As soon as a new window is mapped, show desktop toggles off. So this can no longer be a problem, unless the tests are waiting for it to be off when no windows are mapped (but that wont be an issue anyway..as it toggles fine). As when ever a new window is mapped, show desktop is false.

If this is proved to still be a problem, we will need to decide what should happen as there is new behavior now for show desktop.

I also have all the show desktop tests passing locally here.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.