From: Carlos Garcia Campos Date: Fri, 2 Feb 2007 14:12:53 +0000 (+0000) Subject: Setup window size and position before showing it. Fixes bug #401711. X-Git-Tag: EVINCE_0_7_2~36 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=61a9bef64099404d5a7464891a6db4066dd4e7c1;p=evince.git Setup window size and position before showing it. Fixes bug #401711. 2007-02-02 Carlos Garcia Campos * shell/ev-window.c: (ev_window_open_uri), (window_configure_event_cb): Setup window size and position before showing it. Fixes bug #401711. svn path=/trunk/; revision=2285 --- diff --git a/ChangeLog b/ChangeLog index 95d2b55f..c1006046 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-02-02 Carlos Garcia Campos + + * shell/ev-window.c: (ev_window_open_uri), + (window_configure_event_cb): + + Setup window size and position before showing it. Fixes bug #401711. + 2007-02-02 Carlos Garcia Campos * backend/ps/Makefile.am: diff --git a/shell/ev-window.c b/shell/ev-window.c index 2556b62f..7cd803d3 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -918,7 +918,6 @@ setup_size_from_metadata (EvWindow *window) g_value_unset (&width_ratio); g_value_unset (&height_ratio); } - } static void @@ -1348,6 +1347,8 @@ ev_window_open_uri (EvWindow *ev_window, if (ev_window->priv->uri) g_free (ev_window->priv->uri); ev_window->priv->uri = g_strdup (uri); + + setup_size_from_metadata (ev_window); ev_window->priv->load_job = ev_job_load_new (uri, dest, mode); g_signal_connect (ev_window->priv->load_job, @@ -4351,12 +4352,15 @@ window_configure_event_cb (EvWindow *window, GdkEventConfigure *event, gpointer ev_page_cache_get_max_height (window->priv->page_cache, 0, 1.0, &document_height); - ev_metadata_manager_set_int (uri, "window_x", x); - ev_metadata_manager_set_int (uri, "window_y", y); ev_metadata_manager_set_double (uri, "window_width_ratio", - (double)width/document_width); + (double)width / document_width); ev_metadata_manager_set_double (uri, "window_height_ratio", - (double)height/document_height); + (double)height / document_height); + + ev_metadata_manager_set_int (uri, "window_x", x); + ev_metadata_manager_set_int (uri, "window_y", y); + ev_metadata_manager_set_int (uri, "window_width", width); + ev_metadata_manager_set_int (uri, "window_height", height); } }