[immodule-qt] Re: [SCIM] scim-qtimm 0.7 released

YamaKen yamaken at bp.iij4u.or.jp
Mon Sep 6 15:26:52 EEST 2004


Hi James,

At Mon, 6 Sep 2004 17:04:30 +0800,
james.su at gmail.com wrote:
> 
> Hi,
>   Changing postIMEvent to:
> 
> void QApplication::postIMEvent( QObject *receiver, QIMEvent *event )
>  {
>      sendEvent( receiver, event );
> }
> 
> can fix this issue. 

It's exactly same as our first implementation and insufficient
for some users. Although it is most safe and simple way, Cougar
had suggest the event compression to resolve his problem.

http://freedesktop.org/pipermail/immodule-qt/2004-June/000035.html
| I just found in my box, when I am typing very fast, the preedit string
| ( IMCompose event is used to draw these preedit strings) will flicker
| somehow.

> On Mon, 6 Sep 2004 16:53:42 +0800, Zhe Su <james.su at gmail.com> wrote:
> > Hi,
> >   This new code will cause segfault on my box when trying
> > scim-qtimm/tests/edittest.
> > 
> > Regards
> > James Su
> > 
> > 
> > 
> > 
> > On Mon, 6 Sep 2004 15:39:23 +0900, Kazuki Ohta <mover at hct.zaq.ne.jp> wrote:
> > > Hi, Cougar.
> > >
> > > More refactored version is here.
> > > This code is based on the code of QApplication::notify.
> > > I think this code is more cleaner.
> > >
> > > void QApplication::postIMEvent( QObject *receiver, QIMEvent *event )
> > > {
> > >     if( event->type() == QEvent::IMCompose )
> > >         postEvent( receiver, event );
> > >     else {
> > >         if (receiver->postedEvents) {
> > >             //get rid of IMCompose event posted before
> > >             QPostEventList * l = receiver->postedEvents;
> > >             QPostEvent * pe;
> > >             l->first();
> > >             while( ( pe = l->current()) != 0 ) {
> > >                 if ( pe->event && pe->receiver == receiver &&
> > >                     pe->event->type() == QEvent::IMCompose ) {
> > >                     pe->event->posted = FALSE;
> > >                     delete pe->event;
> > >                     pe->event = 0;
> > >                     l->remove();
> > >                     continue;
> > >                 }
> > >                 l->next();
> > >             }
> > >             sendEvent( receiver, event );
> > >             delete event;
> > >
> > >
> > >         }
> > >     }
> > > }
> > >
> > > On Monday 06 September 2004 12:34, LiuCougar wrote:
> > > > On Mon, 6 Sep 2004 11:27:26 +0800, Zhe Su <james.su at gmail.com> wrote:
> > > > > Hi,
> > > > >   I just read though this new code, and found that there is no exit
> > > > > point in the for (;;) {...} loop. Is it correct?
> > > >
> > > > Oops, sorry about that, the rectified version is:
> > > > void QApplication::postIMEvent( QObject *receiver, QIMEvent *event )
> > > > {
> > > >     if( event->type() == QEvent::IMCompose )
> > > >         postEvent( receiver, event );
> > > >     else {
> > > >         QPostEventList * l = receiver->postedEvents;
> > > >
> > > >         //get rid of IMCompose event posted before
> > > >         if ( event->type() == QEvent::IMCompose ) {
> > > >             l->first();
> > > >             QPostEvent * cur = 0;
> > > >             for ( ;; ) {
> > > >                 while ( (cur=l->current()) != 0 &&
> > > >                         ( cur->receiver != receiver ||
> > > >                           cur->event == 0 ||
> > > >                           cur->event->type() != event->type() ) )
> > > >                     l->next();
> > > >                 if ( l->current() != 0 ) {
> > > >                     if ( cur->event->type() == QEvent::IMCompose ) {
> > > >                         delete cur->event;
> > > >                         l->remove(cur);
> > > >                     }
> > > >                 } else
> > > >                   break;
> > > >             }
> > > >         }
> > > >         sendEvent( receiver, event );
> > > >         delete event;
> > > >     }
> > > > }

-------------------------------
YamaKen  yamaken at bp.iij4u.or.jp



More information about the immodule-qt mailing list