From b910aabdb2f68b79fe0514aadf9a241f58964280 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Wed, 11 Feb 2004 17:06:05 +0000 Subject: Fixes #53886 2004-02-11 Rodrigo Moya Fixes #53886 * gui/gnome-cal.c (gnome_calendar_paste_clipboard, gnome_calendar_delete_selection, gnome_calendar_cut_clipboard, gnome_calendar_copy_clipboard): removed g_assert_if_reached calls since we might get a different widget getting the focus. (get_focus_location): check the canvas's' focused item. svn path=/trunk/; revision=24707 --- calendar/ChangeLog | 10 ++++++++++ calendar/gui/gnome-cal.c | 15 +++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index b55d597b3a..0989012d1b 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,13 @@ +2004-02-11 Rodrigo Moya + + Fixes #53886 + + * gui/gnome-cal.c (gnome_calendar_paste_clipboard, + gnome_calendar_delete_selection, gnome_calendar_cut_clipboard, + gnome_calendar_copy_clipboard): removed g_assert_if_reached calls + since we might get a different widget getting the focus. + (get_focus_location): check the canvas's' focused item. + 2004-02-11 Rodrigo Moya Fixes #53271 diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 40f40a8513..c994f3980b 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -476,7 +476,9 @@ get_focus_location (GnomeCalendar *gcal) dv = E_DAY_VIEW (widget); if (GTK_WIDGET_HAS_FOCUS (dv->top_canvas) - || GTK_WIDGET_HAS_FOCUS (dv->main_canvas)) + || GNOME_CANVAS (dv->top_canvas)->focused_item != NULL + || GTK_WIDGET_HAS_FOCUS (dv->main_canvas) + || GNOME_CANVAS (dv->main_canvas)->focused_item != NULL) return FOCUS_CALENDAR; else return FOCUS_OTHER; @@ -485,7 +487,8 @@ get_focus_location (GnomeCalendar *gcal) case GNOME_CAL_MONTH_VIEW: wv = E_WEEK_VIEW (widget); - if (GTK_WIDGET_HAS_FOCUS (wv->main_canvas)) + if (GTK_WIDGET_HAS_FOCUS (wv->main_canvas) + || GNOME_CANVAS (wv->main_canvas)->focused_item != NULL) return FOCUS_CALENDAR; else return FOCUS_OTHER; @@ -2599,8 +2602,6 @@ gnome_calendar_cut_clipboard (GnomeCalendar *gcal) e_calendar_view_cut_clipboard (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal))); } else if (location == FOCUS_TASKPAD) e_calendar_table_cut_clipboard (E_CALENDAR_TABLE (priv->todo)); - else - g_assert_not_reached (); } void @@ -2617,8 +2618,6 @@ gnome_calendar_copy_clipboard (GnomeCalendar *gcal) e_calendar_view_copy_clipboard (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal))); } else if (location == FOCUS_TASKPAD) e_calendar_table_copy_clipboard (E_CALENDAR_TABLE (priv->todo)); - else - g_assert_not_reached (); } void @@ -2635,8 +2634,6 @@ gnome_calendar_paste_clipboard (GnomeCalendar *gcal) e_calendar_view_paste_clipboard (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal))); } else if (location == FOCUS_TASKPAD) e_calendar_table_paste_clipboard (E_CALENDAR_TABLE (priv->todo)); - else - g_assert_not_reached (); } @@ -2742,8 +2739,6 @@ gnome_calendar_delete_selection (GnomeCalendar *gcal) e_calendar_view_delete_selected_events (E_CALENDAR_VIEW (view)); } else if (location == FOCUS_TASKPAD) e_calendar_table_delete_selected (E_CALENDAR_TABLE (priv->todo)); - else - g_assert_not_reached (); } void -- cgit