[libgd/wip/ernestask/gtk4: 2/4] notification: use gtk_widget_get_allocated_height()



commit ccaa2bfd32588eac2e8d0a36034f4b67331e7838
Author: Ernestas Kulik <ernestask gnome org>
Date:   Sun Mar 11 10:11:41 2018 +0200

    notification: use gtk_widget_get_allocated_height()
    
    Using gtk_widget_get_allocation() only for the height seems wasteful.

 libgd/gd-notification.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/libgd/gd-notification.c b/libgd/gd-notification.c
index 150afe1..5a70c3c 100644
--- a/libgd/gd-notification.c
+++ b/libgd/gd-notification.c
@@ -224,11 +224,9 @@ static int
 animation_target (GdNotification *notification)
 {
   GdNotificationPrivate *priv = notification->priv;
-  GtkAllocation allocation;
 
   if (priv->revealed) {
-    gtk_widget_get_allocation (GTK_WIDGET (notification), &allocation);
-    return allocation.height;
+    return gtk_widget_get_allocated_height (GTK_WIDGET (notification));
   } else {
     return 0;
   }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]