aboutsummaryrefslogtreecommitdiff
path: root/libtopmenu-server/topmenu-widget.c
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-05-24 20:02:31 +0200
committerJavier <dev.git@javispedro.com>2014-05-24 20:02:31 +0200
commit9e6a4592f2674b9b6e4722e3212dd2584201a19a (patch)
tree396bffce4c206114d6bb161bb913c8f93a5bf57f /libtopmenu-server/topmenu-widget.c
parent96b576bad7bba88fedd41a963430073404c6514a (diff)
downloadtopmenu-gtk-9e6a4592f2674b9b6e4722e3212dd2584201a19a.tar.gz
topmenu-gtk-9e6a4592f2674b9b6e4722e3212dd2584201a19a.zip
add missing size_allocate/request to server widget
accidentally removed during gtk3 port :)
Diffstat (limited to 'libtopmenu-server/topmenu-widget.c')
-rw-r--r--libtopmenu-server/topmenu-widget.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libtopmenu-server/topmenu-widget.c b/libtopmenu-server/topmenu-widget.c
index 05a2895..4dd1ed8 100644
--- a/libtopmenu-server/topmenu-widget.c
+++ b/libtopmenu-server/topmenu-widget.c
@@ -319,6 +319,25 @@ static void topmenu_widget_unmap(GtkWidget *widget)
GTK_WIDGET_CLASS(topmenu_widget_parent_class)->unmap(widget);
}
+static void topmenu_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
+{
+ TopMenuWidget *self = TOPMENU_WIDGET(widget);
+ if (self->socket) {
+ gtk_widget_size_allocate(GTK_WIDGET(self->socket), allocation);
+ }
+ GTK_WIDGET_CLASS(topmenu_widget_parent_class)->size_allocate(widget, allocation);
+}
+
+#if GTK_MAJOR_VERSION == 2
+static void topmenu_widget_size_request(GtkWidget *widget, GtkRequisition *requisition)
+{
+ TopMenuWidget *self = TOPMENU_WIDGET(widget);
+ if (self->socket) {
+ gtk_widget_size_request(GTK_WIDGET(self->socket), requisition);
+ }
+}
+#endif
+
static void topmenu_widget_dispose(GObject *obj)
{
TopMenuWidget *self = TOPMENU_WIDGET(obj);
@@ -342,6 +361,10 @@ static void topmenu_widget_class_init(TopMenuWidgetClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
widget_class->map = topmenu_widget_map;
widget_class->unmap = topmenu_widget_unmap;
+ widget_class->size_allocate = topmenu_widget_size_allocate;
+#if GTK_MAJOR_VERSION == 2
+ widget_class->size_request = topmenu_widget_size_request;
+#endif
GObjectClass *obj_class = G_OBJECT_CLASS(klass);
obj_class->dispose = topmenu_widget_dispose;