Fix building with GSEAL enabled

https://bugzilla.gnome.org/show_bug.cgi?id=612720
This commit is contained in:
William Jon McCann 2010-04-02 20:10:29 -04:00
parent 597ba8d292
commit 5b3f2617d2
1 changed files with 15 additions and 26 deletions

View File

@ -420,13 +420,6 @@ notify_notification_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object); G_OBJECT_CLASS (parent_class)->finalize (object);
} }
static GtkWidget *
get_internal_tray_icon (GtkStatusIcon *status)
{
/* This function is a temporary hack */
return GTK_WIDGET (*((GtkWidget **) (status->priv)));
}
static void static void
_notify_notification_update_applet_hints (NotifyNotification *n) _notify_notification_update_applet_hints (NotifyNotification *n)
{ {
@ -436,43 +429,39 @@ _notify_notification_update_applet_hints (NotifyNotification *n)
if (priv->status_icon != NULL) { if (priv->status_icon != NULL) {
GdkRectangle rect; GdkRectangle rect;
GtkWidget *internal_tray = get_internal_tray_icon (priv->status_icon);
GdkWindow *window; GdkWindow *window;
guint32 xid;
// TODO: this is sort of a hack, but we need a window ID to send along xid = gtk_status_icon_get_x11_window_id (priv->status_icon);
gtk_widget_realize (internal_tray); if (xid > 0) {
window = internal_tray->window; notify_notification_set_hint_uint32 (n, "window-xid", xid);
if (window != NULL) {
guint32 xid = GDK_WINDOW_XID (window);
notify_notification_set_hint_uint32 (n,
"window-xid",
xid);
} }
if (!gtk_status_icon_get_geometry (priv->status_icon, if (!gtk_status_icon_get_geometry (priv->status_icon,
&screen, &screen,
&rect, NULL)) { &rect,
NULL)) {
return; return;
} }
x = rect.x + rect.width / 2; x = rect.x + rect.width / 2;
y = rect.y + rect.height / 2; y = rect.y + rect.height / 2;
} else if (priv->attached_widget != NULL) { } else if (priv->attached_widget != NULL) {
GtkWidget *widget = priv->attached_widget; GtkWidget *widget = priv->attached_widget;
GtkAllocation allocation;
screen = gtk_widget_get_screen (widget); screen = gtk_widget_get_screen (widget);
gdk_window_get_origin (widget->window, &x, &y); gdk_window_get_origin (gtk_widget_get_window (widget), &x, &y);
gtk_widget_get_allocation (widget, &allocation);
if (GTK_WIDGET_NO_WINDOW (widget)) { if (!gtk_widget_get_has_window (widget)) {
x += widget->allocation.x; x += allocation.x;
y += widget->allocation.y; y += allocation.y;
} }
x += widget->allocation.width / 2; x += allocation.width / 2;
y += widget->allocation.height / 2; y += allocation.height / 2;
} else { } else {
return; return;
} }