aboutsummaryrefslogtreecommitdiff
path: root/spectrogram.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-08-22 13:53:24 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-08-22 13:53:24 +0000
commit0731e73b523559661cbd1ec9b0e42eac5fd5ab25 (patch)
tree2935d3b034bb05e5f05f6bc9e8f2dcc372659860 /spectrogram.c
parentdc0772285d66f582510a14011a41039ebb805011 (diff)
more hack on fullscreen mode
Diffstat (limited to 'spectrogram.c')
-rw-r--r--spectrogram.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/spectrogram.c b/spectrogram.c
index cbfb856..71d562c 100644
--- a/spectrogram.c
+++ b/spectrogram.c
@@ -376,20 +376,24 @@ int
gofullscreen(Display *d, Window win)
{
XEvent xev;
- Atom wm_state = XInternAtom(d, "_NET_WM_STATE", False);
+ Atom state = XInternAtom(d, "_NET_WM_STATE", False);
Atom fullscreen = XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", False);
memset(&xev, 0, sizeof(xev));
- xev.type = ClientMessage;
+ xev.xclient.type = ClientMessage;
+ xev.xclient.serial = 0;
+ xev.xclient.send_event = True;
xev.xclient.window = win;
- xev.xclient.message_type = wm_state;
+ 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;
return XSendEvent(d, DefaultRootWindow(d), False,
- SubstructureNotifyMask, &xev);
+ SubstructureRedirectMask|SubstructureNotifyMask, &xev);
}
int
@@ -460,8 +464,10 @@ main(int argc, char **argv)
win = XCreateSimpleWindow(dsp, RootWindow(dsp, scr),
0, 0, width, height, 0, white, black);
- if (fflag && gofullscreen(dsp, win) != Success)
+ if (fflag && gofullscreen(dsp, win) != Success) {
+ fprintf(stderr, "failed to go fullscreen, trying resize\n");
XMoveResizeWindow(dsp, win, 0, 0, wa.width, wa.height);
+ }
XStoreName(dsp, win, __progname);
class = XAllocClassHint();