Blob Blame History Raw
From 81ad92ad8228ba36209130ed4eaf67752ea79bb8 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 13 Jun 2013 12:39:44 +0200
Subject: [PATCH 35/35] cheese-flash: Fix the flash no longer being white

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 libcheese/cheese-flash.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/libcheese/cheese-flash.c b/libcheese/cheese-flash.c
index fd46818..37cd36d 100644
--- a/libcheese/cheese-flash.c
+++ b/libcheese/cheese-flash.c
@@ -76,29 +76,13 @@ struct _CheeseFlashPrivate
   guint fade_timeout_tag;
 };
 
-/*
- * cheese_flash_draw_event_cb:
- * @widget: the #CheeseFlash
- * @cr: the Cairo context
- * @user_data: the user data of the signal
- *
- * Draw the flash.
- *
- * Returns: %TRUE
- */
-static gboolean
-cheese_flash_draw_event_cb (GtkWidget *widget, cairo_t *cr, gpointer user_data)
-{
-  cairo_fill (cr);
-  return TRUE;
-}
-
 static void
 cheese_flash_init (CheeseFlash *self)
 {
   CheeseFlashPrivate *priv = self->priv = CHEESE_FLASH_GET_PRIVATE (self);
   cairo_region_t *input_region;
   GtkWindow *window = GTK_WINDOW (self);
+  const GdkColor white = { 0, 65535, 65535, 65535 };
 
   priv->flash_timeout_tag = 0;
   priv->fade_timeout_tag  = 0;
@@ -113,13 +97,14 @@ cheese_flash_init (CheeseFlash *self)
   gtk_window_set_accept_focus (window, FALSE);
   gtk_window_set_focus_on_map (window, FALSE);
 
+  /* Make it white */
+  gtk_widget_modify_bg (GTK_WIDGET (window), GTK_STATE_NORMAL, &white);
+
   /* Don't consume input */
   gtk_widget_realize (GTK_WIDGET (window));
   input_region = cairo_region_create ();
   gdk_window_input_shape_combine_region (gtk_widget_get_window (GTK_WIDGET (window)), input_region, 0, 0);
   cairo_region_destroy (input_region);
-
-  g_signal_connect (G_OBJECT (window), "draw", G_CALLBACK (cheese_flash_draw_event_cb), NULL);
 }
 
 static void
-- 
1.8.2.1