Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Xext/saver.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ CreateSaverWindow(ScreenPtr pScreen)

pPriv->installedMap = None;

if (GrabInProgress && GrabInProgress != pAttr->client->index)
if (dixAnyOtherGrabbed(pAttr->client))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with this code, but did you intend to move to check to grabClient instead of GrabInProgress?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless i haven't overlooked anything, these two variables updated at almost the same time.

return FALSE;

pWin = dixCreateWindow(pSaver->wid, pScreen->root,
Expand Down
6 changes: 6 additions & 0 deletions dix/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -4251,3 +4251,9 @@ DetachOffloadGPU(ScreenPtr secondary)
secondary->is_offload_secondary = FALSE;
}

bool dixAnyOtherGrabbed(ClientPtr client)
{
return ((grabState == GrabActive) &&
(grabClient != NULL) &&
(grabClient != client));
}
16 changes: 16 additions & 0 deletions dix/dix_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* drivers or extension modules. Thus the definitions here are not part of the
* Xserver's module API/ABI.
*/
#include <stdbool.h>

#include <X11/Xdefs.h>
#include <X11/Xfuncproto.h>
Expand Down Expand Up @@ -761,4 +762,19 @@ static inline int xmitClientEvent(ClientPtr pClient, xEvent ev)
int dixAllocColor(ClientPtr client, Colormap cmap, CARD16 *red,
CARD16 *green, CARD16 *blue, CARD32 *pixel);

/*
* retrieve current grab client or NULL (if no grab)
*
*/
ClientPtr dixGetGrabClient(void);

/*
* Check whether any client has grabbed the server and it's not
* the given client.
*
* @param client the client to check against
* @return TRUE if any client, except the given one, has grabbed
*/
bool dixAnyOtherGrabbed(ClientPtr client);

#endif /* _XSERVER_DIX_PRIV_H */
2 changes: 0 additions & 2 deletions include/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
extern _X_EXPORT const char *defaultFontPath;
extern _X_EXPORT int monitorResolution;
extern _X_EXPORT int defaultColorVisualClass;

extern _X_EXPORT int GrabInProgress;
extern _X_EXPORT char *SeatId;

#endif /* !_XSERV_GLOBAL_H_ */
2 changes: 1 addition & 1 deletion os/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static pid_t ParentProcess;
static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */
#endif

int GrabInProgress = 0;
static int GrabInProgress = 0;

static void
EstablishNewConnections(int curconn, int ready, void *data);
Expand Down
Loading