diff options
Diffstat (limited to 'libslab/search-context-picker.c')
-rw-r--r-- | libslab/search-context-picker.c | 10 |
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; |