Bug 301053: hide statusbar resize-grip when maximized. Fix from Paolo Borelli
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Tue, 19 Apr 2005 09:20:46 +0000 (09:20 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Tue, 19 Apr 2005 09:20:46 +0000 (09:20 +0000)
ChangeLog
shell/ev-window.c

index 3d59e83398e776358452928c15abc3ca85936bd2..b42aace2a1830a8dc2596a4e2c6460df1408f5c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-04-19  Paolo Borelli <pborelli@katamail.com>
+
+       * shell/ev-window.c: (ev_window_state_event),
+       (ev_window_class_init), (ev_window_init):
+       
+       Doesn't show resize grip when maximized. See bug #301053
+
 2005-04-19  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * po/POTFILES.in:
index 6aabf14b730bea8608f2d5847b0ced865c03c9f1..26708788d897f816e516b29631678545ad583042 100644 (file)
@@ -1357,22 +1357,29 @@ ev_window_cmd_view_fullscreen (GtkAction *action, EvWindow *window)
 }
 
 static gboolean
-ev_window_state_event_cb (GtkWidget *widget, GdkEventWindowState *event, EvWindow *window)
+ev_window_state_event (GtkWidget *widget, GdkEventWindowState *event)
 {
-       if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
-       {
+       EvWindow *window = EV_WINDOW (widget);
+
+       if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) {
+               gboolean show;
+
+               show = (event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED) == 0;
+
+               gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (window->priv->statusbar),
+                                                  show);
+       }
+
+       if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) {
                GtkActionGroup *action_group;
                GtkAction *action;
                gboolean fullscreen;
 
                fullscreen = event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN;
 
-               if (fullscreen)
-               {
+               if (fullscreen) {
                        ev_window_fullscreen (window);
-               }
-               else
-               {
+               } else {
                        ev_window_unfullscreen (window);
                }
 
@@ -1384,7 +1391,6 @@ ev_window_state_event_cb (GtkWidget *widget, GdkEventWindowState *event, EvWindo
                gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), fullscreen);
                g_signal_handlers_unblock_by_func
                        (action, G_CALLBACK (ev_window_cmd_view_fullscreen), window);
-
        }
 
        return FALSE;
@@ -1985,6 +1991,7 @@ ev_window_class_init (EvWindowClass *ev_window_class)
 
        g_object_class->dispose = ev_window_dispose;
 
+       widget_class->window_state_event = ev_window_state_event;
        widget_class->focus_in_event = ev_window_focus_in_event;
        widget_class->focus_out_event = ev_window_focus_out_event;
 
@@ -2475,10 +2482,6 @@ ev_window_init (EvWindow *ev_window)
                          G_CALLBACK (find_bar_search_changed_cb),
                          ev_window);
 
-       g_signal_connect (ev_window, "window-state-event",
-                         G_CALLBACK (ev_window_state_event_cb),
-                         ev_window);
-
        /* Give focus to the scrolled window */
        gtk_widget_grab_focus (ev_window->priv->scrolled_window);