OS X Window Focus Behaviour

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

OS X Window Focus Behaviour

Post by Chris Corbyn »

Anyone know of a way to change the focus behaviour in OS X so that the window has full focus on click? On mine at least, if I want to do something like click & drag inside a window which is currently behind another window I have to bring the window into focus by clicking on it, then lift the mouse button and click and drag (i.e. I have to click twice). This is getting quite annoying when moving between windows in the GIMP :(
User avatar
jyhm
Forum Contributor
Posts: 228
Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:

Post by jyhm »

What exactly are you clicking and draging? In finder I can drag and drop any file from one window to another as long as the file is compatible with what I have in the window like a regular txt doc from my desktop to my documents window. Are you saying that the problem is limited to GIMP?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

jyhm wrote:What exactly are you clicking and draging? In finder I can drag and drop any file from one window to another as long as the file is compatible with what I have in the window like a regular txt doc from my desktop to my documents window. Are you saying that the problem is limited to GIMP?
Put two windows side by side (firefox or camino windows or something). Focus one, and then with the other one in view, but not in focus try dragging the mouse over some text to select a sentence. The window will come into focus, but the text will not select unless you lift the mouse button and do it again.

This poses an annoyance when using the GIMP graphics editor since you select a tool such as the paintbrush in the tools window, then try to draw in the drawing pane and nothing happens. Subsequently, each time you go from one window to another you need to bring it into focus and *then* start working inside it. You can't combine the two operations with one click like you can in other windowing evironments :(

EDIT | It's the same with scrolling. Put two windows side by side, then with the one that *is not* in focus try placing the mouse cursor over it and using the scroll wheel on your mouse -- nothing happens, you need to bring the window into focus first. I'm near enough certain there will be some "defaults" value you can set to change this behaviour.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Here's the problem. Window focus occurs on mouse-up, not on mouse-down. Grr...

I shall dig around in /Library/Preferences if I know where to look.
User avatar
jyhm
Forum Contributor
Posts: 228
Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:

Post by jyhm »

Sorry I can't help d

Not sure that I ever use those type of 'window actions' on any OS. I know there are a lot of third party utilities like 'DragThing' that extends your capabilities but I don't know if for what you are asking.

P.S. Probably should post these in PHPmac before we get an 'ostrisizing' PM from a mod. Got one for not using correct grammar (i.e. thanx 4 u're help)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I am finding (in Windows) that some apps respond to clicks and other require focus. I haven't paid enough attention to determine what conditions dictate this, but some apps respond as soon as the window is clicked and others respond only after focus is brought back to the window.

I wouldn't even know to begin on a Mac d11, sorry.
User avatar
jyhm
Forum Contributor
Posts: 228
Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:

Post by jyhm »

Hey I just downloaded GIMPshop for OSX and while reading the readme file I was reminded of your post. You probably have fixed the problem but here is a line from there documentation with the actual command line for achieving this effect:
If you are using Apple's X11 and find it annoying that you must click on a window once to bring it to focus and a second time to use a tool on it, run the included "Turn On X11 Focus Follows Mouse" script. X11 must be restarted for the change to take effect. To turn focus follows mouse back off, open Terminal and type:
defaults write com.apple.x11 wm_ffm false
The program actually contains an appescript to do it for you. It also has an automated function for using photoshop style keyboard commands. Do you use GIMPshop or just GIMP?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

jyhm wrote:Hey I just downloaded GIMPshop for OSX and while reading the readme file I was reminded of your post. You probably have fixed the problem but here is a line from there documentation with the actual command line for achieving this effect:
If you are using Apple's X11 and find it annoying that you must click on a window once to bring it to focus and a second time to use a tool on it, run the included "Turn On X11 Focus Follows Mouse" script. X11 must be restarted for the change to take effect. To turn focus follows mouse back off, open Terminal and type:
defaults write com.apple.x11 wm_ffm false
The program actually contains an appescript to do it for you. It also has an automated function for using photoshop style keyboard commands. Do you use GIMPshop or just GIMP?
Ah ha! That should solve the problem yes :) I've actually got Photoshop CS3 Beta installed at the moment but I like GIMP as it's lighter. Never heard of GIMPShop, but if that doesn't require X11 it will be better anyway :) I'm not fond of having to run X11 alongside everything else when I only have a Mac Mini 1.8GHz Core Duo and 512MB DDR2. I'll check it out :)
User avatar
jyhm
Forum Contributor
Posts: 228
Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:

Post by jyhm »

Sorry d, GIMPshop also requires X11. I guess GIMPshop is supposed to be more of a Photoshop style user interface. And at the moment I can't launch X11 to try GIMPshop. grrr
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

That's heaps better now I've set that default up. Thanks for remembering the thread :)
User avatar
jyhm
Forum Contributor
Posts: 228
Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:

Post by jyhm »

d11wtq wrote:That's heaps better now I've set that default up. Thanks for remembering the thread :)
Hey no problem, it only took a month right! :wink:

I,ve just been playing around with Gimpshop, and I think I'll keep it handy when the day comes I can't afford PhotoShop. Adobe products are expensive, or shall I say when my 'peers' stop lending it to me.

Tell me d11wtq am I stuck with not being able to use mac style key commands?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

jyhm wrote:
d11wtq wrote:That's heaps better now I've set that default up. Thanks for remembering the thread :)
Hey no problem, it only took a month right! :wink:

I,ve just been playing around with Gimpshop, and I think I'll keep it handy when the day comes I can't afford PhotoShop. Adobe products are expensive, or shall I say when my 'peers' stop lending it to me.

Tell me d11wtq am I stuck with not being able to use mac style key commands?
I don't use keyboard shortcuts in any of those graphics apps anyway. It's not often I use them and when I do I only do very basic things. Under X11 you'll want to use ctrl rather than command to do things like copy & paste. Unfortunately, I've not found a reasonable way to copy text/images from X11 back into OS X's native window environment. I really wish OS X had X11 features integrated into it's own window system. It would also make it easier to work with the desktop remotely too.
User avatar
jyhm
Forum Contributor
Posts: 228
Joined: Tue Dec 19, 2006 10:08 pm
Location: Connecticut, USA
Contact:

Post by jyhm »

I wonder why they just don't write GIMP in cocoa, ..odd.

You can operate X11 remotely? Sounds pretty phasytamicacated.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

SSH to the remote machine, make sure X11 is running.

Code: Select all

export DISPLAY=<your-ip-address>:0
/usr/bin/<app-that-uses-x>
That will send all the X commands and listen more mouse events etc from your machine remotely, rather than trying to use local hardware. You can completely launch desktop enviroments such as the Gnome or KDE DE's. Luckily, because apple has made X11 available, we can launch apps on a linux system and have them render on the Mac, but doing it the other way around isn't possible for things that don't run in X.

Porting GIMP to Cocoa would require rewriting the entire thing I guess. It's heavily based on GTK and is intended as a Linux application, not a Mac application so I guess GTK is the most portable library to use. Luckily GTK is available under UNIX, Windows and OS X.
Post Reply