Re: focus loss issue
Re: focus loss issue
- Subject: Re: focus loss issue
- From: Jeremy Huddleston Sequoia <email@hidden>
- Date: Fri, 11 Jan 2013 18:43:29 -0800
Some users trying to debug this reported that python would crash when running the script. Here's an updated version of the script that won't make python sad.
#!/usr/bin/python
import signal
import sys
def signal_handler(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGQUIT, signal_handler)
from AppKit import *
class MyObserver(NSObject):
def appActivated_(self, notification):
app = notification.userInfo()["NSWorkspaceApplicationKey"]
NSLog(u"activated %@ (%@)", app.localizedName(), app.bundleIdentifier())
ws = NSWorkspace.sharedWorkspace()
nc = ws.notificationCenter()
ob = MyObserver.new()
nc.addObserver_selector_name_object_(ob, "appActivated:", NSWorkspaceDidActivateApplicationNotification, ws)
NSRunLoop.currentRunLoop().run()
On Dec 14, 2012, at 6:23 PM, Ken Thomases <email@hidden> wrote:
> On Dec 14, 2012, at 1:40 PM, Brian Landy wrote:
>
>> Oh well, if there's anything I can do to try to track down the issue I would love to help. I see the issue all the time, and have for years (on 10.8/7/6, probably 10.5, before that my memory of X11 releases is very vague). I am generally am only running urxvt sessions so my X11 setup is pretty simple.
>
> The attached Python script runs until you terminate it and logs application activations. Save it to disk and run it with a command like:
>
> python path/to/watch_activations.py
>
> To stop it, type Control-C in the terminal window and then, due to a peculiarity of Python, do one more app switch.
>
> If you keep this running, hopefully it will tell you what is stealing focus from XQuartz.
>
> Cheers,
> Ken
>
>
> <watch_activations.py> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> X11-users mailing list (email@hidden)
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden