--- trunk/src/osm-gps-map.c 2009/08/20 07:09:29 67 +++ trunk/src/osm-gps-map.c 2009/08/20 09:54:10 68 @@ -2343,6 +2343,9 @@ } static gboolean +osm_gps_map_expose (GtkWidget *widget, GdkEventExpose *event); + +static gboolean osm_gps_map_motion_notify (GtkWidget *widget, GdkEventMotion *event) { int x, y; @@ -2371,6 +2374,14 @@ if (priv->drag_counter < 6) return FALSE; +#ifdef USE_MAEMO + /* reduce update frequency on maemo to keep screen update fluid */ + static guint32 last_time = 0; + + if(event->time - last_time < 100) return FALSE; + last_time = event->time; +#endif + priv->dragging = TRUE; if (priv->map_auto_center) @@ -2389,12 +2400,50 @@ -priv->drag_mouse_dy); #endif + osm_gps_map_expose (widget, NULL); + + + return FALSE; +} + +static gboolean +osm_gps_map_configure (GtkWidget *widget, GdkEventConfigure *event) +{ + OsmGpsMapPrivate *priv = OSM_GPS_MAP_PRIVATE(widget); + + /* create pixmap */ + if (priv->pixmap) + g_object_unref (priv->pixmap); + + priv->pixmap = gdk_pixmap_new ( + widget->window, + widget->allocation.width + EXTRA_BORDER * 2, + widget->allocation.height + EXTRA_BORDER * 2, + -1); + + /* and gc, used for clipping (I think......) */ + if(priv->gc_map) + g_object_unref(priv->gc_map); + + priv->gc_map = gdk_gc_new(priv->pixmap); + + osm_gps_map_map_redraw(OSM_GPS_MAP(widget)); + + return FALSE; +} + +static gboolean +osm_gps_map_expose (GtkWidget *widget, GdkEventExpose *event) +{ + OsmGpsMapPrivate *priv = OSM_GPS_MAP_PRIVATE(widget); + gdk_draw_drawable ( widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], priv->pixmap, 0,0, - priv->drag_mouse_dx - EXTRA_BORDER, priv->drag_mouse_dy - EXTRA_BORDER, + priv->drag_mouse_dx - EXTRA_BORDER, + priv->drag_mouse_dy - EXTRA_BORDER, -1,-1); //Paint white outside of the map if dragging. Its less @@ -2438,42 +2487,9 @@ widget->allocation.width, -priv->drag_mouse_dy - EXTRA_BORDER); } - - return FALSE; -} - -static gboolean -osm_gps_map_configure (GtkWidget *widget, GdkEventConfigure *event) -{ - OsmGpsMapPrivate *priv = OSM_GPS_MAP_PRIVATE(widget); - - /* create pixmap */ - if (priv->pixmap) - g_object_unref (priv->pixmap); - - priv->pixmap = gdk_pixmap_new ( - widget->window, - widget->allocation.width + EXTRA_BORDER * 2, - widget->allocation.height + EXTRA_BORDER * 2, - -1); - - /* and gc, used for clipping (I think......) */ - if(priv->gc_map) - g_object_unref(priv->gc_map); - - priv->gc_map = gdk_gc_new(priv->pixmap); - - osm_gps_map_map_redraw(OSM_GPS_MAP(widget)); - - return FALSE; -} - -static gboolean -osm_gps_map_expose (GtkWidget *widget, GdkEventExpose *event) -{ - OsmGpsMapPrivate *priv = OSM_GPS_MAP_PRIVATE(widget); - - gdk_draw_drawable ( +#if 0 + if(!priv->dragging) + gdk_draw_drawable ( widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], priv->pixmap, @@ -2481,7 +2497,7 @@ event->area.y + EXTRA_BORDER, event->area.x, event->area.y, event->area.width, event->area.height); - +#endif return FALSE; }