aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-11-15 04:56:53 +0800
committerChris Lahey <clahey@src.gnome.org>2001-11-15 04:56:53 +0800
commitdf3bc0736121ce07791170dbeaa97e50d8949585 (patch)
treede8128924b1e4ddfe517f9fd4eb7cb2290ccc12b /widgets
parent6c92a88fc703026682269bc5ab0f60f42ee14215 (diff)
downloadgsoc2013-evolution-df3bc0736121ce07791170dbeaa97e50d8949585.tar.gz
gsoc2013-evolution-df3bc0736121ce07791170dbeaa97e50d8949585.tar.zst
gsoc2013-evolution-df3bc0736121ce07791170dbeaa97e50d8949585.zip
From a patch by Yukihiro Nakai <ynakai@redhat.com>.
2001-11-14 Christopher James Lahey <clahey@ximian.com> From a patch by Yukihiro Nakai <ynakai@redhat.com>. * gal/widgets/e-canvas.c (e_canvas_realize): Handle GDK_IM_PREEDIT_POSITION here. svn path=/trunk/; revision=14703
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-canvas.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c
index e4c40ceddc..8126367145 100644
--- a/widgets/misc/e-canvas.c
+++ b/widgets/misc/e-canvas.c
@@ -668,6 +668,7 @@ e_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event)
static void
e_canvas_realize (GtkWidget *widget)
{
+ gint width, height;
ECanvas *ecanvas = E_CANVAS (widget);
if (GTK_WIDGET_CLASS (parent_class)->realize)
@@ -682,12 +683,41 @@ e_canvas_realize (GtkWidget *widget)
GdkIMStyle style;
GdkIMStyle supported_style = GDK_IM_PREEDIT_NONE |
GDK_IM_PREEDIT_NOTHING |
+ GDK_IM_PREEDIT_POSITION |
GDK_IM_STATUS_NONE |
GDK_IM_STATUS_NOTHING;
+ if(widget->style && widget->style->font->type != GDK_FONT_FONTSET)
+ supported_style &= ~GDK_IM_PREEDIT_POSITION;
+
attr->style = style = gdk_im_decide_style (supported_style);
attr->client_window = ecanvas->parent.layout.bin_window;
+ switch (style & GDK_IM_PREEDIT_MASK)
+ {
+ case GDK_IM_PREEDIT_POSITION:
+ if (widget->style && widget->style->font->type != GDK_FONT_FONTSET)
+ {
+ g_warning ("over-the-spot style requires fontset");
+ break;
+ }
+
+ gdk_window_get_size (attr->client_window, &width, &height);
+ height = widget->style->font->ascent +
+ widget->style->font->descent;
+
+ attrmask |= GDK_IC_PREEDIT_POSITION_REQ;
+ attr->spot_location.x = 0;
+ attr->spot_location.y = height;
+ attr->preedit_area.x = 0;
+ attr->preedit_area.y = 0;
+ attr->preedit_area.width = width;
+ attr->preedit_area.height = height;
+ attr->preedit_fontset = widget->style->font;
+
+ break;
+ }
+
ecanvas->ic = gdk_ic_new (attr, attrmask);
if (ecanvas->ic != NULL) {
mask = gdk_window_get_events (attr->client_window);