ActiveState Powered by ActiveState

ActiveState Community


Giving Komodo focus when openning new files

Posted by jluna on 2007-08-14 08:59

I would like for Komodo Edit to automatically have focus when a new file is opened. Currently, if Komodo Edit is already open and I try to open a new file, the Komodo window will simply flash (in Windows task bar) and not pop-up or take focus.

This may seem like a minor gripe, but it's frustrating and messes up a good work flow. I couldn't find an option to change this behavior, any suggestions?

bcorfman | Tue, 2007-08-14 09:25

... if implemented, IMO. Taking focus could be construed as very rude behavior for an app in other situations (and on other operating systems).

jluna | Tue, 2007-08-14 09:34

Right, I understand there are many circumstances where this would be unhelpful. However, I think it should definitely be an option.

bcorfman | Tue, 2007-08-14 09:39

Have you thought about implementing this as a macro? Macros can be triggered to run on a File Open event.

shanec | Tue, 2007-08-14 11:32

I looked into this issue a few months back, perhaps last year. There are no api's available (to javascript) in mozilla to force the window to become the foreground window, otherwise I would have implemented it as an option.

bcorfman | Tue, 2007-08-14 12:00

I bet in this case though (since the request is to implement on a Windows machine) that Python's win32api library could be used to give the Komodo window focus. I may futz with this if I get a chance.

shanec | Tue, 2007-08-14 13:47

We're considering replacing our usage of the internal win32 api with ctypes (and not having pywin32 in Komodo), that would resolve a few build/installer/patch issues we have. That wouldn't happen for a while though.

Secondly, there is no way to get a real window handle from mozilla. There are win32 api's to get the current window handle, but I didn't really like that way of doing things, if "feels" disconnected to me.

angrychimp | Thu, 2008-06-05 14:48

I was wondering if there might have been any progress on this subject in the last year. I would also be very interested in this feature - being able to open a file and have the window automatically focused so that I could just being typing or navigating through the file is something that I've become accustomed to with other editors (UltraEdit, Textpad, etc.).

I haven't installed Komodo on my Mac yet, but I would definitely be interested in this feature for my Windows box.

-->