diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/e-canvas.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 5c6cfd3278..704b6ca12b 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -288,7 +288,19 @@ e_canvas_item_grab_focus (GnomeCanvasItem *item) } item->canvas->focused_item = item; - gtk_widget_grab_focus (GTK_WIDGET (item->canvas)); + + if (!GTK_WIDGET_HAS_FOCUS (GTK_WIDGET(item->canvas))) { + gtk_widget_grab_focus (GTK_WIDGET (item->canvas)); + } + + if (focused_item) { + ev.focus_change.type = GDK_FOCUS_CHANGE; + ev.focus_change.window = GTK_LAYOUT (item->canvas)->bin_window; + ev.focus_change.send_event = FALSE; + ev.focus_change.in = TRUE; + + emit_event (item->canvas, &ev); + } } /* Focus in handler for the canvas */ |