[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gEDA-dev: double click on arcs in gschem?



On Montag, 17. November 2008, Ales Hvezda wrote:
> Note, double clicking on text brings up an edit dialog, but does not
> gschem to enter into move mode if you hit cancel or okay.

And that is curious. When double clicking a picture and cancel, the 
picture moves, too.

When editing an attribute, the response function sets the state back to 
SELECT in attribute_edit_dialog_response()

When editing text, the SELECT state is set in 
text_edit_dialog_response(), too.

Haven't seen a state ajustment for multiattribedit.

....

After playing a while I came to the following conclusion:
The double click puts the state to the STARTSELECT and o_edit() is 
called for the arc or picture object.
The last button release of the double click is eaten by the dialog and 
x_event_button_released() can not put the state from STARTSELECT back 
to SELECT.

When closing the arc dialog the we are still in STARTSELECT state and 
the first move on gschem puts the state from STARTSELECT to MOVE in 
x_event_motion().

The multiattrib dialog is not modal, thus the last button release of the 
double click happens in the gschem window and this sets the state back 
to SELECT.

Solution: 
The state needs to be ajustet after or before o_edit().
----
diff --git a/gschem/src/x_event.c b/gschem/src/x_event.c
index 4c4eab1..cf72273 100644
--- a/gschem/src/x_event.c
+++ b/gschem/src/x_event.c
@@ -108,6 +108,7 @@ gint x_event_button_pressed(GtkWidget *widget, 
GdkEventButton *event,
     o_find_object(w_current, w_x, w_y, TRUE);
     if (o_select_selected (w_current)) {
        o_edit(w_current, geda_list_get_glist( 
toplevel->page_current->selection_list ));
+       i_set_state(w_current, SELECT);
        return(0);
     }
   }
----

Will push the fix right after the mail.

Regards
Werner


_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev