[Uim] Focus and cursor position shift handlings (bug #7729)

Etsushi Kato ek.kato at gmail.com
Fri Nov 17 21:10:31 EET 2006


On 11/17/06, Etsushi Kato <ek.kato at gmail.com> wrote:
> On 11/17/06, YAMAMOTO Kengo / YamaKen <yamaken at bp.iij4u.or.jp> wrote:
> > Oops, sorry. You're right. But I think that the responsibility
> > violation of your code should be avoided even if it's a
> > workaround hack. I prefer keeping im_context private to text
> > widgets, as described in gtk_entry_init(). And I also want to
> > keep full-implementability of user text widgets that use
> > im_context possible.
> >
> > # Although I recently suggested a code fragment which touches
> > # im_context directly to explain my concepts. Sorry, it was only
> > # a concept and inappropriate for actual implementation.
> >
> > static void
> > gtk_entry_init (GtkEntry *entry)
> > {
> >   ...
> >   /* This object is completely private. No external entity can gain a reference
> >    * to it; so we create it here and destroy it in finalize().
> >    */
> >   entry->im_context = gtk_im_multicontext_new ();
> >   ...
> > }
>
> Agreed.

After some thought, I think making im_context information available on
gtkwidget.c is simple solution.  It will make
gtk_widget_fix_focused_input_context() available even in a custom
widget with GtkIMContext which doesn't inherit GtkEntry or
GtkTextView.

As in the attached patch, set "gtk-im-context" data as a widget data
using gtk_widget_set_im_context() just after creating im_context, and
use this info in gtk_widget_fix_focused_input_context().

Cheers,
-- 
Etsushi Kato
ek.kato at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gtkwidget-imcontext.diff
Type: application/octet-stream
Size: 5474 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/uim/attachments/20061118/b23dbc54/attachment.obj 


More information about the uim mailing list