Bug 17296

Summary: [PATCH] Compiz doesn't reset _NET_SHOWING_DESKTOP
Product: xorg Reporter: Michael Terry <michael.terry>
Component: App/compizAssignee: David Reveman <reveman>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: minor    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Proposed patch none

Description Michael Terry 2008-08-25 06:13:12 UTC
Created attachment 18505 [details] [review]
Proposed patch

The _NET_SHOWING_DESKTOP property should be set to 0 when a window is shown, thereby indicating that compiz is no longer "showing the desktop".

This would match Metacity's behavior more closely and allow the standard GNOME "Show Desktop" panel applet to work correctly:

Metacity & "Show Desktop":
1) Open some windows
2) Press "Show Desktop", note how windows are hidden and button is depressed
3) Unminimize a window or open a new window, note how button is now popped back up (because Metacity set _NET_SHOWING_DESKTOP to 0)
4) Press "Show Desktop" again, note how only the new window is hidden again.

Compiz & "Show Desktop":
1) Open some windows
2) Press "Show Desktop", note how windows are hidden and button is depressed
3) Unminimize a window or open a new window, note how button does not change
4) Press "Show Desktop" again, note how it pops back up and unminimizes previously hidden windows.  This is unexpected, since if I have windows obscuring the desktop and I press "Show Desktop", I want to see the desktop.

So, the fix seems easy enough.  Whenever a window is shown in compiz, unset the _NET_SHOWING_DESKTOP (for some user-useful definition of window -- obviously not popup menus and the like).

I'm attaching a patch, but I know it isn't perfect, because I don't know compiz internals well.  It basically adds two checkpoints for unsetting _NET_SHOWING_DESKTOP -- when showing a window and creating a window.  I copied the logic for what kind of windows 'count' for unsetting the property from the logic deciding which windows to hide when "Show Desktop" is pressed (in screen.c:enterShowDesktopMode()).  However, the 'managed' flag doesn't seem to be correctly set at create-window time?  So I had to create a copy of focusWindow() that ignored it.  I'm open to feedback.  :)
Comment 1 Adam Jackson 2018-06-12 19:07:11 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.