OS X XTerm Window Cannot Gain Focus
QUESTION: The behavior discussed below was first reported by Ken Mankoff in a 3 May 2005 IDL newsgroup article.
This is documenting a behavioral change between OS X 10.3.9 and 10.4. It is a (potentially serious) bug, and while I like it, it might cause others trouble. So be careful before you upgrade.
When I type:
IDL> windowfrom an OS X X11 xterm the IDL plot window does not get the focus.
So far, this is nothing new to those of you using Terminal.app, and is actually the behavior I requested long ago (and below in this email).
But now the window will not accept focus, even if I mouse over, click on it, whatever. A widget window does get the focus and behaves correctly.
The problem with this new behavior, is if I type:
IDL> window IDL> zoomI now cannot quit the Zoom procedure (because it relies on window events (right click) to quit). I have to CTRL+z and then 'kill' my IDL session.
So beware... any of you that use non-widget window interactive code (CURSOR, ZOOM, etc.) on OS X, you probably don't want to upgrade to 10.4 right now.
Of course, there is the chance this is local to my machine. Can anyone verify this? Is it some strange setting in my .xinit or .Xdefault file?
![]()
ANSWER: As it turns out, it is a strange setting related to the Quartz window manager. Here is Ken explaining what he found out about the problem several days later.
Whoops! Sorry. This is not a bug. You just need to activate click_through events in the Quartz window manager. In a terminal just type the following and then restart X11:
defaults write com.apple.x11 wm_click_through -bool trueThis and other options are documented in man Xquartz and quartz-wm.
The plot window still doesn't gain focus when clicked on (the minimize/maximize buttons stay shaded) but everything works normally otherwise. Actually, X11/IDL now behaves exactly the way I originally requested: The plot window does not get keyboard focus, so I can continue typing sans interruption after I issue a Plot command.
![]()
Copyright © 2005 David W. Fanning
Last Updated 7 May 2005
