nanogui: set a timer when move the window!


Previous by date: 19 Aug 2002 09:32:18 -0000 NanoGTK, Chinese and Locale, Chen sheng
Next by date: 19 Aug 2002 09:32:18 -0000 Re: set a timer when move the window!, Justin Fretwell
Previous in thread: 19 Aug 2002 09:32:18 -0000 set a timer when move the window!, wang
Next in thread: 19 Aug 2002 09:32:18 -0000 Re: set a timer when move the window!, Justin Fretwell

Subject: Re: [nanogui] set a timer when move the window!
From: Alex Holden ####@####.####
Date: 19 Aug 2002 09:32:18 -0000
Message-Id: <3D60B7A6.60104@linuxhacker.org>

wang wrote:

> In nanowm, dragging window is not efficient,in former 
>maillist ,Alex suggested use a timer to reduce the 
>number of GrMoveWindow().now I implement this ,yes,it's
>agiler than it did,and even I set the timer to 1ms ,
>it should be better.
>
You know that's 1000Hz right? 1/10th of that, 100Hz (10ms) is faster
than the eye can see and even 50Hz (20ms) ought to be fine.

>   wm_timer=GrCreateTimer(window->wid,1,1);
>wm_tiemr is a globe variable ,so GrDetroyTimer() can use.
>  
>
I'd put in a bit of sanity checking here. Initialise Wm_timer to 0, only
create the timer if it is 0, only destroy the timer if it is not 0, and
set it to 0 after destroying it. Also do a final GrMoveWindow() on
button up to make sure you don't miss the last position event when the
button is released. You could also make it slightly more efficient by
recording the last position you moved the window to and if it has not
changed since the last timer event, don't do the GrMoveWindow() call.


Previous by date: 19 Aug 2002 09:32:18 -0000 NanoGTK, Chinese and Locale, Chen sheng
Next by date: 19 Aug 2002 09:32:18 -0000 Re: set a timer when move the window!, Justin Fretwell
Previous in thread: 19 Aug 2002 09:32:18 -0000 set a timer when move the window!, wang
Next in thread: 19 Aug 2002 09:32:18 -0000 Re: set a timer when move the window!, Justin Fretwell


Powered by ezmlm-browse 0.20.