diff --git a/ChangeLog b/ChangeLog index 9d7941b1b9..e3fe7ed0c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-06-02 Matthias Clasen + * gtk/gtkstatusicon.c (gtk_status_icon_get_geometry): Allow + to return partial information. (#343625, Christian Persch) + * gtk/gtkwindow.c (gtk_window_key_release_event): Chain up to key_release, not to key_press. (#343677, Tommi Komulainen) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9d7941b1b9..e3fe7ed0c2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2006-06-02 Matthias Clasen + * gtk/gtkstatusicon.c (gtk_status_icon_get_geometry): Allow + to return partial information. (#343625, Christian Persch) + * gtk/gtkwindow.c (gtk_window_key_release_event): Chain up to key_release, not to key_press. (#343677, Tommi Komulainen) diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c index 61a62fc000..27a56511cf 100755 --- a/gtk/gtkstatusicon.c +++ b/gtk/gtkstatusicon.c @@ -1634,12 +1634,14 @@ gtk_status_icon_position_menu (GtkMenu *menu, /** * gtk_status_icon_get_geometry: * @status_icon: a #GtkStatusIcon - * @screen: return location for the screen - * @area: return location for the area occupied by the status icon + * @screen: return location for the screen, or %NULL if the + * information is not needed + * @area: return location for the area occupied by the status + * icon, or %NULL * @orientation: return location for the orientation of the panel - * in which the status icon is embedded. A panel at the top or - * bottom of the screen is horizontal, a panel at the left or - * right is vertical. + * in which the status icon is embedded, or %NULL. A panel + * at the top or bottom of the screen is horizontal, a panel + * at the left or right is vertical. * * Obtains information about the location of the status icon * on screen. This information can be used to e.g. position @@ -1666,18 +1668,25 @@ gtk_status_icon_get_geometry (GtkStatusIcon *status_icon, GtkStatusIconPrivate *priv; gint x, y; - g_return_if_fail (GTK_IS_STATUS_ICON (status_icon)); + g_return_val_if_fail (GTK_IS_STATUS_ICON (status_icon), FALSE); priv = status_icon->priv; widget = priv->tray_icon; - *screen = gtk_widget_get_screen (widget); - gdk_window_get_origin (widget->window, &x, &y); - area->x = x; - area->y = y; - area->width = widget->allocation.width; - area->height = widget->allocation.height; - *orientation = _gtk_tray_icon_get_orientation (GTK_TRAY_ICON (widget)); + if (screen) + *screen = gtk_widget_get_screen (widget); + + if (area) + { + gdk_window_get_origin (widget->window, &x, &y); + area->x = x; + area->y = y; + area->width = widget->allocation.width; + area->height = widget->allocation.height; + } + + if (orientation) + *orientation = _gtk_tray_icon_get_orientation (GTK_TRAY_ICON (widget)); return TRUE; #else