aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-04 16:15:38 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-04 16:15:38 +0000
commit3bc9d276b32810e0a51d778dda68f0b1a2871916 (patch)
treee78d86d53aca8e59a245753865ace679dc43dd28
parentd53730775616da452dc9467b341ad72ac430eb21 (diff)
add maxsize hint
-rw-r--r--spectrogram.c7
1 files changed, 6 insertions, 1 deletions
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);