From 5e097eb4c24e6337f9efcc591c44682b5150deb2 Mon Sep 17 00:00:00 2001 From: Søren Sandmann Pedersen Date: Tue, 24 Jun 2008 11:57:06 -0400 Subject: Better default placement --- siv.c | 3 ++- window.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/siv.c b/siv.c index 71e2ff0..7820ca3 100644 --- a/siv.c +++ b/siv.c @@ -80,7 +80,8 @@ app_show_could_not_open (GtkWidget *parent_window, } void -app_register_window (App *app, SivWindow *window) +app_register_window (App *app, + SivWindow *window) { ++app->n_windows; } diff --git a/window.c b/window.c index e7831e1..43e15d0 100644 --- a/window.c +++ b/window.c @@ -912,8 +912,16 @@ set_defaults (SivWindow *window) } else { - width = monitor.width / 3; - height = (width * 4) / 3; + if (monitor.height < monitor.width) + { + height = (monitor.height * 3) / 4; + width = (3 * height) / 4; + } + else + { + width = (monitor.width) / 3; + height = (width * 4) / 3; + } } if (width > monitor.width) -- cgit v1.2.3