Get WIndow to the front on Mac

39 views
Skip to first unread message

fabiod...@gmail.com

unread,
May 23, 2017, 7:09:28 PM5/23/17
to CEF Python
Hi guys,

I tried to use the tutorial example but on Mac I always get the new window behind the Terminal, so if I run python tutorial.py, the browser windows is always behind the terminal and without any focus.

This is a normal behavior or do we have any way to manage this and bring the window to the top?

Czarek Tomczak

unread,
May 24, 2017, 3:33:02 AM5/24/17
to CEF Python
The hello_world and tutorial examples don't depend on any third party GUI frameworks, but they are currently limited. Issue #252 will add support for CEF Views which should resolve all the issues. Alternatively in the meantime you can use other examples (wxpython, gkt, qt). Or you could use pyobjc/objc python extension (installed by default in system Python on Mac) along with code like this (not tested):

from AppKit import NSApp
NSApp.activateIgnoringOtherApps_(True)

NSApp docs: https://developer.apple.com/reference/appkit/nsapplication

Czarek Tomczak

unread,
May 24, 2017, 3:35:37 AM5/24/17
to CEF Python
The NSApp.activateIgnoringOtherApps_(True) call should fix the inactive window issue in hello_world and tutorial examples.
Reply all
Reply to author
Forward
0 new messages