Re: grab_focus in GnomeCanvas (was emit_event warning)



On 12/6/01 3:20 PM, "Darin Adler" <darin bentspoon com> wrote:

> On 12/6/01 3:00 PM, "Havoc Pennington" <hp redhat com> wrote:
>> 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.

And item->canvas->focused_item is always non-NULL, so we don't need an if
statement at all.

Now I see why no one noticed this before. The only standard canvas item
class that looks at GDK_FOCUS_CHANGE events is GnomeCanvasRichText.

    -- Darin




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