Re: [Xquartz-dev] Xquartz-dev Digest, Vol 78, Issue 9
On Sunday March 22 2015 12:00:02 xquartz-dev-request@lists.macosforge.org wrote:
I presume since it is just XQuartz that is seeing this issue that there must be *something* I could do put XQuartz in a mode that would prevent this focus loss, but I'm at a loss to know what that is because I have no idea why the focus is being allowed to be stolen in the first place.
Let's see how wide open the door is I'm about to kick in :) I think that what happens is that some application starts in a way that it becomes the front application (is it (still) possible to launch an app through LaunchServices without that happening?). It, or the OS returns focus to the application that had it (which is something that could be done so quickly that there's very little chance anything gets lost). Normally, someone would know what window was the key window in that application, but X11 must be different. Either no window gets focus, or the wrong window. Myself I've never seen this happening, and I spend a lot of time in XTerms. I wonder if the reason is that I never use QuartzWM but something more traditional (recently migrated from ctwm 3.5 to xfmw4 4.11.2). If that's the case though, my explanation above cannot hold, or at least I don't see how. I can't imagine that a legacy WM like ctwm is prepared to restore focus after the X11 server lost and regained focus, it's author likely never dreamt such a thing would even be possible :) I *am* seeing another undesirable behaviour since updating from OS X 10.6.8 to 10.9 . I'm running rooted, and up to 10.6 I could bring 1 xterm to the front and have the others hidden behind native windows. Very practical if you're keeping a native browser window open for reference, for instance. This is still possible, but periodically all X windows will pop to the foreground. The reverse also happens. It's as if certain events cause the application belonging to the key window to be brought to the foreground - and that could actually be the same event in which others lose their X11 input focus. Hope this helps in some way... R.
On Mar 22, 2015, at 3:15 PM, René J.V. Bertin <rjvbertin@gmail.com> wrote:
On Sunday March 22 2015 12:00:02 xquartz-dev-request@lists.macosforge.org wrote:
I presume since it is just XQuartz that is seeing this issue that there must be *something* I could do put XQuartz in a mode that would prevent this focus loss, but I'm at a loss to know what that is because I have no idea why the focus is being allowed to be stolen in the first place.
Let's see how wide open the door is I'm about to kick in :)
I think that what happens is that some application starts in a way that it becomes the front application (is it (still) possible to launch an app through LaunchServices without that happening?). It, or the OS returns focus to the application that had it (which is something that could be done so quickly that there's very little chance anything gets lost). Normally, someone would know what window was the key window in that application, but X11 must be different. Either no window gets focus, or the wrong window.
Well, there is something wrong in the way XQuartz is handling focus. It's actually possible to demonstrate it entirely within XQuartz. With an xterm window open and focused, simply open the Help menu in XQuartz's menu bar. Since the Search item in that menu has a text field that receives focus, it steals it from the xterm window. When you dismiss the menu, the xterm window does not get focus back. I suspect that the problem with external apps stealing focus is similar. Something similar happens if you bring up the About XQuartz window and then close it. Or the Preferences window. Etc. Basically, when a Cocoa window is focused, X11 is deactivated. When the Cocoa window is closed, X11 is not reactivated. For the custom X server in CrossOver (based on a very old X.org code base), I created an invisible Cocoa window to act as a proxy for X11's focus. Basically, X11's focus has an entry in the Cocoa window list. When X11 has focus, that naturally takes focus away from other Cocoa windows. When Cocoa would return focus to its last key window (e.g. Help menu is dismissed; About panel is closed) and the proxy is that window, X11 gets focus. Regards, Ken
participants (2)
-
Ken Thomases
-
René J.V. Bertin