summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-02-02 18:06:06 +0000
committerDavid Robillard <d@drobilla.net>2013-02-02 18:06:06 +0000
commit2fe13ccca8802113bbd3baf2b208d911db0dbcbc (patch)
tree5376be8dd18a0ee81f1606e0ddf17ca22de16fd9 /src
parent3e1ff3179ae986986d30e5e105279227d7b580c3 (diff)
downloadganv-2fe13ccca8802113bbd3baf2b208d911db0dbcbc.tar.gz
ganv-2fe13ccca8802113bbd3baf2b208d911db0dbcbc.tar.bz2
ganv-2fe13ccca8802113bbd3baf2b208d911db0dbcbc.zip
Fix strange bug where canvas stops updating entirely on node removal.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5025 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/canvas-base.c12
-rw-r--r--src/node.c12
-rw-r--r--src/port.c1
3 files changed, 13 insertions, 12 deletions
diff --git a/src/canvas-base.c b/src/canvas-base.c
index 653ebf2..59ed3de 100644
--- a/src/canvas-base.c
+++ b/src/canvas-base.c
@@ -249,22 +249,22 @@ ganv_item_dispose(GObject* object)
/* Make the canvas forget about us */
- if (item->canvas && ( item == item->canvas->current_item) ) {
+ if (item->canvas && item == item->canvas->current_item) {
item->canvas->current_item = NULL;
item->canvas->need_repick = TRUE;
}
- if (item->canvas && ( item == item->canvas->new_current_item) ) {
+ if (item->canvas && item == item->canvas->new_current_item) {
item->canvas->new_current_item = NULL;
item->canvas->need_repick = TRUE;
}
- if (item->canvas && ( item == item->canvas->grabbed_item) ) {
+ if (item->canvas && item == item->canvas->grabbed_item) {
item->canvas->grabbed_item = NULL;
gdk_pointer_ungrab(GDK_CURRENT_TIME);
}
- if (item->canvas && ( item == item->canvas->focused_item) ) {
+ if (item->canvas && item == item->canvas->focused_item) {
item->canvas->focused_item = NULL;
}
@@ -750,9 +750,13 @@ ganv_item_get_bounds(GanvItem* item, double* x1, double* y1, double* x2, double*
void
ganv_item_request_update(GanvItem* item)
{
+ /* FIXME: For some reason, if this short-circuit is enabled, the canvas
+ stops updating items entirely when connected modules are removed. */
+ /*
if (item->object.flags & GANV_ITEM_NEED_UPDATE) {
return;
}
+ */
item->object.flags |= GANV_ITEM_NEED_UPDATE;
diff --git a/src/node.c b/src/node.c
index ff214ba..062e54f 100644
--- a/src/node.c
+++ b/src/node.c
@@ -95,14 +95,14 @@ ganv_node_destroy(GtkObject* object)
ganv_node_disconnect(node);
if (item->canvas) {
ganv_canvas_remove_node(GANV_CANVAS(item->canvas), node);
- item->canvas = NULL;
}
- impl->partner = NULL;
-
if (GTK_OBJECT_CLASS(parent_class)->destroy) {
(*GTK_OBJECT_CLASS(parent_class)->destroy)(object);
}
+
+ impl->partner = NULL;
+ item->canvas = NULL;
}
static void
@@ -425,14 +425,12 @@ ganv_node_default_event(GanvItem* item,
switch (event->type) {
case GDK_ENTER_NOTIFY:
ganv_item_raise(GANV_ITEM(node));
- ganv_item_set(GANV_ITEM(node),
- "highlighted", TRUE, NULL);
+ ganv_item_set(GANV_ITEM(node), "highlighted", TRUE, NULL);
return TRUE;
case GDK_LEAVE_NOTIFY:
ganv_item_lower(GANV_ITEM(node));
- ganv_item_set(GANV_ITEM(node),
- "highlighted", FALSE, NULL);
+ ganv_item_set(GANV_ITEM(node), "highlighted", FALSE, NULL);
return TRUE;
case GDK_BUTTON_PRESS:
diff --git a/src/port.c b/src/port.c
index 3b9ba69..6603530 100644
--- a/src/port.c
+++ b/src/port.c
@@ -70,7 +70,6 @@ ganv_port_destroy(GtkObject* object)
ganv_canvas_for_each_edge_from(
canvas, &port->box.node, (GanvEdgeFunc)ganv_edge_remove, NULL);
}
- item->canvas = NULL;
}
if (GTK_OBJECT_CLASS(parent_class)->destroy) {