summaryrefslogtreecommitdiff
path: root/plugins/gtkui/widgets.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-10-13 21:54:11 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-10-13 21:54:11 +0200
commit1bf4f4706c941bfc26c46a3568f192bf6025f643 (patch)
treecec8d094723da7bba8af77017769e28916b311ca /plugins/gtkui/widgets.c
parent5dca25c91785f0e0e0957da4cb6f0d78dd259c40 (diff)
gtkui: fixed splitter locking bug
Diffstat (limited to 'plugins/gtkui/widgets.c')
-rw-r--r--plugins/gtkui/widgets.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/plugins/gtkui/widgets.c b/plugins/gtkui/widgets.c
index bb9fabf7..cb249835 100644
--- a/plugins/gtkui/widgets.c
+++ b/plugins/gtkui/widgets.c
@@ -882,16 +882,24 @@ w_splitter_lock (w_splitter_t *w) {
gtk_box_pack_end (GTK_BOX (box), c2, TRUE, TRUE, 0);
ddb_gtkui_widget_t *parent = w->base.parent;
- if (w->base.parent) {
- gtk_container_remove (GTK_CONTAINER (parent->widget), w->base.widget);
+ GtkWidget *cont = NULL;
+ if (parent) {
+ cont = parent->widget;
+ if (!strcmp (parent->type, "vsplitter") || !strcmp (parent->type, "hsplitter")) {
+ w_splitter_t *sp = (w_splitter_t *)parent;
+ if (sp->box) {
+ cont = sp->box;
+ }
+ }
+ gtk_container_remove (GTK_CONTAINER (cont), w->base.widget);
}
GtkWidget *eventbox = gtk_event_box_new ();
gtk_widget_show (eventbox);
gtk_container_add (GTK_CONTAINER (eventbox), box);
w->base.widget = eventbox;
w->box = box;
- if (w->base.parent) {
- gtk_container_add (GTK_CONTAINER (parent->widget), w->base.widget);
+ if (cont) {
+ gtk_container_add (GTK_CONTAINER (cont), w->base.widget);
}
w_splitter_init_signals (w);
}
@@ -923,13 +931,21 @@ w_splitter_unlock (w_splitter_t *w) {
gtk_paned_set_position (GTK_PANED (paned), w->position);
ddb_gtkui_widget_t *parent = w->base.parent;
- if (w->base.parent) {
- gtk_container_remove (GTK_CONTAINER (parent->widget), w->base.widget);
+ GtkWidget *cont = NULL;
+ if (parent) {
+ cont = parent->widget;
+ if (!strcmp (parent->type, "vsplitter") || !strcmp (parent->type, "hsplitter")) {
+ w_splitter_t *sp = (w_splitter_t *)parent;
+ if (sp->box) {
+ cont = sp->box;
+ }
+ }
+ gtk_container_remove (GTK_CONTAINER (cont), w->base.widget);
}
w->base.widget = paned;
w->box = NULL;
- if (w->base.parent) {
- gtk_container_add (GTK_CONTAINER (parent->widget), w->base.widget);
+ if (cont) {
+ gtk_container_add (GTK_CONTAINER (cont), w->base.widget);
}
w_splitter_init_signals (w);
}