[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KMainWindow, SVG, resizing and app init
From:       Ian Wadham <ianw2 () optusnet ! com ! au>
Date:       2007-02-16 3:52:43
Message-ID: 200702161452.43765.ianw2 () optusnet ! com ! au
[Download RAW message or body]

On Thu, 15 Feb 2007 10:06 pm, John Tapsell wrote:
> > 3. When you grab the window by the corner and resize it, there is an
> >    unpredictable number of resize events, each requiring the SVG
> >    load, etc.  The result is jerky and some white rectangles
> >    appear momentarily.  What is the best way to smooth this out?
> >    Or if I could somehow know which event is the last one, maybe
> >    I could leave all the re-drawing until after that event?
>
> I'm interested in trying to solve this problem as well.
>
> Best solution that I could think of was to quickly scale the cache
> image (to give at least a blocky view) then start/restart a timer for
> 200ms.  Then after 200ms of no resize events, recreate the cache image
> and repaint. It's not great.  Fundamentally the problem is that you
> cannot interrupt a paint event.
>
Thanks John, that's a fair enough solution.  I might also see if there
are some mouse-events that can show when a manual resize is
starting and stopping.  But are there any keystroke ways for an
end-user to do a resize?

> Maybe Trolltech can try to help us out here.  What we need is a way
> for resize events to be parsed during a paint function (either async,
> or as a form of processEvents) then set a flag.  Then in the paint
> function we can check if this flag is set, and prematuraly cancel the
> resize.
>
Paint function? ;-) When you use QGraphicsView or KGameCanvas,
"draw" or "paint" means to supply a series of lines, pixmaps, etc. to the
graphics library which then schedules its own paintEvent for later on in
the event queue.

It would be helpful, perhaps, if Trolltech could supply more information
in an event object about where the event originates and its context, such
as whether a resize is originated by the end-user or the application and
whether it is the first or last in a series.  I've tried using spontaneous(),
but whatever it means, it does not seem to mean anything like that.

All the best, Ian W.
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic