Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>2007-04-09 20:17:15 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@src.gnome.org>2007-04-09 20:17:15 (GMT)
commitea5c5eeb660d4175f6f44169f697511e925c12f9 (patch)
treef5d2531883d89a24c57e1faa7ad12553a74f80cb /shell
parent5ac7231bd357b88678418b4eec896e90c63b4384 (diff)
Do not make window bigger than screen. Fixes bug #388985.
2007-04-10 Nickolay V. Shmyrev <nshmyrev@yandex.ru> * shell/ev-window.c: (setup_size_from_metadata): Do not make window bigger than screen. Fixes bug #388985. svn path=/trunk/; revision=2400
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-window.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index fe82fc8..7e9200c 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -900,8 +900,14 @@ setup_size_from_metadata (EvWindow *window)
if (window->priv->page_cache &&
ev_metadata_manager_get (uri, "window_width_ratio", &width_ratio, FALSE) &&
ev_metadata_manager_get (uri, "window_height_ratio", &height_ratio, FALSE)) {
+
gint document_width;
gint document_height;
+
+ GdkScreen *screen;
+
+ gint request_width;
+ gint request_height;
ev_page_cache_get_max_width (window->priv->page_cache,
0, 1.0,
@@ -910,9 +916,19 @@ setup_size_from_metadata (EvWindow *window)
0, 1.0,
&document_height);
+ request_width = g_value_get_double (&width_ratio) * document_width;
+ request_height = g_value_get_double (&height_ratio) * document_height;
+
+ screen = gtk_window_get_screen (GTK_WINDOW (window));
+
+ if (screen) {
+ request_width = MIN (request_width, gdk_screen_get_width (screen));
+ request_height = MIN (request_width, gdk_screen_get_height (screen));
+ }
+
gtk_window_resize (GTK_WINDOW (window),
- g_value_get_double (&width_ratio) * document_width,
- g_value_get_double (&height_ratio) * document_height);
+ request_width,
+ request_height);
g_value_unset (&width_ratio);
g_value_unset (&height_ratio);
}