Tk Source Code

View Ticket
Login
Ticket UUID: 3462883
Title: tearoff iconifys on loss of focus
Type: Bug Version: obsolete: 8.5.9
Submitter: tomturkey Created on: 2011-12-20 08:18:11
Subsystem: 12. Unix Menus Assigned To: tmh
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2026-10-22 17:22:36
Resolution: Wont Fix Closed By: serhiy.storchaka
    Closed on: 2026-09-19 15:21:56
Description:
When a popup menu is torn off, the resultant menu is iconified if the parent loses focus.  This is a problem particularly if the tearoff is moved outside of the parent window, in which case it is very hard to get focus back to the menu.  A simple case:
menu .foo -tearoff 1
.foo add command -label "foov"
bind . <3> "tk_popup .foo %X %Y

The right click in the window and do the tear off.  When the mouse leaves the main window the tearoff will iconify.

By the way, this does not happen on Windows systems.
User Comments: serhiy.storchaka added on 2026-09-19 15:21:56:

Since 8.5.9 a torn-off menu has the EWMH window type _NET_WM_WINDOW_TYPE_MENU, which is defined for torn-off menus, and is transient for the application. KWin hides transient menu, toolbar and utility windows of inactive applications when "Hide utility windows for inactive applications" is enabled (the default); other window managers do not. This is the window manager's policy, not a Tk bug.


stevenaaus added on 2012-05-23 16:33:00:
A work around exists inside KDE (4.5.2 at least):
WindowBehaviour->WindowBehaviour->Advanced->Hide Utility Windows for inactive apps

tomturkey added on 2012-04-07 22:57:20:
Currently Fedora 16 /KDE 4.7.4.   I think it was Fedora 15 when the bug was submitted.

stevenaaus added on 2012-04-07 03:16:14:
Bug is present on both Fedora 14 / KDE-4.5.2 (64bit) and Fedora 7 / KDE 3.5.10 (32bit)
I have pinned it down to being introduced in wish 8.5.9, and it exists in all later wish.

Hmm - Fed14/Gnome does not suffer this issue.

dkf added on 2012-04-07 02:37:26:
I ask that because I wonder if this is related to the EWMH support.

dkf added on 2012-04-07 02:35:18:
What window manager are you using?

stevenaaus added on 2012-04-06 04:56:17:
This bug annoys me too. It is visible in 8.5.9 and 8.6b2, but not 8.5.7
The above example is missing an end quote. It should be

menu .foo -tearoff 1
.foo add command -label "foov"
bind . <3> "tk_popup .foo %X %Y"
# Hopefully - not a input parser issue