From 3bc9d276b32810e0a51d778dda68f0b1a2871916 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 4 Sep 2014 16:15:38 +0000 Subject: add maxsize hint --- spectrogram.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spectrogram.c b/spectrogram.c index f99d507..0ea0132 100644 --- a/spectrogram.c +++ b/spectrogram.c @@ -419,6 +419,7 @@ main(int argc, char **argv) int ch; int width, height; + unsigned int maxwidth, maxheight; unsigned long black, white; float factor = 0.75; int round = 1024; /* FFT is fastest with powers of two */ @@ -465,6 +466,8 @@ main(int argc, char **argv) height = wa.height; sio = init_sio(); + maxwidth = max_samples_sio(sio); + maxheight = wa.height; scr = DefaultScreen(dsp); white = WhitePixel(dsp, scr); @@ -490,9 +493,11 @@ main(int argc, char **argv) /* set minimal size */ nhints = XInternAtom(dsp, "WM_NORMAL_HINTS", 0); hints = XAllocSizeHints(); - hints->flags = PMinSize; + hints->flags = PMinSize|PMaxSize; hints->min_width = width; hints->min_height = height; + hints->max_width = maxwidth; + hints->max_height = maxheight; XSetWMSizeHints(dsp, win, hints, nhints); XFree(hints); -- cgit v1.2.3