Feature request: Dock when closed

Bug #460338 reported by Forlong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inactive kdocker (moved to https://github.com/user-none/KDocker)
Fix Released
Wishlist
John Schember

Bug Description

I would like to be able to close an application to the tray. Just the way the 'Dock when minimized' option works but for the close button (X) of the window manager.

The application would then be "properly closed" by the context menu of the icon in the tray.

This would be a killer feature for me. Thank you.

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

This is a feature I would like to implement but it is not a trivial request. Alltray (the older versions) had this but it was highly window manager specific. I know the new Alltray project has been looking into a window manager neutral solution but one has not been found.

Revision history for this message
Girish Ramakrishnan (girish) wrote :

Maybe we can xembed the target using QX11EmbedContainer?

Of course, the solution only works for the 'X' close button and not for file->exit or for apps that use xshape or frameless apps like Google Chrome.

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

I'm okay with file->exit closing the app completely. I think if that were overridden it would be way to confusing. As for QX11EmbedContainer, I did some testing and it looks like it will work. There is just one thing I need to get worked out. I need to figure out how to get the window current, minimum, and maximum size before embedding so I can have the parent will behave like the original.

Changed in kdocker:
importance: Undecided → Wishlist
assignee: nobody → John Schember (user-none)
status: New → In Progress
milestone: none → 4.3
Changed in kdocker:
status: In Progress → Fix Committed
Revision history for this message
Girish Ramakrishnan (girish) wrote :

Agree, file->exit should exit (what was I thinking :-) )

I commented in your blog but in case you missed it - One bit that I didn’t quite understand is why you register for WM_DELETE_WINDOW. Can’t you just subclass QX11EmbedContainer and reimplement closeEvent? (you can accept/reject the QCloseEvent)

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

I didn't miss it. I've been at work.

WM_DELETE_WINDOW is passed to the embedded window if you do not register it, even if you re-implement the closeEvent; the embedded window will close. If you register it then you have to look for it as a client message in the X11EventFilter because the closeEvent will never be called since the WM_DELETE_WINDOW has essentially been overridden.

There are two issues that re-parenting introduces that I'm currently working though that are keeping me from making a release.

Sending _NET_CLOSE_WINDOW to the embedded window will cause it to close completely. An application like gedit that asks to save before closing will not ask, it just closes. I need to look to see about other ways to ask a window to close.

The other issue is drag and drop becomes a bit broken. Drag works correctly but drop does not. The QX11EmbedContainer should be transparently proxying the XDnD messages to the embedded window and it appears to but there are issues. Nautilus doesn't always register that the item can be dropped. the key combos that change between cut and copy do not work. Rox does not work at all with dropping. This one is harder to solve because it looks like Qt simply uses Xlibs XDnD Proxy calls and doesn't do anything itself.

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

Close works properly. Iconify on close works properly. Drag and Drop is partly broken on docked windows. This has made it into the now released 4.3 version.

Changed in kdocker:
status: Fix Committed → Fix Released
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.