From: Carlos Garcia Campos Date: Fri, 27 Jul 2007 09:09:09 +0000 (+0000) Subject: Do not use display before initializing it. Remove compile warnings. X-Git-Tag: EVINCE_0_9_3~17 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=b712f364fbbc41c010613c3005befe66d6b8fe16;p=evince.git Do not use display before initializing it. Remove compile warnings. 2007-07-27 Carlos Garcia Campos * shell/ev-utils.c: (get_num_monitors): * shell/ev-window.c: (ev_window_sizing_mode_changed_cb): Do not use display before initializing it. Remove compile warnings. svn path=/trunk/; revision=2584 --- diff --git a/ChangeLog b/ChangeLog index 80b3494b..5723fd30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-07-27 Carlos Garcia Campos + + * shell/ev-utils.c: (get_num_monitors): + * shell/ev-window.c: (ev_window_sizing_mode_changed_cb): + + Do not use display before initializing it. Remove compile + warnings. + 2007-07-27 Cosimo Cecchi * shell/ev-view.c: (ev_view_class_init): diff --git a/shell/ev-utils.c b/shell/ev-utils.c index fabdeaa1..3e5c203f 100644 --- a/shell/ev-utils.c +++ b/shell/ev-utils.c @@ -376,27 +376,28 @@ ev_gui_menu_position_tree_selection (GtkMenu *menu, * Returns: Number of monitors, -1 if uncertain situation (like multiple screens) */ gint -get_num_monitors (GtkWindow * window) +get_num_monitors (GtkWindow *window) { - GdkDisplay * display; - GdkScreen * screen; - gint num_screen = gdk_display_get_n_screens(display); + GdkDisplay *display; + GdkScreen *screen; + gint num_screen; - display = gdk_display_get_default(); + display = gdk_display_get_default (); + num_screen = gdk_display_get_n_screens (display); if (num_screen != 1) return -1; if (window) - screen = gtk_window_get_screen(window); + screen = gtk_window_get_screen (window); else - screen = gdk_display_get_screen(display, 0); + screen = gdk_display_get_screen (display, 0); - return gdk_screen_get_n_monitors(screen); + return gdk_screen_get_n_monitors (screen); } gdouble -get_screen_dpi (GtkWindow * window) +get_screen_dpi (GtkWindow *window) { GdkScreen *screen; gdouble xdpi, ydpi; diff --git a/shell/ev-window.c b/shell/ev-window.c index 7e686c35..d9fc479c 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -3519,7 +3519,8 @@ ev_window_sizing_mode_changed_cb (EvView *view, GParamSpec *pspec, g_signal_handlers_disconnect_by_func (ev_window->priv->view, ev_view_update_view_size, scrolled_window); if (sizing_mode != EV_SIZING_FREE) - ev_view_update_view_size (ev_window->priv->view, GTK_SCROLLED_WINDOW (scrolled_window)); + ev_view_update_view_size (EV_VIEW (ev_window->priv->view), + GTK_SCROLLED_WINDOW (scrolled_window)); switch (sizing_mode) { case EV_SIZING_BEST_FIT: