Tk Source Code

View Ticket
Login
Ticket UUID: 12715cc94319cae05b06864d12a8593ef538771a
Title: ttk::combobox Menu appearing behind host window on OSX High Sierra
Type: Bug Version: 8.6
Submitter: hypnotoad Created on: 2017-12-04 17:10:37
Subsystem: 83. Mac OS X Build Assigned To: nobody
Priority: 5 Medium Severity: Cosmetic
Status: Closed Last Modified: 2017-12-05 12:04:03
Resolution: Rejected Closed By: hypnotoad
    Closed on: 2017-12-05 12:04:03
Description:
On OSX 10.13 (High Sierra) the menu that pops down for the ttk::combobox widget is appearing behind the current window, rendering the widget useless. I have tried the range of Tk's that will actually build on High Sierra, and this is a problem for all versions of 8.6
User Comments: hypnotoad added on 2017-12-05 12:03:21:
I am closing this ticket. Now that I understand the problem, I can adapt my framework to prevent it from happening. The Taotk framework now provides an intelligent toplevel object that understands that wm attributes $tf -topmost 1 is not appropriate on all platforms.

Sorry for the bother.

hypnotoad added on 2017-12-05 09:42:15:
After some testing, I managed to isolate what exactly is causing my issue:

set tf .toolwin
toplevel $tf
wm attributes $tf -topmost 1
ttk::combobox $tf.cb -textvariable TEST -values {foo bar bang baz bing boom}
pack $tf.cb

It's when I try to invoke the combobox's menu on a window that is marked with the -topmost bit. On Windows (the main platform IRM is deployed on) this combination works.

hypnotoad added on 2017-12-05 03:29:20:
This involves a ::ttk::combobox embedded in a layout in the TkHtml widget. It's going to take a little bit for me to come up with a minimal demo

kevin_walzer added on 2017-12-05 02:43:35:
In the widget demo accompanying Tk (core 8-6-branch), this widget works as expected for me. Can you provide a sample script that reproduces the issue/

fvogel added on 2017-12-04 19:53:43:

The patch consists in removing hideOnSuspend.

If this is correct, other parts should be corrected as well:

See https://core.tcl.tk/tk/artifact/2d01d983bc43281e?ln=19,28

Non regression against the bug [1814778] mentioned there needs to be checked as well, but I could not find that bug item in teh repo.


fvogel added on 2017-12-04 19:19:01:

Wrong reference given, actual patch is [a8e8e532]. Many thanks!


hypnotoad added on 2017-12-04 19:04:08:

I have submitted at patch against core-8-6-6: [12715cc9]


hypnotoad added on 2017-12-04 19:00:46:
I have fixed the problem by replacing the ttk::combobox::PopdownToplevel proc with:

proc ttk::combobox::PopdownToplevel {w} {
    toplevel $w -class ComboboxPopdown
    wm withdraw $w
    switch -- [tk windowingsystem] {
	default -
	x11 {
	    $w configure -relief flat -borderwidth 0
	    wm attributes $w -type combo
	    wm overrideredirect $w true
	}
	win32 {
	    $w configure -relief flat -borderwidth 0
	    wm overrideredirect $w true
	    wm attributes $w -topmost 1
	}
	aqua {
	    $w configure -relief solid -borderwidth 0
	    tk::unsupported::MacWindowStyle style $w \
	    	help {noActivates}
	    wm resizable $w 0 0
	}
    }
    return $w
}