windows do not undock on kde4

Bug #787997 reported by reup dereut
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inactive kdocker (moved to https://github.com/user-none/KDocker)
Fix Released
Undecided
Unassigned

Bug Description

I have 2 computer, desktop and laptop
Ubuntu Natty :
reup@DEF:~$ kdocker -v
KDocker version: 4.5
Using Qt version: 4.7.2
Linux DEF 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Gentoo (up to date)
kdocker v 4.5
ABC ~ # uname -a
Linux ABC 2.6.37-gentoo-r4 #2 SMP Wed May 11 20:43:39 CEST 2011 x86_64 Intel(R) Pentium(R) Dual CPU T3200 @ 2.00GHz GenuineIntel GNU/Linux

both with kde 4.6. if I dock terminator with kdocker -q terminator, it dock but clicking on it does not show the windows, it just blink. I have to use the menu and undock my windows to get them back if I dock dolphin with kdocker dolphin, I have the same result.

this is the output if started from a terminal
reup@DEF:~$ kdocker
Select the application/window to dock with the left mouse button.
Click any other mouse button to abort.
reup@DEF:~$

if I start compiz, kdocker is working well.

on both computer I see exactly the same bug

thanks

reup

Revision history for this message
reup dereut (reupdereut) wrote :

going through the menu, it seems to be link to "iconify on minimize". if I remove this options, kdocker seems to work normally but I have to click on the icon to iconify.
if I select the option, kdocker does not restore windows when cliking the icon

reup

Changed in kdocker:
status: New → Confirmed
Revision history for this message
John Schember (user-none) wrote :

Putting down what I've found so far. This is mostly for me to keep track of what I've done with this issue as it's not going to be an easy fix.

First, window manager detection and specific work around are not going to be included. This is project policy.

Everything is in trayitem.cpp.

The issue is caused by function restoreWindow, line 128: XIconifyWindow(display, m_window, DefaultScreen(display));

With KWin this is causing a propertyChangeEvent of WM_STATE with the IconicState set. Line 326 is triggered which checks if a minimized window should be hidden. This happens after restoreWindow is has finished. The propertyChangeEvent does not happen with Metacity or Compiz.

The XIconifyWindow is required for multi-window applications (linked windows) such as audacious to have all of it's sub windows restored. Removing this would cause audacious to have it's sub-windows missing when restored.

Since the property change event happens after the restoreWindow function has finished a simple bool that says we are in a restore won't work because it will be set as having finished restoring at the end of restoreWindow so it won't ever be used. This is due to the property change event happening after restoreWindow finishes.

We can't do a skip next iconifyWindow variable because Metacity and Compiz do not send the property change event so this would cause the next time the user tries to hide the window to be ignored.

I did find that I need to add a second XMapWindow(display, m_window); call above the XRaiseWindow(display, m_window); on line 138. Otherwise the window may not be shown after restoring. It often stays minimized otherwise. This is related but only fixes part of the issue.

So I need to figure out a way to have the iconic state property change event to be ignored when it is caused by the XIconifyWindow in restoreWindow.

I have though of setting the time restoreWindow takes place and to ignore iconifyWindow calls that take place within a specific time interval. While not WM specific I would like to avoid this because it is very hackish and can fail in cases where the users computer slow or running slow.

Revision history for this message
John Schember (user-none) wrote :

Fixed in 4.6.

Changed in kdocker:
status: Confirmed → Fix Released
Revision history for this message
reup dereut (reupdereut) wrote :

that is the fastest reaction and fix I ever seen !

 thanks a lot

I will download and test it immediately

reup

Revision history for this message
reup dereut (reupdereut) wrote :

downloaded, compiled, tested :
I can happily report that using ubuntu natty kde 4.6, with or without compiz, with or whitout "iconify when minimized" kdocker works perfectly well

reup

Revision history for this message
John Schember (user-none) wrote :

I'm glad to hear it's working!

Also, for anyone who comes along and sees this bug. I now have PPA packages up for 4.6 at https://launchpad.net/~kdocker-developers/+archive/kdocker-ppa

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.