dix: don't store enter/leave and focus semaphores in a devPrivate.
We need them for each window, every time a window is allocated. Storing them in a devPrivate is the wrong thing to do. This also removes the unused ENTER_LEAVE_SEMAPHORE_ISSET macro. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
26f701704b
commit
f5841e9648
|
@ -6266,13 +6266,11 @@ ExtGrabDevice(ClientPtr client,
|
||||||
int
|
int
|
||||||
EnterLeaveSemaphoresIsset(WindowPtr win)
|
EnterLeaveSemaphoresIsset(WindowPtr win)
|
||||||
{
|
{
|
||||||
FocusSemaphoresPtr sem;
|
|
||||||
int set = 0;
|
int set = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
sem = (FocusSemaphoresPtr)dixLookupPrivate(&win->devPrivates, FocusPrivatesKey);
|
|
||||||
for (i = 0; i < (MAXDEVICES + 7)/8; i++)
|
for (i = 0; i < (MAXDEVICES + 7)/8; i++)
|
||||||
set += sem->enterleave[i];
|
set += win->enterleave[i];
|
||||||
|
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
|
@ -6283,13 +6281,11 @@ EnterLeaveSemaphoresIsset(WindowPtr win)
|
||||||
int
|
int
|
||||||
FocusSemaphoresIsset(WindowPtr win)
|
FocusSemaphoresIsset(WindowPtr win)
|
||||||
{
|
{
|
||||||
FocusSemaphoresPtr sem;
|
|
||||||
int set = 0;
|
int set = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
sem = (FocusSemaphoresPtr)dixLookupPrivate(&win->devPrivates, FocusPrivatesKey);
|
|
||||||
for (i = 0; i < (MAXDEVICES + 7)/8; i++)
|
for (i = 0; i < (MAXDEVICES + 7)/8; i++)
|
||||||
set += sem->focusinout[i];
|
set += win->focusinout[i];
|
||||||
|
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,8 +271,6 @@ Bool enableBackingStore = FALSE;
|
||||||
static void
|
static void
|
||||||
SetWindowToDefaults(WindowPtr pWin)
|
SetWindowToDefaults(WindowPtr pWin)
|
||||||
{
|
{
|
||||||
FocusSemaphoresPtr sem;
|
|
||||||
|
|
||||||
pWin->prevSib = NullWindow;
|
pWin->prevSib = NullWindow;
|
||||||
pWin->firstChild = NullWindow;
|
pWin->firstChild = NullWindow;
|
||||||
pWin->lastChild = NullWindow;
|
pWin->lastChild = NullWindow;
|
||||||
|
@ -302,8 +300,8 @@ SetWindowToDefaults(WindowPtr pWin)
|
||||||
pWin->redirectDraw = RedirectDrawNone;
|
pWin->redirectDraw = RedirectDrawNone;
|
||||||
pWin->forcedBG = FALSE;
|
pWin->forcedBG = FALSE;
|
||||||
|
|
||||||
sem = xcalloc(1, sizeof(FocusSemaphoresRec));
|
memset(pWin->enterleave, 0, sizeof(pWin->enterleave));
|
||||||
dixSetPrivate(&pWin->devPrivates, FocusPrivatesKey, sem);
|
memset(pWin->focusinout, 0, sizeof(pWin->focusinout));
|
||||||
|
|
||||||
#ifdef ROOTLESS
|
#ifdef ROOTLESS
|
||||||
pWin->rootlessUnhittable = FALSE;
|
pWin->rootlessUnhittable = FALSE;
|
||||||
|
|
|
@ -92,18 +92,10 @@ SOFTWARE.
|
||||||
|
|
||||||
/* Used for enter/leave and focus in/out semaphores */
|
/* Used for enter/leave and focus in/out semaphores */
|
||||||
#define SEMAPHORE_FIELD_SET(win, dev, field) \
|
#define SEMAPHORE_FIELD_SET(win, dev, field) \
|
||||||
{ \
|
(win)->field[(dev)->id/8] |= (1 << ((dev)->id % 8)); \
|
||||||
FocusSemaphoresPtr sem; \
|
|
||||||
sem = (FocusSemaphoresPtr)dixLookupPrivate(&win->devPrivates, FocusPrivatesKey); \
|
|
||||||
sem->field[dev->id/8] |= (1 << (dev->id % 8)); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define SEMAPHORE_FIELD_UNSET(win, dev, field) \
|
#define SEMAPHORE_FIELD_UNSET(win, dev, field) \
|
||||||
{ \
|
(win)->field[(dev)->id/8] &= ~(1 << ((dev)->id % 8));
|
||||||
FocusSemaphoresPtr sem; \
|
|
||||||
sem = (FocusSemaphoresPtr)dixLookupPrivate(&win->devPrivates, FocusPrivatesKey); \
|
|
||||||
sem->field[dev->id/8] &= ~(1 << (dev->id % 8)); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ENTER_LEAVE_SEMAPHORE_SET(win, dev) \
|
#define ENTER_LEAVE_SEMAPHORE_SET(win, dev) \
|
||||||
SEMAPHORE_FIELD_SET(win, dev, enterleave);
|
SEMAPHORE_FIELD_SET(win, dev, enterleave);
|
||||||
|
@ -111,9 +103,6 @@ SOFTWARE.
|
||||||
#define ENTER_LEAVE_SEMAPHORE_UNSET(win, dev) \
|
#define ENTER_LEAVE_SEMAPHORE_UNSET(win, dev) \
|
||||||
SEMAPHORE_FIELD_UNSET(win, dev, enterleave);
|
SEMAPHORE_FIELD_UNSET(win, dev, enterleave);
|
||||||
|
|
||||||
#define ENTER_LEAVE_SEMAPHORE_ISSET(win, dev) \
|
|
||||||
((FocusSemaphoresPtr)dixLookupPrivate(&win->devPrivates, FocusPrivatesKey))->enterleave[dev->id/8] & (1 << (dev->id % 8))
|
|
||||||
|
|
||||||
#define FOCUS_SEMAPHORE_SET(win, dev) \
|
#define FOCUS_SEMAPHORE_SET(win, dev) \
|
||||||
SEMAPHORE_FIELD_SET(win, dev, focusinout);
|
SEMAPHORE_FIELD_SET(win, dev, focusinout);
|
||||||
|
|
||||||
|
@ -121,7 +110,7 @@ SOFTWARE.
|
||||||
SEMAPHORE_FIELD_UNSET(win, dev, focusinout);
|
SEMAPHORE_FIELD_UNSET(win, dev, focusinout);
|
||||||
|
|
||||||
#define FOCUS_SEMAPHORE_ISSET(win, dev) \
|
#define FOCUS_SEMAPHORE_ISSET(win, dev) \
|
||||||
((FocusSemaphoresPtr)dixLookupPrivate(&win->devPrivates, FocusPrivatesKey))->focusinout[dev->id/8] & (1 << (dev->id % 8))
|
(win)->focusinout[(dev)->id/8] & (1 << ((dev)->id % 8))
|
||||||
|
|
||||||
typedef unsigned long Leds;
|
typedef unsigned long Leds;
|
||||||
typedef struct _OtherClients *OtherClientsPtr;
|
typedef struct _OtherClients *OtherClientsPtr;
|
||||||
|
|
|
@ -188,6 +188,12 @@ typedef struct _Window {
|
||||||
#ifdef ROOTLESS
|
#ifdef ROOTLESS
|
||||||
unsigned rootlessUnhittable:1; /* doesn't hit-test */
|
unsigned rootlessUnhittable:1; /* doesn't hit-test */
|
||||||
#endif
|
#endif
|
||||||
|
/* Used to maintain semantics of core protocol for Enter/LeaveNotifies and
|
||||||
|
* FocusIn/Out events for multiple pointers/keyboards. Each device ID
|
||||||
|
* corresponds to one bit. If set, the device is in the window/has focus.
|
||||||
|
*/
|
||||||
|
char enterleave[(MAXDEVICES + 7)/8];
|
||||||
|
char focusinout[(MAXDEVICES + 7)/8];
|
||||||
} WindowRec;
|
} WindowRec;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -244,17 +250,5 @@ typedef struct _ScreenSaverStuff {
|
||||||
|
|
||||||
extern int screenIsSaved;
|
extern int screenIsSaved;
|
||||||
extern ScreenSaverStuffRec savedScreenInfo[MAXSCREENS];
|
extern ScreenSaverStuffRec savedScreenInfo[MAXSCREENS];
|
||||||
extern DevPrivateKey FocusPrivatesKey;
|
|
||||||
|
|
||||||
/* Used to maintain semantics of core protocol for Enter/LeaveNotifies and
|
|
||||||
* FocusIn/Out events for multiple pointers/keyboards.
|
|
||||||
*
|
|
||||||
* Each device ID corresponds to one bit. If set, the device is in the
|
|
||||||
* window/has focus.
|
|
||||||
*/
|
|
||||||
typedef struct _FocusSemaphores {
|
|
||||||
char enterleave[(MAXDEVICES + 7)/8];
|
|
||||||
char focusinout[(MAXDEVICES + 7)/8];
|
|
||||||
} FocusSemaphoresRec, *FocusSemaphoresPtr;
|
|
||||||
|
|
||||||
#endif /* WINDOWSTRUCT_H */
|
#endif /* WINDOWSTRUCT_H */
|
||||||
|
|
Loading…
Reference in New Issue