IDL and Mouse Cursor problems on OS X
March 23rd, 2007 by Marcos
If you have any issues getting IDL to properly record/recognize the cursor position or mouse clicks, you may want to try this command in the terminal
defaults write com.apple.x11 wm_click_through -bool true
Frank Varosi here at UF gave me this tip, which he found at this french site. What this command does is it changes a window manager preference in Apple’s X11. This probably only effects the so-called “Quartz VM” which is the default window manager. If you switched to the enlightenment or some other window manager, my guess is this click-through preference has no effect, but I can’t say for sure.
Personally, I’ve yet to write IDL programs that look for the cursor location, but I figure this may be helpful to others.
Update As a commenter noted, you will have to restart X11 for this to do anything, since it’s changing a preference in Apple’s quartz-vm window manager.
Update II As commenter Josh Shiode noted, the Macosforge X11 (and possibly any X11 with Leopard) requires a slightly different command:
defaults write org.x.x11 wmclickthrough -bool true

N. Ingle Says
Many thanks for this posting this tip. I am trying to keep a set of IDL code written on PC’s runable on a Mac, and I thought I had been beaten on this particualr problem!
Apr 17th, 2007 at 2:13 pm
A. Steffen Says
Note: You must restart X11 for this change to take effect.
Jul 5th, 2007 at 4:46 pm
S. Meibom Says
Many thanks, a very useful tip and exercise in French comprehension. I can think of one German whose code has been saved by this information.
Jul 20th, 2007 at 7:35 pm
G. McSwain Says
Thanks, my own code was saved by this tip!
Aug 14th, 2007 at 9:12 am
A. Weinberger Says
Thanks, that solved three problems at once: getting the wrong cursor coordinates with a cursor command (in idlde), having the cursor command hang (in plain idl), and having to click back in the idlde window to have the wrong cursor position registered.
Oct 1st, 2007 at 5:20 pm
Christopher Bonnett Says
I applied the command, and now it will register left click and right click, but i won’t register middle click, anybody have any ideas? I’m on leopard and using idl 7.0….
Christopher
Jan 3rd, 2008 at 9:02 am
Marcos Says
Leopard might the problem; you may want to look at the various posts on here about X11, and try some of the newer unofficial X11 builds on macosxforge…
Jan 3rd, 2008 at 10:44 pm
Paul Levine Says
Just wanted to chime in with another “thanks a low” for posting this, it saved my rear
Feb 24th, 2008 at 12:13 am
Paul Levine Says
Whoops, I meant “thanks a lot” not “low”
Feb 24th, 2008 at 12:28 am
Josh Shiode Says
If you upgraded x11 through macosforge (which is recommended by most forums I have come across), I found that the above tip does not work. For reference, I am running IDL 6.4 (with the 6.4.1 patch) and the latest x11 release (2.2.0.1) on OS X 10.5.2.
The relevant command is almost identical except that the defaults file (Mac calls it a domain) you will need to change is ‘org.x.x11′ So the command would be:
defaults write org.x.x11 wmclickthrough -bool true
I found that I actually had to delete the “wmclickthrough” key using the command:
defaults delete org.x.x11 wmclickthrough
And then add it back using the first command, but I suspect that problem was just my own user error somewhere. Hope this helps others not waste the 2 hours I just wasted…
Apr 15th, 2008 at 4:46 pm
Josh Shiode Says
Sorry, formatted that wrong. I mean the keyword in the article, not what showed up with the italics…
Apr 15th, 2008 at 10:55 pm
Torsten Says
I tried the different solutions on my PPC G5: - Leopard 10.5.2 - Xquartz 2.2.1 - (xorg-server 1.3.0-apple20) - IDL 7.0
there is NO way to make cursor work! Any help??
Thank’s Torsten
May 21st, 2008 at 5:53 am
Torsten Says
sorry, if I write the keyword wmclickthrough instead wmclickthrough it works…my mistake…
Thank’s Torsten
May 21st, 2008 at 6:22 am
Torsten Says
again: it must be underscore - click - underscore…!!!
May 21st, 2008 at 6:23 am