[epiphany] Close window after drag/drop last tab to another window
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Close window after drag/drop last tab to another window
- Date: Sun, 28 Jul 2019 21:26:56 +0000 (UTC)
commit a262c9e65410aba80e4edb82daf61087e107e644
Author: Jan-Michael Brummer <jan brummer tabos org>
Date: Sun Jul 28 18:48:27 2019 +0200
Close window after drag/drop last tab to another window
Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/731
src/ephy-pages-popover.c | 3 +++
src/ephy-window.c | 8 ++++++++
2 files changed, 11 insertions(+)
---
diff --git a/src/ephy-pages-popover.c b/src/ephy-pages-popover.c
index 105acbfcf..8a4dc52ea 100644
--- a/src/ephy-pages-popover.c
+++ b/src/ephy-pages-popover.c
@@ -132,6 +132,9 @@ items_changed_cb (EphyPagesPopover *self,
{
EphyPageRow **items = g_new (EphyPageRow *, added);
+ if ((guint)(position + removed) > g_list_model_get_n_items (G_LIST_MODEL (self->list_store)))
+ return;
+
for (int i = 0; i < added; i++) {
items[i] = ephy_page_row_new (self->notebook, position + i);
ephy_page_row_set_adaptive_mode (EPHY_PAGE_ROW (items[i]),
diff --git a/src/ephy-window.c b/src/ephy-window.c
index bca85479c..df4f7d43d 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2730,6 +2730,14 @@ notebook_page_removed_cb (EphyNotebook *notebook,
(ephy_embed_get_web_view (embed), G_CALLBACK (download_only_load_cb), window);
tab_accels_update (window);
+
+ if (gtk_notebook_get_n_pages (window->notebook) == 0) {
+ EphyShell *shell = ephy_shell_get_default ();
+ GList *windows = gtk_application_get_windows (GTK_APPLICATION (shell));
+
+ if (g_list_length (windows) > 1)
+ gtk_window_close (GTK_WINDOW (window));
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]