Bug 6023 - ToggleShowDesktop does not restore windows with cairo-dock detached plugins.
Status: REOPENED
Alias: None
Product: Openbox
Classification: Unclassified
Component: general
Version: git-master
Hardware: PC Linux
: P3 normal
Assignee: Dana Jansens
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2013-09-04 09:21 EDT by Jehan
Modified: 2013-09-11 01:25:14 EDT
0 users

See Also:



Description Jehan 2013-09-04 09:21:00 EDT
Hi,

I've recently reinstalled openbox, from git master.
I have a keybind which ToggleShowDesktop, and it works well to hide windows, but it won't show back windows. No window has been reshown in the meantime. Even an immediate double ToggleShowDesktop leaves the desktop empty.

Reproduction steps:

1/ Have some windows open on your desktop.
2/ Raise a ToggleShowDesktop using your keybind. Windows get hidden as expected.
3/ Immediately raise another ToggleShowDesktop using the same keybind.

Expected: windows which got hidden but the previous ToggleShowDesktop should get raised back so that you end up in same state as the start.

Actual Result: all windows stay hidden.
Comment 1 Dana Jansens 2013-09-04 10:16:15 EDT
This works for me. Can you determine if this happens only if certain applications are running? Or what is different that is causing this behaviour?

You are certain you don't have any other key bindings on the same key? Or other actions in the same keybind?
Comment 2 Jehan 2013-09-04 11:19:43 EDT
Ok I have investigated a little.

Actually I use cairo-dock. And the "unhiding" fails because of it. If I quit cairo-dock, ToggleShowDesktop works as expected both to hide and unhide.
I imagine since cairo-dock stays up even when we show the desktop, it would unset the _NET_SHOWING_DESKTOP or something? But that's kind of a shame a dock is considered as a normal window.

Can't openbox and cairo-dock interact well together? Or is there a bug in cairo-dock?
Comment 3 Dana Jansens 2013-09-04 11:32:33 EDT
They should, this action works fine with other panel/docks. I wonder what does the dock's _OB_APP_TYPE property say (from the xprop command).
Comment 4 Jehan 2013-09-04 20:45:13 EDT
Hi,

the _OB_APP_TYPE is "dock":
_OB_APP_TYPE(UTF8_STRING) = "dock"
_OB_APP_TITLE(UTF8_STRING) = "cairo-dock"

But I investigated further. I have a "clock" plugin I detached from the dock because I wanted it to show always in background (some kind of "desktop widget" then).

_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "clock"

If I deactivate this plugin (or reattach it to the dock), ToggleShowDesktop works fine. Is it a bug with this kind of plugin? Should I open a bug ticket to cairo-dock team? If so, if you have anything I can tell them to have their detached plugins behave as "widget" and not block normal ToggleShowDesktop behavior, I'd appreciate. :-)
Comment 5 Dana Jansens 2013-09-08 12:38:48 EDT
Wow, cairo-dock is really neet. So anyhow..

So right, because openbox hides "normal" windows, it hides the clock. The clock then immediately shows itself again, causing openbox to not restore stuff.

I think the clock should be a type "dock" or type "desktop" window (depending if they want it above or below other windows).

Otherwise, if the window is going to be a "normal" window, it shouldn't try to prevent itself from being hidden.
Comment 6 Dana Jansens 2013-09-08 12:49:10 EDT
The clock plugin is actually doing a MapRequest, and then also a NET_ACTIVE_WINDOW request when it is hidden, which also causes it to take focus. It seems rather misbehaved in this regard.

Here's openbox debug output when I toggle desktop with it present:

Openbox-Debug: UnmapNotify for window 0x3400030 eventwin 0x3400030 sendevent 0 ignores left 1
Openbox-Debug: UnmapNotify for window 0x3200003 eventwin 0x3200003 sendevent 0 ignores left 1
Openbox-Debug: UnmapNotify for window 0x2e0849a eventwin 0x2e0849a sendevent 0 ignores left 1
Openbox-Debug: UnmapNotify for window 0x2e084a4 eventwin 0x2e084a4 sendevent 0 ignores left 1
Openbox-Debug: UnmapNotify for window 0x2e084ae eventwin 0x2e084ae sendevent 0 ignores left 1
Openbox-Debug: UnmapNotify for window 0x2e084b8 eventwin 0x2e084b8 sendevent 0 ignores left 1
Openbox-Debug: UnmapNotify for window 0x16039aa eventwin 0x16039aa sendevent 0 ignores left 1
Openbox-Debug: UnmapNotify for window 0x2e084c2 eventwin 0x2e084c2 sendevent 0 ignores left 1
Openbox-Debug: UnmapNotify for window 0x160000d eventwin 0x160000d sendevent 0 ignores left 1
Openbox-Debug: ConfigureRequest for "clock" desktop 0 wmstate 1 visible 0
Openbox-Debug:                      x 1824 y 984 w 96 h 96 b 0
Openbox-Debug: Restack request Above for client clock sibling (all)
Openbox-Debug: ConfigureRequest x(0) 1824 y(0) 984 w(0) 96 h(0) 96 move 1 resize 0
Openbox-Debug: Granting ConfigureRequest x 1824 y 984 w 96 h 96
Openbox-Debug: Sending ConfigureNotify to clock for 1824,984 96x96
Openbox-Debug: MapRequest for 0x16039aa                   <-------------
Openbox-Debug: net_active_window for 0x16039aa source=application     <------------
Openbox-Debug: Want to focus window 0x16039aa at time 4136498 launched at 0 (last user interaction time 0) request from user, allow other desktop: no, desktop switch time 0
Openbox-Debug: Unknown launch time, using 0 - user request
Openbox-Debug: Allowing focus stealing for clock at time 4136498 (last user interaction time 0)
Openbox-Debug: Iconifying window: 0x160000d
Openbox-Debug: Iconifying window: 0x2e084c2
Openbox-Debug: Iconifying window: 0x2e084b8
Openbox-Debug: Iconifying window: 0x2e084ae
Openbox-Debug: Iconifying window: 0x2e084a4
Openbox-Debug: Iconifying window: 0x2e0849a
Openbox-Debug: Iconifying window: 0x3200003
Openbox-Debug: Iconifying window: 0x3400030
Comment 7 Dana Jansens 2013-09-08 12:57:01 EDT
Also, this isn't particular to the clock applet. The desktop pager applet which I have by default also does the exact same thing.
Comment 8 Dana Jansens 2013-09-08 13:00:50 EDT
I think you should file a bug with cairo-dock, but I also think we could work around it with an action option for ToggleDesktop. I'll implement the latter either way, but please do follow up with them. This is weird behaviour.
Comment 9 Dana Jansens 2013-09-08 13:41:58 EDT
I added a "strict" option to the ToggleShowDesktop action. When used, windows can't be shown while showing the desktop. It means you can't use the action to hide all the windows and then activate one window to show only it. But that's just not possible while the cairo-dock applets are behaving in this way.

https://github.com/danakj/openbox/commit/a23c72d84252b76192dadac08bdf1654451f827f

I'm going to mark this Fixed from our end, but cairo-dock should change its applets behaviour.
Comment 10 Jehan 2013-09-08 22:26:32 EDT
Hi,

thanks, that's awesome. I will indeed make a bug report to cairo-dock anyway (which is indeed neat, though some details could be better, and the devil is in the details :p).

But I tried your branch, and couldn't have this new option working.

From what I get, this new option works like this, right?

    <keybind key="W-Escape">
      <action name="ToggleShowDesktop">
        <strict>true</strict>
      </action>
    </keybind>

Because when I have a cairo-dock plugin showing (indeed not only the clock behaves bad, it may be a general thing to cairo-dock applets, you are right), well I still had the same problem as before. Is the rc.xml syntax different?
Comment 11 Jehan 2013-09-08 22:49:39 EDT
For reference, the cairo-dock bug report: https://bugs.launchpad.net/cairo-dock-plug-ins/+bug/1222629
Comment 12 Jehan 2013-09-11 01:25:14 EDT
Hey,

so as discussed on IRC, I will reopen this after testing again. The workaround is definitely not working for me. I "make clean" the repository to make sure I have a blank slate (you never know) and when I show the desktop with the strict option, the clock is not hidden, and still breaks the usage of hiding the desktop back.

If you want, I can give you openbox debug output, but I have no idea how/where I can get it. :-)
Moreover that will be definitely useful if I want to hack openbox too.
Thanks!