From 2e062ed2d529cf2b98abd7cfc4a80e00a7d3b96d Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 15 Aug 2014 15:04:16 +0000 Subject: stub for automatic window sizing --- spectrogram.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'spectrogram.c') diff --git a/spectrogram.c b/spectrogram.c index 80c29b2..8ed4b20 100644 --- a/spectrogram.c +++ b/spectrogram.c @@ -379,6 +379,7 @@ main(int argc, char **argv) Atom nhints; XSizeHints *hints; XClassHint *class; + XWindowAttributes wa; int scr; struct panel *left, *right; @@ -390,6 +391,7 @@ main(int argc, char **argv) int delta; int width, height; unsigned long black, white; + float factor; while ((ch = getopt(argc, argv, "hd")) != -1) switch (ch) { @@ -415,9 +417,15 @@ main(int argc, char **argv) if (dflag) daemon(0, 0); + /* FIXME: not really useful */ + XGetWindowAttributes(dsp, DefaultRootWindow(dsp), &wa); + factor = (float)wa.height / (float)wa.width; + if (factor < 0.75) + factor = 0.75; + delta = get_round(sio); width = delta + HGAP; - height = 0.75 * width; + height = factor * width; scr = DefaultScreen(dsp); white = WhitePixel(dsp, scr); -- cgit v1.2.3