Commit Graph

5 Commits

Author SHA1 Message Date
Benjamin Otte
43c212ac28 build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:

1. Add all missing enums to the switch statement
  or
2. Cast the switch argument to a uint to avoid having to do that (mostly
   for GdkEventType).

I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.

The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
2017-10-06 21:23:39 +02:00
Christian Hergert
4f63d83955 kineticscrolling: avoid stutter at tail of kinetic deceleration
When decelerating the kinetic scroll, we can get into a position where it
looks like we are stuttering. This happens because the amount we move is
so little that it takes multiple frames to make forward progress by one
pixel.

This prevents that by detecting when we have reached the slow stutter of
the deceleration and simply stops the deceleration phase immediately.

https://bugzilla.gnome.org/show_bug.cgi?id=765493
2016-04-24 03:49:20 -07:00
Matthias Clasen
9545c01764 kinetic scrolling: Fix compiler warnings
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
2015-06-02 09:08:15 -04:00
Chun-wei Fan
d8de23bef6 gtk/gtkkineticscrolling.c: Include fallback-c89.c
... as round() is being used, which is for C99 and later.  fallback-c89.c
includes math.h as well.
2014-06-06 14:47:19 +08:00
Lieven van der Heide
c726226825 gtk: Add kinetic scrolling helper
GtkKineticScrolling implements the actual physics laws for friction
and springs. When created, position/velocity/boundaries/constants are
given, so at every gtk_kinetic_scrolling_tick() it returns the current
position, and whether the system is in rest.

https://bugzilla.gnome.org/show_bug.cgi?id=729608
2014-06-05 16:49:23 +02:00