[eog] Add more debug output to initial window size calculation



commit 0f7988cf16c8181d1b984130034556c59a1fa690
Author: Felix Riemann <friemann gnome org>
Date:   Wed Oct 23 18:57:47 2013 +0200

    Add more debug output to initial window size calculation
    
    Should help debugging the common problems here.

 src/eog-window.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/eog-window.c b/src/eog-window.c
index 26b0fbb..37ce39a 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -1212,10 +1212,15 @@ eog_window_obtain_desired_size (EogImage  *image,
                gtk_widget_realize (window->priv->view);
        }
 
+       eog_debug_message (DEBUG_WINDOW, "Initial Image Size: %d x %d", img_width, img_height);
+
        gtk_widget_get_allocation (window->priv->view, &allocation);
        view_width  = allocation.width;
        view_height = allocation.height;
 
+       eog_debug_message (DEBUG_WINDOW, "Initial View Size: %d x %d", view_width, view_height);
+
+
        if (!gtk_widget_get_realized (GTK_WIDGET (window))) {
                gtk_widget_realize (GTK_WIDGET (window));
        }
@@ -1224,6 +1229,9 @@ eog_window_obtain_desired_size (EogImage  *image,
        window_width  = allocation.width;
        window_height = allocation.height;
 
+       eog_debug_message (DEBUG_WINDOW, "Initial Window Size: %d x %d", window_width, window_height);
+
+
        screen = gtk_window_get_screen (GTK_WINDOW (window));
 
        gdk_screen_get_monitor_geometry (screen,
@@ -1234,9 +1242,13 @@ eog_window_obtain_desired_size (EogImage  *image,
        screen_width  = monitor.width;
        screen_height = monitor.height;
 
+       eog_debug_message (DEBUG_WINDOW, "Screen Size: %d x %d", screen_width, screen_height);
+
        deco_width = window_width - view_width;
        deco_height = window_height - view_height;
 
+       eog_debug_message (DEBUG_WINDOW, "Decoration Size: %d x %d", deco_width, deco_height);
+
        if (img_width > 0 && img_height > 0) {
                if ((img_width + deco_width > screen_width) ||
                    (img_height + deco_height > screen_height))
@@ -1247,6 +1259,9 @@ eog_window_obtain_desired_size (EogImage  *image,
                        height_factor = (screen_height * 0.85 - deco_height) / (double) img_height;
                        factor = MIN (width_factor, height_factor);
 
+                       eog_debug_message (DEBUG_WINDOW, "Scaling Factor: %.2lf", factor);
+
+
                        img_width = img_width * factor;
                        img_height = img_height * factor;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]