Re: emit_event warning in GnomeCanvas



On 12/6/01 3:00 PM, "Havoc Pennington" <hp redhat com> wrote:

> It looks to me like the warning means "Canvas is broken internally
> because it tried to emit an event on a non-grabbed item while an item
> was grabbed."

OK. That sound exactly right.

> On a quick glance, anytime canvas->need_repick is set to TRUE while
> you have a grab, pick_current_item() will mess up canvas->current_item
> so that events start going to the wrong place. I don't know the right
> fix - maybe pick_current_item() needs to enforce some invariants about
> only picking items that are children of the grab item? Looking at the
> stable branch might be enlightening.

Your analysis sounds good.

The stable branch is identical, except that it silently returns from
emit_event rather than issuing a warning. I wonder what we should do about
this. Your idea about changing the rules in pick_current_item sounds right
to me, but I can't figure out all the details.

> Another bug I noticed while in there is that calling grab_focus() on
> an already-focused item causes a focus_out/focus_in pair to be
> emitted, should probably short-circuit that.

I see another bug in grab_focus. The second if statement checks focused_item
and I think it means to be checking item->canvas->focused_item. I think the
function would be better off without that local variable. Both bugs are in
the stable branch too.

    -- Darin




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