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

34
app/fvwm/libs/ClientMsg.c Normal file
View file

@ -0,0 +1,34 @@
/***************************************************************************
*
* ICCCM Client Messages - Section 4.2.8 of the ICCCM dictates that all
* client messages will have the following form:
*
* event type ClientMessage
* message type _XA_WM_PROTOCOLS
* window tmp->w
* format 32
* data[0] message atom
* data[1] time stamp
*
****************************************************************************/
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
Atom _XA_WM_PROTOCOLS = None;
void send_clientmessage (Display *disp, Window w, Atom a, Time timestamp)
{
XClientMessageEvent ev;
if (_XA_WM_PROTOCOLS == None)
_XA_WM_PROTOCOLS = XInternAtom(disp, "WM_PROTOCOLS", False);
ev.type = ClientMessage;
ev.window = w;
ev.message_type = _XA_WM_PROTOCOLS;
ev.format = 32;
ev.data.l[0] = a;
ev.data.l[1] = timestamp;
XSendEvent (disp, w, False, 0L, (XEvent *) &ev);
}