Blame SOURCES/0026-cheese-Protect-set_wide_mode-set_fullscreen-against-.patch

ecdf9b
From b0bdc5489ab2476bac63fcf2919f92efe743c828 Mon Sep 17 00:00:00 2001
ecdf9b
From: Hans de Goede <hdegoede@redhat.com>
ecdf9b
Date: Wed, 12 Jun 2013 17:54:02 +0200
ecdf9b
Subject: [PATCH 26/35] cheese: Protect set_wide_mode / set_fullscreen against
ecdf9b
 double calls
ecdf9b
ecdf9b
Make it safe to call set_wide_mode / set_fullscreen twice with the same
ecdf9b
value.
ecdf9b
ecdf9b
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ecdf9b
---
ecdf9b
 src/cheese-window.vala | 10 ++++++++++
ecdf9b
 1 file changed, 10 insertions(+)
ecdf9b
ecdf9b
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
ecdf9b
index 6425a7f..906105b 100644
ecdf9b
--- a/src/cheese-window.vala
ecdf9b
+++ b/src/cheese-window.vala
ecdf9b
@@ -86,6 +86,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
 
ecdf9b
   private bool is_fullscreen;
ecdf9b
   private bool is_wide_mode;
ecdf9b
+  private bool is_wide_mode_initialized;
ecdf9b
   private bool is_recording;       /* Video Recording Flag */
ecdf9b
   private bool is_bursting;
ecdf9b
   private bool is_effects_selector_active;
ecdf9b
@@ -633,6 +634,10 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
      * So that the next time leave_fullscreen_button_container.show_all () is called, the button is actually shown
ecdf9b
      * FIXME: If this code can be made cleaner/clearer, please do */
ecdf9b
 
ecdf9b
+    if (is_fullscreen == fullscreen)
ecdf9b
+    {
ecdf9b
+      return;
ecdf9b
+    }
ecdf9b
     is_fullscreen = fullscreen;
ecdf9b
 
ecdf9b
     if (!is_command_line_startup)
ecdf9b
@@ -703,6 +708,11 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
   [CCode (instance_pos = -1)]
ecdf9b
   public void set_wide_mode (bool wide_mode)
ecdf9b
   {
ecdf9b
+    if (is_wide_mode_initialized && is_wide_mode == wide_mode)
ecdf9b
+    {
ecdf9b
+      return;
ecdf9b
+    }
ecdf9b
+    is_wide_mode_initialized = true;
ecdf9b
     is_wide_mode = wide_mode;
ecdf9b
 
ecdf9b
     if (!is_command_line_startup)
ecdf9b
-- 
ecdf9b
1.8.2.1
ecdf9b