summaryrefslogtreecommitdiff
path: root/libslab/search-context-picker.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-24 16:01:49 +0100
committerStefano Karapetsas <[email protected]>2014-01-24 16:01:49 +0100
commit80c3d8ace4794481e711fb63e4eefd9f1f5cc1ef (patch)
treec9ca5dade16593759c5d2ced120c028e963ae7d6 /libslab/search-context-picker.c
parent31bfbb9e6aba9a1c82999823f7a3cd9dd6ec500b (diff)
downloadmate-control-center-80c3d8ace4794481e711fb63e4eefd9f1f5cc1ef.tar.bz2
mate-control-center-80c3d8ace4794481e711fb63e4eefd9f1f5cc1ef.tar.xz
libslab: Add GTK3 support
Diffstat (limited to 'libslab/search-context-picker.c')
-rw-r--r--libslab/search-context-picker.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libslab/search-context-picker.c b/libslab/search-context-picker.c
index 449c6297..c19e5b1c 100644
--- a/libslab/search-context-picker.c
+++ b/libslab/search-context-picker.c
@@ -94,16 +94,18 @@ static void
menu_position_func (GtkMenu * menu, int *x, int *y, gboolean * push_in, gpointer picker)
{
GtkWidget *widget = GTK_WIDGET (picker);
+ GtkAllocation *allocation;
- gdk_window_get_origin (widget->window, x, y);
- *x += widget->allocation.x;
- *y += widget->allocation.y + widget->allocation.height;
+ gtk_widget_get_allocation (widget, allocation);
+ gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
+ *x += allocation->x;
+ *y += allocation->y + allocation->height;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
{
GtkRequisition req;
gtk_widget_size_request (GTK_WIDGET (menu), &req);
- *x += widget->allocation.width - req.width;
+ *x += allocation->width - req.width;
}
*push_in = FALSE;