[Pkg-tcltk-devel] Bug#514115: Log of a chat session with one of Tk on X Window maintainers regarding this issue
Konstantin Khomoutov
flatworm at users.sourceforge.net
Wed Feb 4 17:33:03 UTC 2009
I've talked about this very issue with one of Tcl Core Team members,
Joe English, on 2008-01-21 in the Tcler's chatroom. Since the server
running that room doesn't provide convenient chat logs accessible via
WWW, here's the relevant part of the discussion (with kostix being me
and jenglish being Joe English) -- it (possibly) clarifies the subject
and the position of one of the chief Tk developers on this issue:
------
[03:40] kostix ok, the question: when we implemented raising tkabber
from a tray icon, it seemed to misbehave under metacity and kwin (IIRC).
today I've been shown this bugreport regarding raising Tk windows under
metacity: http://bugzilla.gnome.org/show_bug.cgi?id=567528 -- it states
that instead of XRaiseWindow a well-behaving app should set some
property (?) somewhere. what do you think about this?
[03:40] kostix some _NET_ACTIVE_WINDOW messages
[03:40] jenglish kostix -- I think this is a known issue.
[03:40] kostix Tk really uses XRaiseWindow and it's documentation sounds
ok to me
[03:40] * jenglish downloading ...
[03:41] jenglish ... part 1 of the known issue is that X clients don't
get to say "raise this window" -- they just get to say "Dear WM, please
if you would be so kind, raise this window for me."
[03:43] jenglish (That's *always* been the case, since the dawn of the
ICCCM. Nobody noticed until recently, 'cause up til now WMs have always
complied with those requests.)
[03:46] jenglish ... looks like this is not really a bug. Comment #9
from HP is correct.
[03:47] kostix jenglish: but it clearly states "you should file a
bug..." -- how do you interpret that?
[03:47] kostix or it just means "either way is ok if it's properly
documented"?
[03:48] jenglish Quoth HP: "If they have an API meaning "bring this
window to user's attention" and they use XRaiseWindow() to mean that,
then yes, you should file a bug with them."
[03:49] jenglish Tk doesn't have an API meaning "bring this window to
user's attention."
[03:49] jenglish It has [raise], which means "Please dear WM bring this
window to the top of the stacking order if it's not too much of a bother..."
[03:50] kostix jenglish: how "bring to the user attention" would be
different then? say, flash a window's frame without moving it from its
layer?
[03:53] jenglish "bring to the user's attention" is a fairly recent
invention (circa 2002?). Tk just hasn't caught up yet.
[03:54] jenglish Note that Windows XP and later has similar issues.
[03:54] patthoyts On windows it occurs as a side-effect of [raise]
[03:54] kostix eh? I know about FlashWindow(), is it this?
[03:54] patthoyts yeah
[03:55] patthoyts Although its called through SetForegroundWindow
[03:55] patthoyts If your app isn't foreground then the wm will not let
it raise tot he top but calls FlashWindow instead.
[03:55] jenglish That's what happens under metacity and kwin, too.
[03:56] * jenglish in the case of kwin, it depends on user
preferences, of course.
[03:56] kostix well, this might have sense
[03:57] kostix but the modal dialog box anyway pops the window in front
of me in windows, IIRC
[04:00] patthoyts Not for me. If I do [after 2000 [list raise .]] and
swith to firefox, it doesnt let tkchat raise over firefox.
[04:00] patthoyts We had a discussion about this here a few days ago.
There is evidently some setting in windows that disables this as having
a flashing taskbar item for this is normal on XP but some people dont
get that.
[04:01] kostix hm, I'm sure I had cursed this behaviour under certain
circumstances
[04:01] kostix may be another window of a currently active app?
[04:01] jenglish That's how current X WMs do it too.
[04:04] jenglish Wait, kostix -- this bug report pertains to tkabber? A
chat/IM client?
[04:04] jenglish Please, I beg you: stop trying to do whatever it is
you're trying to do.
[04:05] kostix jenglish: that concrete bug I showed? no. but it was
brought to my attention because of this
[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:06] kostix jenglish: the idea was to unconditionally bring tkabber's
window to front on a left mouse-button click on the tray icon. on some
WMs it didn't work well
[04:06] jenglish Exactly.
[04:06] kostix "the old ones" like fvwm did OK
[04:08] jenglish Newer WMs don't let you do that any more.
[04:08] jenglish And the harder you try, the more they will fight back.
[04:08] kostix jenglish: but my case is clear "bring that bloody window
up, I say" thing
[04:09] jenglish As soon as you find some way to "just make this window
do what I want it to do", Lubos will find a way to defeat you next year.
[04:09] jenglish EXACTLY! You, as an application, should NOT be saying
"bring that bloody window up."
[04:09] jenglish You, as an application, get to say "Please dear WM
bring this window to the user's attention."
[04:10] jenglish If the WM chooses not to comply, and instead just
flashes the taskbar, LEAVE IT AT THAT. That's what the user has decided
he wants.
[04:10] kostix jenglish: what about me being the user? I can understand
this "polite" thing, it's probably good in terms of HID guidelines but
when I click the tray icon I'm making a conscious gesture, right?
[04:11] jenglish If you, as a user, don't like that behavior, change
your WM settings. Or use a different WM.
[04:12] jenglish If you, as a program author, don't like that behavior,
STOP FIGHTING IT. Because Lubos will always win in the end.
[04:16] kostix ok, thanks jenglish
[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.
[04:21] stu Lubos ?
[04:21] jenglish Lubos Lunak. Author of KWIN, the KDE window manager.
[04:22] jenglish Inventor of "focus-stealing prevention" mechanisms and
_NET_WM_DEMANDS_ATTENTION.
------
Hope this helps.
More information about the Pkg-tcltk-devel
mailing list