summaryrefslogtreecommitdiff
path: root/gtk/gtkapplicationwindow.c
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-04-30 13:43:23 -0400
committerRyan Lortie <desrt@desrt.ca>2012-04-30 17:50:45 -0400
commitbabd137e325931ee7b791dec8df825ad1262a320 (patch)
treec93ec0521c9d1ea68f977d1ea4574c667ba00715 /gtk/gtkapplicationwindow.c
parentcdf473ec100d23ea6a9a8750ad301307a116b674 (diff)
downloadgtk+-babd137e325931ee7b791dec8df825ad1262a320.tar.gz
GtkApplication: fixes for NULL session bus
We currently have a couple of cases where GtkApplication assumes that the session bus will be non-NULL causing critical error output or (in the case of trying to publish menus) an infinite loop. Three fixes: - if the session bus is NULL due to not having registered the GtkApplication yet then give a g_critical on the entry point to the menu setters instead of going into an infinite loop. Document this. - check for NULL session bus even when calling the menu setters at the right time in order to prevent the infinite loop for non-programer-error cases (ie: because we had trouble connecting to the session bus) - check for NULL session bus when publishing the X11 properties on the GtkApplicationWindow and skip publishing them if we're not on the bus https://bugzilla.gnome.org/show_bug.cgi?id=671249
Diffstat (limited to 'gtk/gtkapplicationwindow.c')
-rw-r--r--gtk/gtkapplicationwindow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index 5ef96f6c84..1f045caa4d 100644
--- a/gtk/gtkapplicationwindow.c
+++ b/gtk/gtkapplicationwindow.c
@@ -768,7 +768,7 @@ gtk_application_window_real_realize (GtkWidget *widget)
gdkwindow = gtk_widget_get_window (GTK_WIDGET (window));
- if (GDK_IS_X11_WINDOW (gdkwindow))
+ if (GDK_IS_X11_WINDOW (gdkwindow) && window->priv->session)
{
gdk_x11_window_set_utf8_property (gdkwindow, "_GTK_APPLICATION_ID",
g_application_get_application_id (G_APPLICATION (application)));