priv = GET_PRIV (data);
- switch (xevent->type) {
- case PropertyNotify:
+ if (xevent->type == PropertyNotify) {
atom = gdk_x11_get_xatom_by_name ("_NET_CURRENT_DESKTOP");
if (xevent->xproperty.atom == atom) {
if (priv->popup) {
priv->popup = NULL;
}
}
- break;
}
return GDK_FILTER_CONTINUE;
gdk_error_trap_push ();
if (gdkwindow) {
XWindowAttributes attrs;
- XGetWindowAttributes (gdk_display, window, &attrs);
+ XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window, &attrs);
mask |= attrs.your_event_mask;
}
- XSelectInput (gdk_display, window, mask);
+ XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window, mask);
- gdk_error_trap_pop ();
+ gdk_error_trap_pop_ignored ();
gdk_window_add_filter (NULL, avatar_image_filter_func, avatar_image);
}
gint popup_width, popup_height;
gint width, height;
GdkPixbuf *pixbuf;
+ GtkAllocation allocation;
priv = GET_PRIV (widget);
popup_width = gdk_pixbuf_get_width (priv->pixbuf);
popup_height = gdk_pixbuf_get_height (priv->pixbuf);
- width = priv->image->allocation.width;
- height = priv->image->allocation.height;
+ gtk_widget_get_allocation (priv->image, &allocation);
+ width = allocation.width;
+ height = allocation.height;
/* Don't show a popup if the popup is smaller then the currently avatar
* image.
}
if (!priv->pixbuf) {
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->image),
- "stock_person",
- GTK_ICON_SIZE_DIALOG);
+ gtk_image_clear (GTK_IMAGE (priv->image));
return;
}