aboutsummaryrefslogtreecommitdiff
path: root/spectrogram.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-08-15 15:04:16 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-08-15 15:04:16 +0000
commit2e062ed2d529cf2b98abd7cfc4a80e00a7d3b96d (patch)
treeed9175ebae24d2c235d2f6a3b3bded90b1169a71 /spectrogram.c
parent9aa2f7ef4db3495ff8769abe1783d8aa195d1f87 (diff)
stub for automatic window sizing
Diffstat (limited to 'spectrogram.c')
-rw-r--r--spectrogram.c10
1 files changed, 9 insertions, 1 deletions
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);