summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-01-31 09:20:41 +0100
committerraveit65 <[email protected]>2017-01-31 09:20:41 +0100
commit2c530ab0d31b2fe8680cbfc2b8689704498f8fc9 (patch)
treef9ed79e09da16343868826eaa7bf83a77fbb7dde
parent35583b2b688a580a4d824112e45e39a1436d55e5 (diff)
downloadmate-terminal-2c530ab0d31b2fe8680cbfc2b8689704498f8fc9.tar.bz2
mate-terminal-2c530ab0d31b2fe8680cbfc2b8689704498f8fc9.tar.xz
call gtk_notebook_detach_tab only if the tab is detached
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1398234
-rw-r--r--src/terminal-window.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c
index b0977fb..1a01dda 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -44,6 +44,8 @@
#include "skey-popup.h"
#endif
+static gboolean detach_tab = FALSE;
+
struct _TerminalWindowPrivate
{
GtkActionGroup *action_group;
@@ -2637,8 +2639,15 @@ terminal_window_remove_screen (TerminalWindow *window,
screen_container = terminal_screen_container_get_from_screen (screen);
#if GTK_CHECK_VERSION(3, 16, 0)
- gtk_notebook_detach_tab (GTK_NOTEBOOK (priv->notebook),
- GTK_WIDGET (screen_container));
+ if (detach_tab)
+ {
+ gtk_notebook_detach_tab (GTK_NOTEBOOK (priv->notebook),
+ GTK_WIDGET (screen_container));
+ detach_tab = FALSE;
+ }
+ else
+ gtk_container_remove (GTK_CONTAINER (priv->notebook),
+ GTK_WIDGET (screen_container));
#else
gtk_container_remove (GTK_CONTAINER (priv->notebook),
GTK_WIDGET (screen_container));
@@ -2669,6 +2678,9 @@ terminal_window_move_screen (TerminalWindow *source_window,
*/
g_object_ref_sink (screen_container);
g_object_ref_sink (screen);
+
+ detach_tab = TRUE;
+
terminal_window_remove_screen (source_window, screen);
/* Now we can safely remove the screen from the container and let the container die */