sync code with last improvements from OpenBSD
This commit is contained in:
commit
88965415ff
26235 changed files with 29195616 additions and 0 deletions
31
app/fvwm/libs/Grab.c
Normal file
31
app/fvwm/libs/Grab.c
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
** MyXGrabServer & MyXUngrabServer - to handle nested grab server calls
|
||||
*/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
/* Made into global for module interface. See module.c. */
|
||||
int myxgrabcount = 0;
|
||||
|
||||
void MyXGrabServer(Display *disp)
|
||||
{
|
||||
if (myxgrabcount == 0)
|
||||
{
|
||||
XGrabServer(disp);
|
||||
}
|
||||
++myxgrabcount;
|
||||
}
|
||||
|
||||
void MyXUngrabServer(Display *disp)
|
||||
{
|
||||
if (--myxgrabcount < 0) /* should never happen */
|
||||
{
|
||||
/* fvwm_msg(ERR,"MyXUngrabServer","too many ungrabs!\n"); */
|
||||
myxgrabcount = 0;
|
||||
}
|
||||
if (myxgrabcount == 0)
|
||||
{
|
||||
XUngrabServer(disp);
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue