]> spindle.queued.net Git - midori/commitdiff
Don't update the remembered window size when maximized.
authorOri Bernstein <ori@eigenstate.org>
Thu, 27 Dec 2007 00:22:34 +0000 (01:22 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 27 Dec 2007 00:22:34 +0000 (01:22 +0100)
If the window is maximized the effective size matches the available
screen size, thus after restarting the browser we end up with a
window the size of the screen in normal state.

src/browser.c

index 3840053f0ec47f5975366f458ebe9b2816d69fd2..66a29d405f232452a1753d94de013c6442a10a64 100644 (file)
@@ -826,8 +826,14 @@ void on_findbox_button_close_clicked(GtkWidget* widget, CBrowser* browser)
 static void on_window_size_allocate(GtkWidget* widget, GtkAllocation* allocation
  , CBrowser* browser)
 {
-    config->winWidth = allocation->width;
-    config->winHeight = allocation->height;
+     if(!GTK_WIDGET_REALIZED(widget))
+         return;
+     if(!(gdk_window_get_state(widget->window)
+      & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)))
+     {
+         config->winWidth = allocation->width;
+         config->winHeight = allocation->height;
+     }
 }
 
 gboolean on_window_destroy(GtkWidget* widget, GdkEvent* event, CBrowser* browser)