Sublime Forum

How to focus window?

#1

if I have three windows
I edit window in one.
I want focus windows for twice

i try to use window.focusView api.but window can’t focus.this window in underside of now editing window.how to do it?

0 Likes

#2

Encounter same question here, possible to have a sublime.focus_window(window) API?

0 Likes

#3

It’s a little difficult to understand exactly what you’re asking. It might help to include which platform you are on. It may be a bug, because the following works for me on Windows, but not on OS X (10.7). I have two windows open, one on top of the other. When trying to set focus on the window underneath, on OS X the window does not raise to the foreground.

some_view = other_window.views()[0]
other_window.focus_view(some_view)
0 Likes

#4

Yes, windows version is much easier, also since in windows you have hwnd() for a window, it’s much easier to manipulate it with Win32 APIs. However, in general, I believe activate a window as an API is much clearer than infer it by activate a view.

I’ve added a feature request
sublimetext.userecho.com/topic/1 … dowwindow/

0 Likes