Merge lp:~kalgasnik/lightdm-gtk-greeter/gtk-710888-GtkInfoBar-visibility into lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk

Proposed by Andrew P.
Status: Merged
Merged at revision: 329
Proposed branch: lp:~kalgasnik/lightdm-gtk-greeter/gtk-710888-GtkInfoBar-visibility
Merge into: lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk
Diff against target: 34 lines (+17/-0)
1 file modified
src/lightdm-gtk-greeter.c (+17/-0)
To merge this branch: bzr merge lp:~kalgasnik/lightdm-gtk-greeter/gtk-710888-GtkInfoBar-visibility
Reviewer Review Type Date Requested Status
Sean Davis Approve
Review via email: mp+258348@code.launchpad.net

Description of the change

Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=710888
> GtkInfoBar not shown after calling gtk_widget_show

Usually it happens when user scrolls list with Up/Down keys.

1. Show message
2. Hide message
3. Show new message BEFORE hiding animation ends -> infobar remains hidden.

To post a comment you must log in.
Revision history for this message
Andrew P. (kalgasnik) wrote :

Small illustration: http://pastebin.com/T59zZFEU

Revision history for this message
Sean Davis (bluesabre) wrote :

Seems reasonable to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/lightdm-gtk-greeter.c'
--- src/lightdm-gtk-greeter.c 2015-03-27 05:29:45 +0000
+++ src/lightdm-gtk-greeter.c 2015-05-06 09:14:08 +0000
@@ -345,6 +345,12 @@
345 gtk_editable_set_position(GTK_EDITABLE(data->widget), data->editable_pos);345 gtk_editable_set_position(GTK_EDITABLE(data->widget), data->editable_pos);
346}346}
347347
348static void
349infobar_revealed_cb_710888 (GObject *gobject, GParamSpec *pspec, gpointer user_data)
350{
351 gtk_widget_set_visible (GTK_WIDGET (info_bar), !message_label_is_empty ());
352}
353
348/* Terminating */354/* Terminating */
349355
350static GPid356static GPid
@@ -2763,6 +2769,17 @@
27632769
2764 init_indicators ();2770 init_indicators ();
27652771
2772 /* https://bugzilla.gnome.org/show_bug.cgi?id=710888
2773 > GtkInfoBar not shown after calling gtk_widget_show
2774 Assume they will fix it someday. */
2775 if (gtk_get_major_version () == 3 && gtk_get_minor_version () < 18)
2776 {
2777 GList *children = gtk_container_get_children (GTK_CONTAINER (info_bar));
2778 if (g_list_length (children) == 1 && GTK_IS_REVEALER (children->data))
2779 g_signal_connect_after(children->data, "notify::child-revealed", (GCallback)infobar_revealed_cb_710888, NULL);
2780 g_list_free (children);
2781 }
2782
2766 /* Hide empty panel */2783 /* Hide empty panel */
2767 GList *menubar_items = gtk_container_get_children (GTK_CONTAINER (menubar));2784 GList *menubar_items = gtk_container_get_children (GTK_CONTAINER (menubar));
2768 if (!menubar_items)2785 if (!menubar_items)

Subscribers

People subscribed via source and target branches