evolution/evolution-2.9.1-first-ascii.patch

92 lines
3.0 KiB
Diff
Raw Normal View History

--- evolution-2.9.1/calendar/gui/e-day-view.c.first-ascii 2006-11-06 11:25:23.000000000 -0500
+++ evolution-2.9.1/calendar/gui/e-day-view.c 2006-11-06 11:34:32.000000000 -0500
@@ -333,7 +333,7 @@
static void e_day_view_start_editing_event (EDayView *day_view,
gint day,
gint event_num,
- gchar *initial_text);
+ GdkEventKey *key_event);
static void e_day_view_stop_editing_event (EDayView *day_view);
static gboolean e_day_view_text_keypress (GnomeCanvasItem *item,
guint keyval,
@@ -6012,7 +6012,6 @@
ECalModel *model;
ECalComponent *comp;
gint day, event_num;
- gchar *initial_text;
guint keyval;
gboolean stop_emission;
time_t dtstart, dtend;
@@ -6153,15 +6152,12 @@
/* We only want to start an edit with a return key or a simple
character. */
- if (keyval == GDK_Return) {
- initial_text = NULL;
- } else if (((keyval >= 0x20) && (keyval <= 0xFF)
- && (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
- || (event->length == 0)
- || (keyval == GDK_Tab)) {
+ if ((keyval != GDK_Return) &&
+ (((keyval >= 0x20) && (keyval <= 0xFF)
+ && (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
+ || (event->length == 0)
+ || (keyval == GDK_Tab)))
return FALSE;
- } else
- initial_text = e_utf8_from_gtk_event_key (widget, event->keyval, event->string);
/* Add a new event covering the selected range */
icalcomp = e_cal_model_create_component_with_defaults (model);
@@ -6207,15 +6203,11 @@
gtk_widget_queue_draw (day_view->main_canvas);
if (e_day_view_find_event_from_uid (day_view, ecal, uid, NULL, &day, &event_num)) {
- e_day_view_start_editing_event (day_view, day, event_num,
- initial_text);
+ e_day_view_start_editing_event (day_view, day, event_num, event);
} else {
g_warning ("Couldn't find event to start editing.\n");
}
- if (initial_text)
- g_free (initial_text);
-
g_object_unref (comp);
return TRUE;
@@ -6897,7 +6889,7 @@
e_day_view_start_editing_event (EDayView *day_view,
gint day,
gint event_num,
- gchar *initial_text)
+ GdkEventKey *key_event)
{
EDayViewEvent *event;
ETextEventProcessor *event_processor = NULL;
@@ -6937,10 +6929,20 @@
rid of the start and end times. */
e_canvas_item_grab_focus (event->canvas_item, TRUE);
- if (initial_text) {
- gnome_canvas_item_set (event->canvas_item,
- "text", initial_text,
- NULL);
+ if (key_event) {
+ if (gtk_im_context_filter_keypress (((EText *)(event->canvas_item))->im_context, key_event)) {
+ ((EText *)(event->canvas_item))->need_im_reset = TRUE;
+ }
+ else {
+ char *initial_text;
+
+ initial_text = e_utf8_from_gtk_event_key (GTK_WIDGET (day_view), key_event->keyval, key_event->string);
+ gnome_canvas_item_set (event->canvas_item,
+ "text", initial_text,
+ NULL);
+ if (initial_text)
+ g_free (initial_text);
+ }
}
/* Try to move the cursor to the end of the text. */