From 2fcb9c67901a5421169c5f79292d67755dcc3a0c Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sun, 27 Mar 2011 16:02:34 +0000 Subject: [PATCH] Revert r5636 "Remove widget reparenting in Split Window plugin" It breaks the X PRIMARY selection on the normal Geany editor. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5640 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 7 ------- plugins/splitwindow.c | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2973b0305..23f7a9fd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,13 +6,6 @@ plugins need it. -2011-03-27 Colomban Wendling - - * plugins/splitwindow.c: - Remove widget reparenting in Split Window plugin. This fixes plugin - issues on Windows (patch by Matthew Brush, thanks - closes #2725342). - - 2011-03-26 Colomban Wendling * src/sidebar.c: diff --git a/plugins/splitwindow.c b/plugins/splitwindow.c index d1e0ca3c1..ff6750854 100644 --- a/plugins/splitwindow.c +++ b/plugins/splitwindow.c @@ -307,14 +307,14 @@ static void split_view(gboolean horizontal) set_state(horizontal ? STATE_SPLIT_HORIZONTAL : STATE_SPLIT_VERTICAL); - gtk_widget_ref(notebook); - gtk_container_remove(GTK_CONTAINER(parent), notebook); + /* temporarily put document notebook in main vbox (scintilla widgets must stay + * in a visible parent window, otherwise there are X selection and scrollbar issues) */ + gtk_widget_reparent(notebook, + ui_lookup_widget(geany->main_widgets->window, "vbox1")); pane = horizontal ? gtk_hpaned_new() : gtk_vpaned_new(); gtk_container_add(GTK_CONTAINER(parent), pane); - - gtk_container_add(GTK_CONTAINER(pane), notebook); - gtk_widget_unref(notebook); + gtk_widget_reparent(notebook, pane); box = gtk_vbox_new(FALSE, 0); toolbar = create_toolbar(); @@ -358,8 +358,10 @@ static void on_unsplit(GtkMenuItem *menuitem, gpointer user_data) g_return_if_fail(edit_window.editor); - gtk_widget_ref(notebook); - gtk_container_remove(GTK_CONTAINER(pane), notebook); + /* temporarily put document notebook in main vbox (scintilla widgets must stay + * in a visible parent window, otherwise there are X selection and scrollbar issues) */ + gtk_widget_reparent(notebook, + ui_lookup_widget(geany->main_widgets->window, "vbox1")); if (edit_window.sci != NULL && edit_window.handler_id > 0) { @@ -370,9 +372,7 @@ static void on_unsplit(GtkMenuItem *menuitem, gpointer user_data) gtk_widget_destroy(pane); edit_window.editor = NULL; edit_window.sci = NULL; - - gtk_container_add(GTK_CONTAINER(parent), notebook); - gtk_widget_unref(notebook); + gtk_widget_reparent(notebook, parent); }