Ticket #58 (assigned usability)

Opened 5 years ago

Last modified 3 weeks ago

x11 windows losing focus after a click

Reported by: matteo.gialli@… Owned by: jeremyhu@…
Priority: Nice to Have Milestone: OSX
Component: xserver Version: 2.1.3 (xserver-1.3.0-apple9)
Keywords: focus loss Cc: mta@…, barmar@…, cubranic@…, graehl@…

Description

I'm using version 2.1.3 on 10.5.1 and I'm experiencing the "focus loss" bug that many users reported months ago using Last.fm with AudioScrobbler plugin (as described at http://lists.apple.com/archives/x11-users/2007/Nov//msg00612.html ) while running Mercury Messenger with the "show current song from iTunes" setting enabled (I guessed this reading macosxhints FAQ (bug number 42, http://forums.macosxhints.com/showthread.php?t=80171&page=3 ); disabling that setting in Mercury fixed the problem

Change History

comment:1 Changed 5 years ago by matteo.gialli@…

  • Component changed from xserver to X11.pkg

Sorry for everything that may be wrong (especially ticket properties), this is my very first ticket at all so.. please be patient; looks like this is a known bug, but I couldn't find tickets about it so I opened a new one

comment:2 Changed 5 years ago by matteo.gialli@…

  • Version set to 2.1.3 (xserver-1.3)

comment:3 Changed 5 years ago by jeremyhu@…

  • Status changed from new to assigned
  • Component changed from X11.pkg to xserver
  • Milestone set to 2.2.0

Please pass this issue on to Mercury devs as well.

comment:4 Changed 5 years ago by matteo.gialli@…

Just posted the issue in Mercury's forum (where Mercury's users report bugs); a little additional info: I'm using Skype too, it can show current song from iTunes too, but no focus loss issues. Different approach ? Anyway, in my forum post on Mercury's page, there is a link to this ticket page, so they can read the full description of the problem, including the references in lits.apple.com and macosxhints. Let me know if I can do something more!

comment:5 Changed 5 years ago by jeremyhu@…

  • Milestone changed from 2.2.1 to 2.3.0

comment:6 Changed 5 years ago by jeremyhu@…

  • Milestone changed from 2.3.0 to 2.3.1

comment:7 Changed 5 years ago by jeremyhu@…

  • Milestone changed from 2.3.1 to 2.3.2

comment:8 Changed 5 years ago by jeremyhu@…

Can you please test out http://static.macosforge.org/xquartz/downloads/X11-2.3.1_beta2.pkg and let me know if this is still an issue.

comment:9 Changed 5 years ago by lra@…

I still experience the lost focus problem. :-( But the about box still says its version 2.3.0, even though i think i installed 2.3.1_beta2. Perhaps I screwed up the installation? (But I think not, the dates on the files are the same as I see in the pkg file with the Pacifist app)

comment:10 Changed 5 years ago by jeremyhu@…

Yeah, I forgot to update the plist in 2.3.0_beta2. You should probably grab 2.3.1_rc2 for the latest updates (this won't be addressed).

How reproducible is it? I'm fairly certain this isn't X11's fault now. Something is stealing focus... and more specifically, something is letting focus be stolen from X11 when it isn't from other Applications.

Can you tell me how to reproduce or trigger the issue?

comment:11 Changed 5 years ago by lra@…

I don't have to do anything, really. Just start X11, an xterm is started automatically, and the cursor is a filled black box. Then after some seconds, it is turned into an empty box, and the window title bar is greyed a little, i.e. it has lost focus. X11.app is still the front-most application, i.e. it still controls the Mac menu bar, etc.

I think I have found the offending program. For me it is Mail Status Control.app from http://xoomer.alice.it/czk/mac/

Whenever the windows has lost its focus, I can see that it has been running. I typed

$ top -n 10 -i1 -o cpu

on the Terminal command line (show 10 processes, update interval 1 second, sort order cpu utilization) which helped me to find it.

Perhaps the bug is in Mail Status Control.app, but I think the bug could be in X11.app too, because I think it should not be sensitive to other applications. I have read elsewhere that people have been having problems with the last.fm player, etc. so it seems to be more than one program that triggers this bug.

I hope you can reproduce the symptom with the Mail Status Control.app. Thanks for doing a great job with this!

Cheers, /Lars

comment:12 Changed 5 years ago by matteo.gialli@…

Sorry for being inactive untill now, I was away for holidays but I'm here now: the problem was triggered using a feature of Mercury Messenger application while using X11; Mercury is an MSN (and other protocols) client, and has a feature that can get current song from iTunes and set the title of the song as "msn status message" (or "mood message", don't remember exactly how is called in msn world); I experienced focus loss (the original reason of posting this bug months ago) while using X11 and Mercury with "get current song from iTunes" feature enabled; if you have an msn account, you can simply reproduce the bug installing Mercury Messenger for mac, logging in MSN and activating the option for getting current song from iTunes, every time Mercury tries to update current song from iTunes (I guess), X11 window loses focus.

So, in order of reproducing the issue, you should: 1) install Mercury and log in a MSN account 2) activatethe the "get current song from iTunes" option (I'm sorry but I only have the italian version so i can't report the exact name in english, by the way it's right under the text panel for setting the status/mood message in the account settings window in Mercury) 3) Play something on iTunes 4) run X11, a terminal with nano is ok; 5) just wait, or better write something (i usually experience the issue with xchat2); after some time (circa 30 secs), the window will lose focus and you'll be notified of it because if you try to type something you'll get error beeps and the window bar will look as a non-focused window

This happens every 30 secs circa, so I guessed it may be related to the moment when Mercury checks iTunes for the current song; something very similar happened to last FM users too. In my opinion, and I'm not a skilled coder- just a student, the problem may be caused by something in X11 (as is the only app losing focus) or by the function called to get current song (something provided by system APIs for interacting with iTunes? example: both Mercury and Lastfm calling the same "bad" old and deprecated function offered to interact with iTunes, that steals focus to X11 - no idea of how this may happen, i'm just wondering). As already reported months ago, Skype has a very similar option for getting iTunes song and setting the title as mood message, but it causes no problem with X11 (that's why i thought to a specific "bad" function that may create problem to X11, maybe Skype uses a better new nice right function that does not steals focus to X11, or something similar).

I just checked the beta you linked days ago, the problem is still there :/ as you may uderstand, I'm not sure the problem is caused by X11, maybe it's just suffering of problems caused by some other portions of code in the system..

I hope this may be usefull, if you have any question just ask and i'll try to help.

Thanks for your work and time

Matteo

comment:13 Changed 5 years ago by mta@…

For what it's worth I saw this bug a few days ago running XEmacs under X11 1.1.3 on 10.4.11 so it's clearly not a bug unique to Leopard or the newer version of X11. I don't know what program triggered it since when I rebooted it went away and I haven't seen it since. I rarely run iTunes and don't have any program that displays the current song playing when I do run it so it is probably something else unrelated to iTunes.

comment:14 Changed 5 years ago by jeremyhu@…

  • Milestone changed from 2.3.2 to 2.3.3

comment:15 Changed 4 years ago by jeremyhu@…

  • Milestone changed from 2.3.3 to 2.4.0

comment:16 follow-up: ↓ 17 Changed 4 years ago by wormey@…

I just wanted to add a datapoint... I was also having a focus loss problem, various intervals of less than a second. Through 10.5.6, reversion to 10.4 Xwindows, 10.5.7, and macosforge updates 2.3.2.1 and 2.3.3. Turns out in my was it was the application Trampoline. Turned that off, and all is well.

comment:17 in reply to: ↑ 16 Changed 4 years ago by wormey@…

Replying to wormey@…:

Turns out in my was it was the application Trampoline. Turned that off, and all is well.

BTW, I did not have last.fm installed.

comment:18 Changed 4 years ago by jeremyhu@…

  • Milestone changed from 2.4.0 to 2.4.1

comment:19 Changed 4 years ago by jeremyhu@…

Reported on the xquartz-dev list:

Looking at this process list there seem not very many candidates hiding the problem, and simply shooting off "UserEventAgent" I finally could reproduce this screen-switching phenomenon willfully. It appears this service is automatically started anew and during this time I always observed the screen-switching. So it appears in my case the problem is in

/System/Library/UserEventPlugins/iCalAlarmAgent.plugin/

as having wiped away this directory these X11->Aqua->X11 unintended switches instantly stopped, and having closely observed the X11-behaviour for few days now since then I can confidently confirm this phenomenon is gone.

comment:20 Changed 3 years ago by jeremyhu@…

  • Milestone changed from 2.5.0 to 2.5.1

comment:21 Changed 3 years ago by jeremyhu@…

  • Milestone changed from 2.5.1 to OSX

<rdar://problem/7150340>

comment:22 Changed 3 years ago by mta@…

  • Cc mta@… added

Cc Me!

comment:23 Changed 3 years ago by tgl@…

The connection to iCal makes me think this is the same issue that I've reported in the past. What I have found is that the loss of focus occurs exactly one minute before an iCal alarm is due to fire.

comment:24 Changed 3 years ago by jeremyhu@…

As this is a bug outside of X11, I suggest you file bug reports at http://bugreport.apple.com which will then create noise about this issue and hopefully get it fixed sooner rather than later...

comment:25 Changed 3 years ago by Lars.Rasmusson@…

  • Cc Lars.Rasmusson@… added

Cc Me!

comment:26 Changed 3 years ago by Lars.Rasmusson@…

  • Cc Lars.Rasmusson@… removed

Cc Me!

comment:27 Changed 22 months ago by jeremyhu@…

Does this still happen with 2.6.3? I made some changes to application activation which I hope might fix this, but I have no way of knowing... feedback on whether or not this happens with 2.6.3 is appreciated.

comment:28 Changed 22 months ago by edmwagner@…

I lose focus anytime an LSUIElement application is launched. I've been running 2.6.3 for a couple days hoping it would help, but it did not.

comment:29 Changed 21 months ago by edmwagner@…

I also just upgraded to XQuartz 2.7.0_beta1 (xorg-server 1.10.99.901) but am seeing the same behavior.

Perhaps it is not related to the last.fm issue and I should open a separate ticket?

comment:30 Changed 19 months ago by danny.bloemendaal@…

I'm having this nuts-driving bug for a very long time now and it makes me so frustrated. Right now, running XQuartz 2.6.3 at this moment my X11-based editor is losing focus almost every minute (running lion here). Every time this happens this entry is added in the console.log:

com.apple.syncservices.SyncServer: 2011-11-03 15:45:15.915 AddressBookSync[91352:707] In standby, skipping sync

Oh please please can some finally nail this problem!? I'd love to help find the problem in some way. But let it go away.

comment:31 Changed 9 months ago by barmar@…

I've been having this problem for as long as I can remember. I'm currently running XQuartz 2.7.2 on Snow Leopard. The only X11 app I use is Wireshark, and it has been happening for years. I don't see any messages in console.log when it happens, so I can't link it with any other application.

It doesn't happen on a fixed period, but always about 30-35 seconds after clicking on the window to give it focus.

comment:32 Changed 9 months ago by barmar@…

  • Cc barmar@… added

Cc Me!

comment:33 Changed 7 months ago by jeremyhu@…

<rdar://problem/7150340>

comment:34 Changed 7 months ago by wormey@…

  • Cc wormey@… added

Cc Me!

comment:35 Changed 7 months ago by wormey@…

  • Cc wormey@… removed

Cc Me!

comment:36 Changed 7 weeks ago by cubranic@…

  • Cc cubranic@… added

Cc Me!

comment:37 Changed 7 weeks ago by cubranic@…

Still there with 2.7.4. So far, I've seen the focus stolen by iCalAlarmAgent and Sophos anti-virus updater.

comment:38 Changed 6 weeks ago by cubranic@…

Also, the Google Chrome updater (bundle id com.google.Keystone.Agent).

comment:39 Changed 4 weeks ago by graehl@…

  • Cc graehl@… added

Cc Me!

comment:40 in reply to: ↑ description Changed 4 weeks ago by graehl@…

xquartz 2.7.4 - still broken. most notifiers steal keyboard focus while i'm typing in emacs (tunneled over ssh)

comment:41 Changed 3 weeks ago by wormey@…

  • Cc wormey@… added

Cc Me!

comment:42 Changed 3 weeks ago by wormey@…

  • Cc wormey@… removed

Cc Me!

Note: See TracTickets for help on using tickets.