sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-28 05:57:34 +00:00
commit 88965415ff
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26235 changed files with 29195616 additions and 0 deletions

31
app/fvwm/libs/Grab.c Normal file
View 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);
}
}