[immodule-qt] Re: how about use postEvent instead of sendEvent in qt-immodule implementation?

YamaKen yamaken at bp.iij4u.or.jp
Sun Jul 4 18:08:57 EEST 2004


Hi Cougar, I've done it.

At Sun, 4 Jul 2004 11:41:31 +0100,
liucougar at gmail.com wrote:
> On Sun, 04 Jul 2004 12:07:20 +0900, YamaKen <yamaken at bp.iij4u.or.jp> wrote:
> > It seems proper way. Thank you for contribution.  But I'm not
> > sure whether event receiving order is always proper or not
> > between IMCompose and IMEnd. 
> This was my concern: I tried to see whether this would cause problems,
> but it seems to me no issues in this field.
> 
> Looking forward to your investigation.

The problem has been verified and fixed. See attached patch.

The problem is caused by mixture of postEvent() and
sendEvent(). You had modified to use postEvent() for IMCompose,
but other events are still immidiately delivered to the widget
by sendEvent(). This causes receiving order inversion since
postEvent() queues the event.

To reproduce the problem, try following codes in the
QUimInputContext::commitString().

  sendIMEvent( QEvent::IMCompose, "IMCompose" );
  sendIMEvent( QEvent::IMEnd, str );

This code is expected to be run as follows,

1. show "IMCompose" as preedit string for a moment
2. commits passed commit string
3. only passed commit string is remaining on the textwidget

but actually runs as follows.

1. commits passed commit string
2. show "IMCompose" as preedit string
3. passed commit string and "IMCompose" as preedit string are
   remaining on the textwidget

I've simply fixed it by replacing other sendIMEvent() with
postIMEvent(). I've investigated both actual behavior and event
handling codes of the Qt to make the patch sure.

The attached patch is also includes trivial modification to
remove friend declarations.

Cougar, would you maintain about this problem in all versions of
our patches including future Qt4 works? I think that you are the
most suitable maintainer for this.

Regards,
-------------------------------
YamaKen  yamaken at bp.iij4u.or.jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: immodule-qt-x11-bc-r2-imcompose-compression-20040705.diff
Type: application/octet-stream
Size: 2590 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/immodule-qt/attachments/20040705/74e8fffa/attachment.obj 


More information about the immodule-qt mailing list