diff options
-rw-r--r-- | generic/tkZinc.c | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c index 3baa747..bf2a5ad 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -4782,15 +4782,16 @@ DoEvent(WidgetInfo *wi, * any binding related to the item only those pertaining * to the fields. */ - bind_item = (((event->type != EnterNotify) && - (event->type != LeaveNotify)) || + bind_item = (((event->type != EnterNotify) && (event->type != LeaveNotify)) || (wi->current_item != wi->new_item)); - /*printf("type=%s, current=%d, new=%d --> %s\n", - event->type==EnterNotify?"Enter": - event->type==LeaveNotify?"Leave":"other", + /*printf("type=%s, current=%d, new=%d --> %s, currentp %d, newp %d\n", + event->type==EnterNotify?"<Enter>": + event->type==LeaveNotify?"<Leave>": + event->type==MotionNotify?"<Motion>":"other", wi->current_item?wi->current_item->id:0, wi->new_item?wi->new_item->id:0, - bind_item?"bind":"nobind");*/ + bind_item?"bind":"nobind", + wi->current_part, wi->new_part);*/ if (bind_item) { num += 2; } @@ -4884,10 +4885,7 @@ PickCurrentItem(WidgetInfo *wi, XEvent *event) { int button_down; -#ifdef LEFT_GRAB - int prev_left_grabbed_item; -#endif - + /* * Check whether or not a button is down. If so, we'll log entry * and exit into and out of the current item, but not entry into @@ -4896,12 +4894,9 @@ PickCurrentItem(WidgetInfo *wi, */ button_down = wi->state & (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask); -#ifdef LEFT_GRAB - prev_left_grabbed_item = wi->events_flags & LEFT_GRABBED_ITEM; if (!button_down) { wi->events_flags &= ~LEFT_GRABBED_ITEM; } -#endif /* * Save information about this event in the widget. The saved event @@ -4969,13 +4964,15 @@ PickCurrentItem(WidgetInfo *wi, } else { wi->new_item = ZN_NO_ITEM; + wi->new_part = ZN_NO_PART; } - if ((wi->new_item == wi->current_item) && (wi->new_part == wi->current_part) -#ifdef LEFT_GRAB - && !(wi->events_flags & LEFT_GRABBED_ITEM) -#endif - ) { + /*printf("------ PickCurrentItem current: %d %d, new %d %d\n", + wi->current_item==ZN_NO_ITEM?0:wi->current_item->id, wi->current_part, + wi->new_item==ZN_NO_ITEM?0:wi->new_item->id, wi->new_part);*/ + + if ((wi->new_item == wi->current_item) && (wi->new_part == wi->current_part) && + !(wi->events_flags & LEFT_GRABBED_ITEM)) { /* * Nothing to do: the current item/part hasn't changed. */ @@ -4991,12 +4988,7 @@ PickCurrentItem(WidgetInfo *wi, * calling leave when the grab is released. */ if (((wi->new_item != wi->current_item) || (wi->new_part != wi->current_part)) && - (wi->current_item != ZN_NO_ITEM) -#ifdef LEFT_GRAB - && !(wi->events_flags & LEFT_GRABBED_ITEM) - && !prev_left_grabbed_item -#endif - ) { + (wi->current_item != ZN_NO_ITEM) && !(wi->events_flags & LEFT_GRABBED_ITEM)) { XEvent event; Item item = wi->current_item; @@ -5019,7 +5011,7 @@ PickCurrentItem(WidgetInfo *wi, * event handler for <LeaveNotify> that deletes the current item. */ if ((item == wi->current_item) && !button_down) { - /*printf("Removing 'current' to %d\n", wi->current_item->id);*/ + /*printf("^^^ Removing 'current' from %d\n", wi->current_item->id);*/ ITEM.RemoveTag(item, current_uid); } /* @@ -5028,40 +5020,40 @@ PickCurrentItem(WidgetInfo *wi, * item was deleted. */ } -#ifdef LEFT_GRAB if (((wi->new_item != wi->current_item) || (wi->new_part != wi->current_part)) && button_down) { wi->events_flags |= LEFT_GRABBED_ITEM; return; } -#endif -#ifdef LEFT_GRAB /* * Special note: it's possible that wi->new_item == wi->current_item * here. This can happen, for example, if LEFT_GRABBED_ITEM was set or * if there is only a change in the part number. */ wi->events_flags &= ~LEFT_GRABBED_ITEM; -#endif + /* - * Added to enable DoEvent to make a special case for enter/leaves - * between fields in the same item. It may interact with - * LEFT_GRABBED_ITEM. - */ + * Tentative pour éviter d'enlever puis de remettre + * le tag current sur le même item en ces de changement + * de partie. Ca marche pas pour l'instant. if (wi->current_item != wi->new_item) { if (wi->current_item != ZN_NO_ITEM) { - /*printf("***Removing 'current' to %d\n", wi->current_item->id);*/ + printf("vvv Removing 'current' from %d\n", wi->current_item->id); ITEM.RemoveTag(wi->current_item, current_uid); } - wi->current_item = wi->new_item; - wi->new_item = ZN_NO_ITEM; - } + }*/ + wi->current_item = wi->new_item; wi->current_part = wi->new_part; + /* + * Added to enable DoEvent to make a special case for enter/leaves + * between fields in the same item. It may interact with + * LEFT_GRABBED_ITEM. + */ + wi->new_item = ZN_NO_ITEM; if (wi->current_item != ZN_NO_ITEM) { XEvent event; - /* * Add the tag 'current' to the current item under the pointer. */ |