aboutsummaryrefslogtreecommitdiff
path: root/spectrogram.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-08-22 14:01:34 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-08-22 14:01:34 +0000
commitd4c60743be32d6182f7dcd9936f00193e7f688fe (patch)
tree70ec9ef578be78f2a3c3419c1825b98b552f5039 /spectrogram.c
parent0731e73b523559661cbd1ec9b0e42eac5fd5ab25 (diff)
more hacking on fullscreen
Diffstat (limited to 'spectrogram.c')
-rw-r--r--spectrogram.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/spectrogram.c b/spectrogram.c
index 71d562c..5324496 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -375,25 +375,18 @@ move(Display *dsp, Window win, Window container)
int
gofullscreen(Display *d, Window win)
{
- XEvent xev;
- Atom state = XInternAtom(d, "_NET_WM_STATE", False);
- Atom fullscreen = XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", False);
-
- memset(&xev, 0, sizeof(xev));
- xev.xclient.type = ClientMessage;
- xev.xclient.serial = 0;
- xev.xclient.send_event = True;
- xev.xclient.window = win;
- xev.xclient.message_type = state;
- xev.xclient.format = 32;
- xev.xclient.data.l[0] = 1;
- xev.xclient.data.l[1] = fullscreen;
- xev.xclient.data.l[2] = 0;
- xev.xclient.data.l[3] = 0;
- xev.xclient.data.l[4] = 0;
+ XClientMessageEvent cm;
+
+ bzero(&cm, sizeof(cm));
+ cm.type = ClientMessage;
+ cm.window = win;
+ cm.message_type = XInternAtom(d, "_NET_WM_STATE", False);
+ cm.format = 32;
+ cm.data.l[0] = 1;
+ cm.data.l[1] = XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", False);
return XSendEvent(d, DefaultRootWindow(d), False,
- SubstructureRedirectMask|SubstructureNotifyMask, &xev);
+ NoEventMask, (XEvent *)&cm);
}
int