[Xfce4-commits] <xfce4-settings:master> Always show identity popups (Drop focus-out event to reduce redraws)

Nick Schermer noreply at xfce.org
Sun Oct 28 10:45:33 CET 2012


Updating branch refs/heads/master
         to 6f819104eef28083a6edf7a952b82797d8f6ed2d (commit)
       from da345c7d32e09978ad12c4478a49b6a111997fd4 (commit)

commit 6f819104eef28083a6edf7a952b82797d8f6ed2d
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Oct 26 14:08:44 2012 +0200

    Always show identity popups
    (Drop focus-out event to reduce redraws)

 dialogs/display-settings/main.c |   29 +++++++++--------------------
 1 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index ba80d05..8f56e0a 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -205,24 +205,21 @@ display_setting_combo_box_get_value (GtkComboBox *combobox,
 }
 
 static void
-display_setting_toggle_identity_popup (gpointer   key,
+display_setting_show_identity_popup (gpointer   key,
                                        GtkWidget *value,
-                                       gpointer   show)
+                                       gpointer   userdata)
 {
-    if (!GPOINTER_TO_INT (show))
-        gtk_widget_hide (value);
-    else
-        gtk_widget_show (value);
+    gtk_widget_show (value);
 }
 
 static gboolean
-display_setting_toggle_identity_popups (GtkWidget *widget,
+display_setting_show_identity_popups (GtkWidget *widget,
                                         GdkEvent  *event,
-                                        gpointer   show)
+                                        gpointer   userdata)
 {
     g_hash_table_foreach (display_popups,
-                          (GHFunc) display_setting_toggle_identity_popup,
-                          show);
+                          (GHFunc) display_setting_show_identity_popup,
+                          NULL);
     return FALSE;
 }
 
@@ -289,11 +286,7 @@ display_setting_timed_confirmation (GtkBuilder *main_builder)
 
         dialog = gtk_builder_get_object (builder, "dialog1");
 
-        g_signal_connect (G_OBJECT (dialog), "focus-out-event", G_CALLBACK (display_setting_toggle_identity_popups),
-                          GINT_TO_POINTER (FALSE));
-
-        g_signal_connect (G_OBJECT (dialog), "focus-in-event", G_CALLBACK (display_setting_toggle_identity_popups),
-                          GINT_TO_POINTER (TRUE));
+        g_signal_connect (G_OBJECT (dialog), "focus-in-event", G_CALLBACK (display_setting_show_identity_popups), NULL);
 
         gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (main_dialog));
         source_id = g_timeout_add_seconds (1, (GSourceFunc) display_settings_update_time_label,
@@ -1774,11 +1767,7 @@ display_settings_show_main_dialog (GdkDisplay *display)
             gtk_widget_show (GTK_WIDGET (plug_child));
         }
 
-        g_signal_connect (G_OBJECT (dialog), "focus-out-event", G_CALLBACK (display_setting_toggle_identity_popups),
-                          GINT_TO_POINTER (FALSE));
-
-        g_signal_connect (G_OBJECT (dialog), "focus-in-event", G_CALLBACK (display_setting_toggle_identity_popups),
-                          GINT_TO_POINTER (TRUE));
+        g_signal_connect (G_OBJECT (dialog), "focus-in-event", G_CALLBACK (display_setting_show_identity_popups), NULL);
 
         /* To prevent the settings dialog to be saved in the session */
         gdk_set_sm_client_id ("FAKE ID");


More information about the Xfce4-commits mailing list