App Launching in tk-desktop

I’m noticing an odd discrepancy between the way tk-multi-pythonconsole launches in tk-desktop and the way our custom apps do. When launched, tk-multi-pythonconsole does not stay on top of other windows and gets its own icon on the Windows taskbar. Other apps remain above all other windows and do not get an icon on the taskbar. This second behaviour is what I’d expect–the app is being parented to the tk-desktop window and treated as a dialog–but I’d like to be able to replicate the behaviour of tk-multi-pythonconsole. Digging through the code, I can’t actually see where it’s being treated differently. It’s calling create_panel which is falling back to create_dialog. The console itself is just a subclass of QWidget.

I’m certain I’m missing something obvious. Does anyone have any idea what that is?

If anyone is encountering a similar issue to the above, I sorted it out.

I had it backwards. In fact, the tk-multi-pythonconsole behaviour is the standard behaviour. My problem was that our custom app had a splash screen. tk-desktop has no _get_dialog_parent method and so is falling back to the default engine behaviour, which is to return the currently active window. Usually, for tk-desktop, this returns None and you get the standard, unparented dialog behaviour. If you have a splash screen, it returns that and so the dialog ends up parented to its own splash screen, which is…not good. I’m overriding tk-desktop anyway so it isn’t a big deal for me to add a _get_dialog_parent method that just returns None explicitly.

It might be worth considering adding something similar to the default tk-desktop implementation. The current behaviour works most of the time but has some funny edge cases.