summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2008-04-29 18:31:29 -0400
committerSøren Sandmann <sandmann@redhat.com>2008-04-29 18:31:29 -0400
commitdd66384b62c4266b309ee1100fbb1f54bb788d6b (patch)
tree30ce1b54fcfd5fca6f67b83bead76f125964cf93
parentc2d0b81c9a94d79a6a9474d20dab311d70b1737d (diff)
Paint background when there is no image
-rw-r--r--window.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/window.c b/window.c
index 36d4e78..b8bf703 100644
--- a/window.c
+++ b/window.c
@@ -110,7 +110,7 @@ paint_rect (GtkWidget *drawing_area, GdkRectangle *area, Window *window)
if (!gdk_rectangle_intersect (area, &image, &dest))
return;
- tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, dest.width, dest.height);
+ tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, dest.width, dest.height);
if (gtk_check_menu_item_get_active (get_widget (window, "menu_no")))
{
@@ -160,11 +160,14 @@ on_expose (GtkWidget *drawing_area, GdkEventExpose *expose, Window *window)
int n_rects;
int i;
- if (!window->original)
+ if (!GTK_WIDGET_DRAWABLE (get_widget (window, "drawing_area")))
return;
- if (!GTK_WIDGET_DRAWABLE (get_widget (window, "drawing_area")))
+ if (!window->original)
+ {
+ initialize_bg (drawing_area, expose->region);
return;
+ }
gdk_region_get_rectangles (expose->region, &rects, &n_rects);
@@ -436,7 +439,7 @@ on_mouse_release (GtkWidget *widget, GdkEventButton *button, Window *window)
{
if (button->button == 1)
{
- g_print ("You released\n");
+ g_print ("You released %d\n", button->time);
gdk_pointer_ungrab (button->time);
window->dragging = FALSE;
}
@@ -450,7 +453,6 @@ change_adjustment (GtkAdjustment *adj, int dv)
new = CLAMP (new, adj->lower, adj->upper - adj->page_size);
gtk_adjustment_set_value (adj, new);
-
}
static void
@@ -462,6 +464,10 @@ on_mouse_motion (GtkWidget *widget, GdkEventMotion *motion, Window *window)
GtkAdjustment *hadj = gtk_scrolled_window_get_hadjustment (get_widget (window, "scrolled_window"));
int x, y;
+#if 0
+ g_print ("motion: %d\n", motion->time);
+#endif
+
if (motion->is_hint)
{
gtk_widget_get_pointer (widget, &x, &y);