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
1=== modified file 'src/lightdm-gtk-greeter.c'
2--- src/lightdm-gtk-greeter.c 2015-03-27 05:29:45 +0000
3+++ src/lightdm-gtk-greeter.c 2015-05-06 09:14:08 +0000
4@@ -345,6 +345,12 @@
5 gtk_editable_set_position(GTK_EDITABLE(data->widget), data->editable_pos);
6 }
7
8+static void
9+infobar_revealed_cb_710888 (GObject *gobject, GParamSpec *pspec, gpointer user_data)
10+{
11+ gtk_widget_set_visible (GTK_WIDGET (info_bar), !message_label_is_empty ());
12+}
13+
14 /* Terminating */
15
16 static GPid
17@@ -2763,6 +2769,17 @@
18
19 init_indicators ();
20
21+ /* https://bugzilla.gnome.org/show_bug.cgi?id=710888
22+ > GtkInfoBar not shown after calling gtk_widget_show
23+ Assume they will fix it someday. */
24+ if (gtk_get_major_version () == 3 && gtk_get_minor_version () < 18)
25+ {
26+ GList *children = gtk_container_get_children (GTK_CONTAINER (info_bar));
27+ if (g_list_length (children) == 1 && GTK_IS_REVEALER (children->data))
28+ g_signal_connect_after(children->data, "notify::child-revealed", (GCallback)infobar_revealed_cb_710888, NULL);
29+ g_list_free (children);
30+ }
31+
32 /* Hide empty panel */
33 GList *menubar_items = gtk_container_get_children (GTK_CONTAINER (menubar));
34 if (!menubar_items)

Subscribers

People subscribed via source and target branches