[gnome-terminal/gnome-3-12] app: Fix the close button after drag-n-drop
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal/gnome-3-12] app: Fix the close button after drag-n-drop
- Date: Sun, 22 Jun 2014 12:42:59 +0000 (UTC)
commit 44059da4e216250b75fa90f6d0e65fd4aa4eab14
Author: Egmont Koblinger <egmont gmail com>
Date: Sun Jun 22 14:40:04 2014 +0200
app: Fix the close button after drag-n-drop
https://bugzilla.gnome.org/show_bug.cgi?id=731998
(cherry picked from commit c4b333658f275b908eb85ce2d6d5a30de221a30c)
src/terminal-notebook.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/terminal-notebook.c b/src/terminal-notebook.c
index 5862949..81005c5 100644
--- a/src/terminal-notebook.c
+++ b/src/terminal-notebook.c
@@ -58,13 +58,21 @@ update_tab_visibility (GtkNotebook *notebook,
static void
close_button_clicked_cb (TerminalTabLabel *tab_label,
- TerminalNotebook *notebook)
+ gpointer user_data)
{
TerminalScreen *screen;
+ TerminalNotebook *notebook;
screen = terminal_tab_label_get_screen (tab_label);
- g_signal_emit_by_name (notebook, "screen-close-request", screen);
+ /* notebook is not passed as user_data because it can change during DND
+ * and the close button is not notified about that, see bug 731998.
+ */
+ notebook = TERMINAL_NOTEBOOK (gtk_widget_get_ancestor (GTK_WIDGET (screen),
+ TERMINAL_TYPE_NOTEBOOK));
+
+ if (notebook != NULL)
+ g_signal_emit_by_name (notebook, "screen-close-request", screen);
}
@@ -88,7 +96,7 @@ terminal_notebook_add_screen (TerminalMdiContainer *container,
tab_label = terminal_tab_label_new (screen);
g_signal_connect (tab_label, "close-button-clicked",
- G_CALLBACK (close_button_clicked_cb), notebook);
+ G_CALLBACK (close_button_clicked_cb), NULL);
gtk_notebook_insert_page (gtk_notebook,
screen_container,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]