Fixed focus problem (clicking on an X11 window that sits behind
an Aqua window would not always bring it to the top of the stack.
This commit is contained in:
parent
b34d2ffc38
commit
9a8abcfa6d
|
@ -201,6 +201,8 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
|
||||||
if (_x_active) [self activateX:NO];
|
if (_x_active) [self activateX:NO];
|
||||||
} else if ([self modalWindow] == nil) {
|
} else if ([self modalWindow] == nil) {
|
||||||
/* Must be an X window. Tell appkit it doesn't have focus. */
|
/* Must be an X window. Tell appkit it doesn't have focus. */
|
||||||
|
WindowPtr pWin = xprGetXWindowFromAppKit([e windowNumber]);
|
||||||
|
if (pWin) RootlessReorderWindow(pWin);
|
||||||
for_appkit = NO;
|
for_appkit = NO;
|
||||||
|
|
||||||
if ([self isActive]) {
|
if ([self isActive]) {
|
||||||
|
|
|
@ -38,6 +38,9 @@ void AppleDRIExtensionInit(void);
|
||||||
void xprAppleWMInit(void);
|
void xprAppleWMInit(void);
|
||||||
Bool xprInit(ScreenPtr pScreen);
|
Bool xprInit(ScreenPtr pScreen);
|
||||||
Bool xprIsX11Window(void *nsWindow, int windowNumber);
|
Bool xprIsX11Window(void *nsWindow, int windowNumber);
|
||||||
|
WindowPtr xprGetX11Window(xp_window_id wid);
|
||||||
|
WindowPtr xprGetXWindowFromAppKit(int windowNumber);
|
||||||
|
|
||||||
void xprHideWindows(Bool hide);
|
void xprHideWindows(Bool hide);
|
||||||
|
|
||||||
Bool QuartzInitCursor(ScreenPtr pScreen);
|
Bool QuartzInitCursor(ScreenPtr pScreen);
|
||||||
|
|
|
@ -424,6 +424,37 @@ xprGetXWindow(xp_window_id wid)
|
||||||
return winRec != NULL ? winRec->win : NULL;
|
return winRec != NULL ? winRec->win : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Given the id of a physical window, try to find the top-level (or root)
|
||||||
|
* X window that it represents.
|
||||||
|
*/
|
||||||
|
WindowPtr
|
||||||
|
xprGetXWindowFromAppKit(int windowNumber)
|
||||||
|
{
|
||||||
|
RootlessWindowRec *winRec;
|
||||||
|
Bool ret;
|
||||||
|
xp_window_id wid;
|
||||||
|
|
||||||
|
if (window_hash == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* need to lock, since this function can be called by any thread */
|
||||||
|
|
||||||
|
pthread_mutex_lock(&window_hash_mutex);
|
||||||
|
|
||||||
|
if (xp_lookup_native_window(windowNumber, &wid))
|
||||||
|
ret = xprGetXWindow(wid) != NULL;
|
||||||
|
else
|
||||||
|
ret = FALSE;
|
||||||
|
|
||||||
|
pthread_mutex_unlock(&window_hash_mutex);
|
||||||
|
|
||||||
|
if (!ret) return NULL;
|
||||||
|
winRec = x_hash_table_lookup(window_hash, (void *) wid, NULL);
|
||||||
|
|
||||||
|
return winRec != NULL ? winRec->win : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The windowNumber is an AppKit window number. Returns TRUE if xpr is
|
* The windowNumber is an AppKit window number. Returns TRUE if xpr is
|
||||||
|
|
Loading…
Reference in New Issue
Block a user