]> www.fi.muni.cz Git - evince.git/commitdiff
Do not make window bigger than screen. Fixes bug #388985.
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>
Mon, 9 Apr 2007 20:17:15 +0000 (20:17 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Mon, 9 Apr 2007 20:17:15 +0000 (20:17 +0000)
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

ChangeLog
shell/ev-window.c

index 64187725c6d41df055b0437ac7a3421d5948c7e3..72747c87164957a68f2ceceb5c7383b4b16748f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,11 @@
-2007-03-08  Carlos Garcia Campos  <carlosgc@gnome.org>
+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.
+
+2007-04-08  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * backend/tiff/tiff-document.c: (tiff_document_get_resolution),
        (tiff_document_get_page_size), (tiff_document_render_pixbuf):
@@ -6,7 +13,7 @@
        Use default resolution when it's not provided by document. Fixes bug
        #408762.
 
-2007-03-08  Carlos Garcia Campos  <carlosgc@gnome.org>
+2007-04-08  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * configure.ac:
        * thumbnailer/Makefile.am:
index fe82fc809a4b3c479a6f0252a53a7330aec04284..7e9200c5a912334e6beb373e0f2c647b5e64db41 100644 (file)
@@ -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);
        }