[Goodies-commits] r3272 - ristretto/trunk/src
Stephan Arts
stephan at xfce.org
Sat Sep 29 14:03:49 CEST 2007
Author: stephan
Date: 2007-09-29 12:03:49 +0000 (Sat, 29 Sep 2007)
New Revision: 3272
Modified:
ristretto/trunk/src/main_window.c
ristretto/trunk/src/picture_viewer.c
ristretto/trunk/src/picture_viewer.h
Log:
Disable timeout on picture-viewer when running slideshow
Modified: ristretto/trunk/src/main_window.c
===================================================================
--- ristretto/trunk/src/main_window.c 2007-09-29 11:51:37 UTC (rev 3271)
+++ ristretto/trunk/src/main_window.c 2007-09-29 12:03:49 UTC (rev 3272)
@@ -812,6 +812,7 @@
gtk_menu_shell_insert(GTK_MENU_SHELL(window->priv->menus.go.menu), window->priv->menus.go.menu_item_pause, 5);
gtk_widget_show_all(window->priv->menus.go.menu_item_pause);
rstto_navigator_set_running(RSTTO_NAVIGATOR(window->priv->navigator), TRUE);
+ rstto_picture_viewer_set_timeout(RSTTO_PICTURE_VIEWER(window->priv->picture_viewer), FALSE);
}
static void
@@ -822,6 +823,7 @@
gtk_menu_shell_insert(GTK_MENU_SHELL(window->priv->menus.go.menu), window->priv->menus.go.menu_item_play, 5);
gtk_widget_show_all(window->priv->menus.go.menu_item_play);
rstto_navigator_set_running(RSTTO_NAVIGATOR(window->priv->navigator), FALSE);
+ rstto_picture_viewer_set_timeout(RSTTO_PICTURE_VIEWER(window->priv->picture_viewer), TRUE);
}
static void
Modified: ristretto/trunk/src/picture_viewer.c
===================================================================
--- ristretto/trunk/src/picture_viewer.c 2007-09-29 11:51:37 UTC (rev 3271)
+++ ristretto/trunk/src/picture_viewer.c 2007-09-29 12:03:49 UTC (rev 3272)
@@ -32,6 +32,7 @@
gboolean show_border;
GTimer *timer;
gint timeout_id;
+ gboolean timeout;
};
static void
@@ -111,6 +112,7 @@
viewer->priv->show_border = TRUE;
viewer->priv->timer = g_timer_new();
+ viewer->priv->timeout = TRUE;
g_signal_connect(G_OBJECT(viewer), "scroll_event", G_CALLBACK(cb_rstto_picture_viewer_scroll_event), NULL);
}
@@ -320,9 +322,7 @@
widget->allocation.height);
g_object_unref(buffer);
- cursor = gdk_cursor_new(GDK_LEFT_PTR);
- gdk_window_set_cursor(widget->window, cursor);
- gdk_cursor_unref(cursor);
+ gdk_window_set_cursor(widget->window, NULL);
}
}
@@ -634,9 +634,7 @@
if (vadjustment_changed == TRUE)
gtk_adjustment_value_changed(viewer->vadjustment);
- cursor = gdk_cursor_new(GDK_LEFT_PTR);
- gdk_window_set_cursor(widget->window, cursor);
- gdk_cursor_unref(cursor);
+ gdk_window_set_cursor(widget->window, NULL);
}
}
else
@@ -678,16 +676,23 @@
gdk_window_set_cursor(widget->window, cursor);
gdk_cursor_unref(cursor);
}
- if (viewer->priv->timeout_id == 0)
+ if (viewer->priv->timeout == TRUE)
{
- if (viewer->priv->dst_pixbuf)
+ if (viewer->priv->timeout_id == 0)
{
- gdk_pixbuf_saturate_and_pixelate(viewer->priv->dst_pixbuf, viewer->priv->dst_pixbuf, 0.8, TRUE);
- rstto_picture_viewer_paint(GTK_WIDGET(viewer));
+ if (viewer->priv->dst_pixbuf)
+ {
+ gdk_pixbuf_saturate_and_pixelate(viewer->priv->dst_pixbuf, viewer->priv->dst_pixbuf, 0.8, TRUE);
+ rstto_picture_viewer_paint(GTK_WIDGET(viewer));
+ }
+ viewer->priv->timeout_id = g_timeout_add(100, (GSourceFunc)cb_rstto_picture_viewer_update_image, viewer);
}
- viewer->priv->timeout_id = g_timeout_add(100, (GSourceFunc)cb_rstto_picture_viewer_update_image, viewer);
+ g_timer_start(viewer->priv->timer);
}
- g_timer_start(viewer->priv->timer);
+ else
+ {
+ rstto_picture_viewer_update(viewer);
+ }
}
else
{
@@ -738,9 +743,7 @@
rstto_picture_viewer_refresh(viewer);
rstto_picture_viewer_paint(GTK_WIDGET(viewer));
- GdkCursor *cursor = gdk_cursor_new(GDK_LEFT_PTR);
- gdk_window_set_cursor(widget->window, cursor);
- gdk_cursor_unref(cursor);
+ gdk_window_set_cursor(widget->window, NULL);
}
}
@@ -775,3 +778,9 @@
rstto_picture_viewer_paint(GTK_WIDGET(viewer));
}
}
+
+void
+rstto_picture_viewer_set_timeout(RsttoPictureViewer *viewer, gboolean timeout)
+{
+ viewer->priv->timeout = timeout;
+}
Modified: ristretto/trunk/src/picture_viewer.h
===================================================================
--- ristretto/trunk/src/picture_viewer.h 2007-09-29 11:51:37 UTC (rev 3271)
+++ ristretto/trunk/src/picture_viewer.h 2007-09-29 12:03:49 UTC (rev 3272)
@@ -69,6 +69,7 @@
void rstto_picture_viewer_set_scale(RsttoPictureViewer *viewer, gdouble scale);
gdouble rstto_picture_viewer_get_scale(RsttoPictureViewer *viewer);
gdouble rstto_picture_viewer_fit_scale(RsttoPictureViewer *viewer);
+void rstto_picture_viewer_set_timeout(RsttoPictureViewer *viewer, gboolean timeout);
G_END_DECLS
More information about the Goodies-commits
mailing list