From 0af3ff804c0d71c76fd63f0a2a152cac7de64863 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 13 Jan 2011 10:54:58 -0500 Subject: Fudge gtk_widget_get_preferred_size() for gtk2. Easy enough to fake gtk_widget_get_preferred_size() in gtk2 using gtk_widget_size_request(). Reduces diff noise with gtk3 branch. --- calendar/gui/e-calendar-view.c | 2 +- calendar/gui/e-meeting-time-sel.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'calendar') diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 13ea437f2f..868b411a10 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1740,7 +1740,7 @@ e_calendar_view_move_tip (GtkWidget *widget, gint x, gint y) screen = gtk_widget_get_screen (widget); - gtk_widget_size_request (widget, &requisition); + gtk_widget_get_preferred_size (widget, &requisition, NULL); w = requisition.width; h = requisition.height; diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index 4b2ccfc67f..8b6f36da6b 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -46,6 +46,9 @@ #include "e-meeting-list-view.h" #include "e-meeting-time-sel-item.h" +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define E_MEETING_TIME_SELECTOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_MEETING_TIME_SELECTOR, EMeetingTimeSelectorPrivate)) @@ -1741,7 +1744,7 @@ e_meeting_time_selector_options_menu_position_callback (GtkMenu *menu, *y += allocation.y + allocation.height - 2; /* Now make sure we are on the screen. */ - gtk_widget_size_request (mts->options_menu, &menu_requisition); + gtk_widget_get_preferred_size (mts->options_menu, &menu_requisition, NULL); max_x = MAX (0, gdk_screen_width () - menu_requisition.width); max_y = MAX (0, gdk_screen_height () - menu_requisition.height); *x = CLAMP (*x, 0, max_x); @@ -1794,7 +1797,7 @@ e_meeting_time_selector_autopick_menu_position_callback (GtkMenu *menu, *y += allocation.y + allocation.height - 2; /* Now make sure we are on the screen. */ - gtk_widget_size_request (mts->autopick_menu, &menu_requisition); + gtk_widget_get_preferred_size (mts->autopick_menu, &menu_requisition, NULL); max_x = MAX (0, gdk_screen_width () - menu_requisition.width); max_y = MAX (0, gdk_screen_height () - menu_requisition.height); *x = CLAMP (*x, 0, max_x); -- cgit