Re: Viewport diagonal scrolling redraw



On 16 February 2011 04:48, Rendaw <rendaw zarbosoft com> wrote:
As a side note, does gdk_window_process_updates() preserve mouse motion
events when the MOTION_HINT mask is set?  I also had motion event queuing
problems (I would stop moving the mouse but the screen would continually
redraw for a few seconds until it had caught up) before I moved the
gtk_adjustment_set_value()'s out of the motion handling code and into a
g_idle_add callback.

I don't know how to get silky diagonal scrolling easily, but I can
help here (I think). The solution I found was to calculate all mouse
movement relative to the root window, not the window being scrolled.

In the motion event, there are a couple of fields called x_root and
y_root. Record these on button down together with the scroll position
of the underlying window, then during motion, scroll the window to the
position found by subtracting the start x_root from the current x_root
plus the original x.

This makes these feedback effects (which can be bizarre and horrible)
impossible.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]