mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-09 07:18:05 +02:00
XQuartz: Fix issue where clicking on an X11 window might send that event to an X11 window in another space.
(cherry picked from commit 2e78818232)
This commit is contained in:
parent
c95170f23c
commit
df21312c8b
8 changed files with 29 additions and 12 deletions
|
|
@ -1730,7 +1730,8 @@ if test "X$XQUARTZ" = Xauto; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$XQUARTZ" = xyes; then
|
if test "x$XQUARTZ" = xyes; then
|
||||||
AC_DEFINE([XQUARTZ],[1],[Have Quartz])
|
AC_DEFINE(XQUARTZ,1,[Have Quartz])
|
||||||
|
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
|
||||||
|
|
||||||
#glxAGL / glxCGL don't work yet
|
#glxAGL / glxCGL don't work yet
|
||||||
# AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[
|
# AC_CACHE_CHECK([for AGL framework],xorg_cv_AGL_framework,[
|
||||||
|
|
|
||||||
|
|
@ -2157,6 +2157,13 @@ XYToWindow(int x, int y)
|
||||||
wInputShape(pWin),
|
wInputShape(pWin),
|
||||||
x - pWin->drawable.x,
|
x - pWin->drawable.x,
|
||||||
y - pWin->drawable.y, &box))
|
y - pWin->drawable.y, &box))
|
||||||
|
#endif
|
||||||
|
#ifdef ROOTLESS
|
||||||
|
/* In rootless mode windows may be offscreen, even when
|
||||||
|
* they're in X's stack. (E.g. if the native window system
|
||||||
|
* implements some form of virtual desktop system).
|
||||||
|
*/
|
||||||
|
&& !pWin->rootlessUnhittable
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -300,6 +300,9 @@ SetWindowToDefaults(WindowPtr pWin)
|
||||||
#ifdef COMPOSITE
|
#ifdef COMPOSITE
|
||||||
pWin->redirectDraw = RedirectDrawNone;
|
pWin->redirectDraw = RedirectDrawNone;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ROOTLESS
|
||||||
|
pWin->rootlessUnhittable = FALSE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,10 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include "applewmExt.h"
|
#include "applewmExt.h"
|
||||||
#include <X11/extensions/applewm.h>
|
#include <X11/extensions/applewm.h>
|
||||||
|
|
||||||
|
/* FIXME: Abstract this away into xpr */
|
||||||
|
#include <Xplugin.h>
|
||||||
|
#include "rootlessWindow.h"
|
||||||
|
WindowPtr xprGetXWindow(xp_window_id wid);
|
||||||
|
|
||||||
/* Fake button press/release for scroll wheel move. */
|
/* Fake button press/release for scroll wheel move. */
|
||||||
#define SCROLLWHEELUPFAKE 4
|
#define SCROLLWHEELUPFAKE 4
|
||||||
|
|
@ -228,7 +232,7 @@ void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, int neven
|
||||||
|
|
||||||
case kXquartzWindowState:
|
case kXquartzWindowState:
|
||||||
DEBUG_LOG("kXquartzWindowState\n");
|
DEBUG_LOG("kXquartzWindowState\n");
|
||||||
RootlessNativeWindowStateChanged(xe[i].u.clientMessage.u.l.longs0,
|
RootlessNativeWindowStateChanged(xprGetXWindow(xe[i].u.clientMessage.u.l.longs0),
|
||||||
xe[i].u.clientMessage.u.l.longs1);
|
xe[i].u.clientMessage.u.l.longs1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "colormapst.h"
|
#include "colormapst.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "rootlessWindow.h"
|
|
||||||
|
|
||||||
// System headers
|
// System headers
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,9 @@ typedef struct _Window {
|
||||||
unsigned forcedBS:1; /* system-supplied backingStore */
|
unsigned forcedBS:1; /* system-supplied backingStore */
|
||||||
#ifdef COMPOSITE
|
#ifdef COMPOSITE
|
||||||
unsigned redirectDraw:2; /* rendering is redirected from here */
|
unsigned redirectDraw:2; /* rendering is redirected from here */
|
||||||
|
#endif
|
||||||
|
#ifdef ROOTLESS
|
||||||
|
unsigned rootlessUnhittable:1; /* doesn't hit-test */
|
||||||
#endif
|
#endif
|
||||||
DevUnion *devPrivates;
|
DevUnion *devPrivates;
|
||||||
} WindowRec;
|
} WindowRec;
|
||||||
|
|
|
||||||
|
|
@ -117,12 +117,10 @@ rootlessHasRoot (ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RootlessNativeWindowStateChanged (xp_window_id id, unsigned int state)
|
RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state)
|
||||||
{
|
{
|
||||||
WindowPtr pWin;
|
|
||||||
RootlessWindowRec *winRec;
|
RootlessWindowRec *winRec;
|
||||||
|
|
||||||
pWin = xprGetXWindow (id);
|
|
||||||
if (pWin == NULL) return;
|
if (pWin == NULL) return;
|
||||||
|
|
||||||
winRec = WINREC (pWin);
|
winRec = WINREC (pWin);
|
||||||
|
|
@ -130,7 +128,7 @@ RootlessNativeWindowStateChanged (xp_window_id id, unsigned int state)
|
||||||
|
|
||||||
winRec->is_offscreen = ((state & XP_WINDOW_STATE_OFFSCREEN) != 0);
|
winRec->is_offscreen = ((state & XP_WINDOW_STATE_OFFSCREEN) != 0);
|
||||||
winRec->is_obscured = ((state & XP_WINDOW_STATE_OBSCURED) != 0);
|
winRec->is_obscured = ((state & XP_WINDOW_STATE_OBSCURED) != 0);
|
||||||
// pWin->rootlessUnhittable = winRec->is_offscreen;
|
pWin->rootlessUnhittable = winRec->is_offscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -143,7 +141,7 @@ RootlessNativeWindowMoved (WindowPtr pWin)
|
||||||
ClientPtr client;
|
ClientPtr client;
|
||||||
RootlessWindowRec *winRec = WINREC(pWin);
|
RootlessWindowRec *winRec = WINREC(pWin);
|
||||||
|
|
||||||
if (xp_get_window_bounds (winRec->wid, &bounds) != Success) return;
|
if (xp_get_window_bounds ((xp_window_id)winRec->wid, &bounds) != Success) return;
|
||||||
|
|
||||||
sx = dixScreenOrigins[pWin->drawable.pScreen->myNum].x + darwinMainScreenX;
|
sx = dixScreenOrigins[pWin->drawable.pScreen->myNum].x + darwinMainScreenX;
|
||||||
sy = dixScreenOrigins[pWin->drawable.pScreen->myNum].y + darwinMainScreenY;
|
sy = dixScreenOrigins[pWin->drawable.pScreen->myNum].y + darwinMainScreenY;
|
||||||
|
|
@ -1428,6 +1426,10 @@ RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent)
|
||||||
|
|
||||||
pTopWin = TopLevelParent(pWin);
|
pTopWin = TopLevelParent(pWin);
|
||||||
assert(pTopWin != pWin);
|
assert(pTopWin != pWin);
|
||||||
|
|
||||||
|
pWin->rootlessUnhittable = FALSE;
|
||||||
|
|
||||||
|
DeleteProperty (pWin, xa_native_window_id ());
|
||||||
|
|
||||||
if (WINREC(pTopWin) != NULL) {
|
if (WINREC(pTopWin) != NULL) {
|
||||||
/* We're screwed. */
|
/* We're screwed. */
|
||||||
|
|
@ -1484,7 +1486,7 @@ RootlessFlushWindowColormap (WindowPtr pWin)
|
||||||
wc.colormap = RootlessColormapCallback;
|
wc.colormap = RootlessColormapCallback;
|
||||||
wc.colormap_data = pWin->drawable.pScreen;
|
wc.colormap_data = pWin->drawable.pScreen;
|
||||||
|
|
||||||
configure_window (winRec->wid, XP_COLORMAP, &wc);
|
configure_window ((xp_window_id)winRec->wid, XP_COLORMAP, &wc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,6 @@
|
||||||
|
|
||||||
#include "rootlessCommon.h"
|
#include "rootlessCommon.h"
|
||||||
|
|
||||||
#include <Xplugin.h>
|
|
||||||
|
|
||||||
Bool RootlessCreateWindow(WindowPtr pWin);
|
Bool RootlessCreateWindow(WindowPtr pWin);
|
||||||
Bool RootlessDestroyWindow(WindowPtr pWin);
|
Bool RootlessDestroyWindow(WindowPtr pWin);
|
||||||
|
|
||||||
|
|
@ -61,6 +59,6 @@ void RootlessPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion,
|
||||||
int what);
|
int what);
|
||||||
void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
|
void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
|
||||||
void RootlessNativeWindowMoved (WindowPtr pWin);
|
void RootlessNativeWindowMoved (WindowPtr pWin);
|
||||||
void RootlessNativeWindowStateChanged (xp_window_id id, unsigned int state);
|
void RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue