[Pkg-tcltk-devel] Bug#514115: Tk and Tkinter applications fail to raise toplevel windows

Jonathan Nieder jrnieder at gmail.com
Sun May 29 05:10:32 UTC 2011


tags 514115 + upstream
retitle 514115 tk: [raise] doesn't always work
reassign 514115 tk8.6
tags 514115 + upstream
quit

Hi Miguel,

Sergei Golovan wrote:

> Appears that Metacity doesn't understand that
> these three toplevels belong to the same application. But adding [wm
> group $w .] after creating toplevel $w makes Metacity happy.

This seems to have been fixed in metacity upstream[1], but it is
possible to wonder if tk could help.  Could and should tk be grouping
windows automatically?

> So, I wouldn't blaim Tk developers for this behavior. Though it'd
> probably better to add a few words about [raise] behavior to raise
> manpage.

I agree.  It would be nice to mention that raise cannot be relied on
for focus stealing, and that [raise] is traditionally implemented as
XRaiseWindow.  (And in turn, the XRaiseWindow manpage should mention
that it can't be relied on for focus stealing.)

Konstantin Khomoutov wrote:

> [04:05]	jenglish	This whole _NET_WM_DEMANDS_ATTENTION / flashing
> taskbar / [raise] doesn't work anymore thing is part of an
> ever-escalating war between window managers and applications.
[...]
> [04:17]	jenglish	In the meantime, Tk really ought to support
> _NET_WM_DEMANDS_ATTENTION.  There's an FR open for that, undealt
> with to date.

The feature request mentioned is probably [2].  Joe English said "I
have a patch for it" but that was five years ago.  I don't know if he
still has it or not.

So to summarize, I see four potential bugs here:

 - it was not always obvious to window managers which windows belong
   to the same tk application;

 - the semantics of [raise] are undocumented (in particular,
   raise(3tk) doesn't mention that it is just a hint);

 - the semantics of XRaiseWindow() are undocumented (in particular,
   XRaiseWindow(3) doesn't explain that it is handled by window
   managers and that there are many situations in which for security
   or other reasons this request will be ignored);

 - tk has no function to "demand attention" (like many messaging apps
   would benefit from).

I would suggest splitting this bug (cloning) for whichever of those
seem worth working on and reassigning to tk8.6, tk8.6-doc, libx11-dev,
and tk8.6, respectively.

Thanks much, and hope that helps.

Regards,
Jonathan

[1] http://bugs.debian.org/340725
[2] "make a window ask for attention"
http://sourceforge.net/tracker/index.php?func=detail&aid=1450270&group_id=12997&atid=362997





More information about the Pkg-tcltk-devel mailing list