summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2008-06-24 11:57:06 -0400
committerSøren Sandmann Pedersen <sandmann@redhat.com>2008-06-24 11:57:06 -0400
commit5e097eb4c24e6337f9efcc591c44682b5150deb2 (patch)
tree9a6b39e9eaab4493b3b78c9188a8c0fecf85d3c2
parent02a89709e71384a4f6ef54bfd97eb2c4100d8136 (diff)
Better default placement
-rw-r--r--siv.c3
-rw-r--r--window.c12
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)