GtkWidget* progressbar;
gchar* statusbar_text;
+ gint last_window_width, last_window_height;
guint alloc_timeout;
guint panel_timeout;
if (!(state &
(GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)))
- g_object_set (browser->settings,
- "last-window-width", widget->allocation.width,
- "last-window-height", widget->allocation.height, NULL);
+ {
+ if (widget->allocation.width != browser->last_window_width)
+ {
+ browser->last_window_width = widget->allocation.width;
+ g_object_set (browser->settings,
+ "last-window-width", browser->last_window_width, NULL);
+ }
+ if (widget->allocation.height != browser->last_window_height)
+ {
+ browser->last_window_height = widget->allocation.height;
+ g_object_set (browser->settings,
+ "last-window-height", widget->allocation.height, NULL);
+ }
+ }
browser->alloc_timeout = 0;
return FALSE;
{
GtkWidget* widget = GTK_WIDGET (browser);
- if (GTK_WIDGET_REALIZED (widget))
+ if (GTK_WIDGET_REALIZED (widget) && !browser->alloc_timeout)
{
gpointer last_page;
- GdkWindowState state = gdk_window_get_state (widget->window);
if ((last_page = g_object_get_data (G_OBJECT (browser), "last-page")))
{
g_object_set_data (G_OBJECT (browser), "last-page", NULL);
}
- if (!(state &
- (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN))
- && !browser->alloc_timeout)
- {
- browser->alloc_timeout = g_timeout_add_full (G_PRIORITY_LOW, 5000,
- (GSourceFunc)midori_browser_alloc_timeout, browser, NULL);
- }
+ browser->alloc_timeout = g_timeout_add_full (G_PRIORITY_LOW, 5000,
+ (GSourceFunc)midori_browser_alloc_timeout, browser, NULL);
}
}
_midori_browser_update_settings (MidoriBrowser* browser)
{
gboolean remember_last_window_size;
- gint last_window_width, last_window_height;
MidoriWindowState last_window_state;
gboolean compact_sidepanel, show_panel_controls;
gboolean right_align_sidepanel, open_panels_in_windows;
g_object_get (browser->settings,
"remember-last-window-size", &remember_last_window_size,
- "last-window-width", &last_window_width,
- "last-window-height", &last_window_height,
+ "last-window-width", &browser->last_window_width,
+ "last-window-height", &browser->last_window_height,
"last-window-state", &last_window_state,
"compact-sidepanel", &compact_sidepanel,
"show-panel-controls", &show_panel_controls,
if (remember_last_window_size)
{
- if (last_window_width && last_window_height)
+ if (browser->last_window_width && browser->last_window_height)
gtk_window_set_default_size (GTK_WINDOW (browser),
- last_window_width, last_window_height);
+ browser->last_window_width, browser->last_window_height);
else
gtk_window_set_default_size (GTK_WINDOW (browser),
default_width, default_height);