From 80aa207c49dda77a013f0df2a2e2a393062a96b6 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Wed, 31 Mar 2010 19:09:00 +0000 Subject: [shell] Fix build with GSEAL_ENABLE --- (limited to 'shell/ev-navigation-action-widget.c') diff --git a/shell/ev-navigation-action-widget.c b/shell/ev-navigation-action-widget.c index a9a6023..465a474 100644 --- a/shell/ev-navigation-action-widget.c +++ b/shell/ev-navigation-action-widget.c @@ -127,7 +127,9 @@ menu_position_func (GtkMenu *menu, { GtkWidget *widget = GTK_WIDGET (button); GtkRequisition menu_req; + GtkAllocation allocation; GtkTextDirection direction; + GdkWindow *gdk_window; GdkRectangle monitor; gint monitor_num; GdkScreen *screen; @@ -136,26 +138,28 @@ menu_position_func (GtkMenu *menu, direction = gtk_widget_get_direction (widget); screen = gtk_widget_get_screen (GTK_WIDGET (menu)); - monitor_num = gdk_screen_get_monitor_at_window (screen, widget->window); + gdk_window = gtk_widget_get_window (widget); + monitor_num = gdk_screen_get_monitor_at_window (screen, gdk_window); if (monitor_num < 0) monitor_num = 0; gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); - gdk_window_get_origin (widget->window, x, y); - *x += widget->allocation.x; - *y += widget->allocation.y; + gdk_window_get_origin (gdk_window, x, y); + gtk_widget_get_allocation (widget, &allocation); + *x += allocation.x; + *y += allocation.y; if (direction == GTK_TEXT_DIR_LTR) - *x += MAX (widget->allocation.width - menu_req.width, 0); - else if (menu_req.width > widget->allocation.width) - *x -= menu_req.width - widget->allocation.width; + *x += MAX (allocation.width - menu_req.width, 0); + else if (menu_req.width > allocation.width) + *x -= menu_req.width - allocation.width; - if ((*y + widget->allocation.height + menu_req.height) <= monitor.y + monitor.height) - *y += widget->allocation.height; + if ((*y + allocation.height + menu_req.height) <= monitor.y + monitor.height) + *y += allocation.height; else if ((*y - menu_req.height) >= monitor.y) *y -= menu_req.height; - else if (monitor.y + monitor.height - (*y + widget->allocation.height) > *y) - *y += widget->allocation.height; + else if (monitor.y + monitor.height - (*y + allocation.height) > *y) + *y += allocation.height; else *y -= menu_req.height; -- cgit v0.9.1