gint last_window_width, last_window_height;
guint alloc_timeout;
+ guint notebook_alloc_timeout;
guint panel_timeout;
gint clear_private_data;
midori_transferbar_confirm_delete (MidoriTransferbar* transferbar);
static void
-_midori_browser_update_notebook (MidoriBrowser* browser);
+midori_browser_notebook_size_allocate_cb (GtkWidget* notebook,
+ GdkRectangle* allocation,
+ MidoriBrowser* browser);
void
midori_transferbar_add_download_item (MidoriTransferbar* transferbar,
const gchar* proxy_uri;
proxy = midori_view_get_proxy_item (view);
proxy_uri = katze_item_get_uri (proxy);
- if (proxy_uri && *proxy_uri && proxy_uri[1] &&
- !midori_uri_is_blank (proxy_uri) &&
+ if (!midori_uri_is_blank (proxy_uri) &&
(katze_item_get_meta_integer (proxy, "history-step") == -1))
{
if (!katze_item_get_meta_boolean (proxy, "dont-write-history"))
gtk_widget_set_size_request (label, -1, -1);
}
else
- _midori_browser_update_notebook (browser);
+ midori_browser_notebook_size_allocate_cb (NULL, NULL, browser);
}
static void
return FALSE;
}
-static void
-_midori_browser_update_notebook (MidoriBrowser* browser)
+static gboolean
+midori_browser_notebook_alloc_timeout (MidoriBrowser* browser)
{
guint i;
gint new_size = 0;
&& !katze_object_get_boolean (view, "minimized"))
gtk_widget_set_size_request (label, new_size, -1);
}
+
+ browser->notebook_alloc_timeout = 0;
+ return FALSE;
+}
+
+static void
+midori_browser_notebook_size_allocate_cb (GtkWidget* widget,
+ GdkRectangle* allocation,
+ MidoriBrowser* browser)
+{
+ if (browser->notebook_alloc_timeout > 0)
+ return;
+
+ browser->notebook_alloc_timeout = g_timeout_add_full (G_PRIORITY_LOW, 2500,
+ (GSourceFunc)midori_browser_notebook_alloc_timeout, browser, NULL);
}
static void
G_CALLBACK (midori_browser_tab_destroy_cb), browser);
_midori_browser_update_actions (browser);
- _midori_browser_update_notebook (browser);
+ midori_browser_notebook_size_allocate_cb (browser->notebook, NULL, browser);
}
static void
GtkWidget* view)
{
gtk_widget_destroy (view);
- _midori_browser_update_notebook (browser);
+ midori_browser_notebook_size_allocate_cb (browser->notebook, NULL, browser);
}
/**
}
}
-static void
-gtk_notebook_size_allocated_cb (GtkWidget* widget,
- GdkRectangle* allocation,
- MidoriBrowser* browser)
-{
- _midori_browser_update_notebook (browser);
-}
-
static void
midori_browser_destroy_cb (MidoriBrowser* browser)
{
midori_browser_notebook_reorder_tab_cb,
NULL);
g_signal_handlers_disconnect_by_func (browser->notebook,
- gtk_notebook_size_allocated_cb,
- NULL);
+ midori_browser_notebook_size_allocate_cb,
+ browser);
gtk_container_foreach (GTK_CONTAINER (browser->notebook),
(GtkCallback) gtk_widget_destroy, NULL);
}
G_CALLBACK (midori_browser_notebook_page_reordered_cb),
browser);
g_signal_connect (browser->notebook, "size-allocate",
- G_CALLBACK (gtk_notebook_size_allocated_cb),
+ G_CALLBACK (midori_browser_notebook_size_allocate_cb),
browser);
g_signal_connect_after (browser->notebook, "button-press-event",
G_CALLBACK (midori_browser_notebook_button_press_event_after_cb),