Mercurial > hg > forks > geeqie
changeset 1965:8fc175341a58
Don't access directly to GtkWidget properties, use accessors.
We'll have a lot of work to prepare Geeqie for GTK3...
author | Laurent Monin <zas@norz.org> |
---|---|
date | Sat, 22 Jan 2011 13:08:24 +0100 |
parents | 47b2a4ce3894 |
children | bce508abfd93 |
files | src/ui_bookmark.c |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ui_bookmark.c Sat Jan 22 12:19:14 2011 +0100 +++ b/src/ui_bookmark.c Sat Jan 22 13:08:24 2011 +0100 @@ -383,9 +383,14 @@ static void bookmark_menu_position_cb(GtkMenu *menu, gint *x, gint *y, gint *pushed_in, gpointer data) { GtkWidget *button = data; + GdkWindow *window = gtk_widget_get_window(button); + GtkAllocation allocation; - gdk_window_get_origin(button->window, x, y); - *y += button->allocation.y + button->allocation.height; + if (!window) return; + + gtk_widget_get_allocation(button, &allocation); + gdk_window_get_origin(window, x, y); + *y += allocation.y + allocation.height; } static void bookmark_menu_popup(BookMarkData *bm, GtkWidget *button,