[libwnck/gtk3] Fix build after size-request removal
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck/gtk3] Fix build after size-request removal
- Date: Fri, 3 Dec 2010 14:38:06 +0000 (UTC)
commit 27a669309aa7a37d813a57e3ffcfa3e3e3f7bf8c
Author: Christian Persch <chpe gnome org>
Date: Fri Dec 3 15:37:44 2010 +0100
Fix build after size-request removal
libwnck/pager.c | 35 ++++++++++++++++++++++++++++++++---
libwnck/tasklist.c | 36 +++++++++++++++++++++++++++++++++---
2 files changed, 65 insertions(+), 6 deletions(-)
---
diff --git a/libwnck/pager.c b/libwnck/pager.c
index 3f0cb86..159c451 100644
--- a/libwnck/pager.c
+++ b/libwnck/pager.c
@@ -113,8 +113,12 @@ static void wnck_pager_finalize (GObject *object);
static void wnck_pager_realize (GtkWidget *widget);
static void wnck_pager_unrealize (GtkWidget *widget);
-static void wnck_pager_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
+static void wnck_pager_get_preferred_width (GtkWidget *widget,
+ int *minimum_width,
+ int *natural_width);
+static void wnck_pager_get_preferred_height (GtkWidget *widget,
+ int *minimum_height,
+ int *natural_height);
static void wnck_pager_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gboolean wnck_pager_draw (GtkWidget *widget,
@@ -248,7 +252,8 @@ wnck_pager_class_init (WnckPagerClass *klass)
widget_class->realize = wnck_pager_realize;
widget_class->unrealize = wnck_pager_unrealize;
- widget_class->size_request = wnck_pager_size_request;
+ widget_class->get_preferred_width = wnck_pager_get_preferred_width;
+ widget_class->get_preferred_height = wnck_pager_get_preferred_height;
widget_class->size_allocate = wnck_pager_size_allocate;
widget_class->draw = wnck_pager_draw;
widget_class->button_press_event = wnck_pager_button_press;
@@ -534,6 +539,30 @@ wnck_pager_size_request (GtkWidget *widget,
}
static void
+wnck_pager_get_preferred_width (GtkWidget *widget,
+ int *minimum_width,
+ int *natural_width)
+{
+ GtkRequisition req;
+
+ wnck_pager_size_request (widget, &req);
+
+ *minimum_width = *natural_width = req.width;
+}
+
+static void
+wnck_pager_get_preferred_height (GtkWidget *widget,
+ int *minimum_height,
+ int *natural_height)
+{
+ GtkRequisition req;
+
+ wnck_pager_size_request (widget, &req);
+
+ *minimum_height = *natural_height = req.height;
+}
+
+static void
wnck_pager_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
index 1a21b7e..1762cdf 100644
--- a/libwnck/tasklist.c
+++ b/libwnck/tasklist.c
@@ -289,8 +289,12 @@ static GObject *wnck_tasklist_constructor (GType type,
GObjectConstructParam *construct_properties);
static void wnck_tasklist_finalize (GObject *object);
-static void wnck_tasklist_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
+static void wnck_tasklist_get_preferred_width (GtkWidget *widget,
+ int *minimum_width,
+ int *natural_width);
+static void wnck_tasklist_get_preferred_height (GtkWidget *widget,
+ int *minimum_height,
+ int *natural_height);
static void wnck_tasklist_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void wnck_tasklist_realize (GtkWidget *widget);
@@ -689,7 +693,8 @@ wnck_tasklist_class_init (WnckTasklistClass *klass)
object_class->constructor = wnck_tasklist_constructor;
object_class->finalize = wnck_tasklist_finalize;
- widget_class->size_request = wnck_tasklist_size_request;
+ widget_class->get_preferred_width = wnck_tasklist_get_preferred_width;
+ widget_class->get_preferred_height = wnck_tasklist_get_preferred_height;
widget_class->size_allocate = wnck_tasklist_size_allocate;
widget_class->realize = wnck_tasklist_realize;
widget_class->unrealize = wnck_tasklist_unrealize;
@@ -1384,6 +1389,31 @@ wnck_tasklist_size_request (GtkWidget *widget,
requisition->height = fake_allocation.height;
}
+static void
+wnck_tasklist_get_preferred_width (GtkWidget *widget,
+ int *minimum_width,
+ int *natural_width)
+{
+ GtkRequisition req;
+
+ wnck_tasklist_size_request (widget, &req);
+
+ *minimum_width = *natural_width = req.width;
+}
+
+static void
+wnck_tasklist_get_preferred_height (GtkWidget *widget,
+ int *minimum_height,
+ int *natural_height)
+{
+ GtkRequisition req;
+
+ wnck_tasklist_size_request (widget, &req);
+
+ *minimum_height = *natural_height = req.height;
+}
+
+
/**
* wnck_tasklist_get_size_hint_list:
* @tasklist: a #WnckTasklist.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]