From 83ec27bee0c7b09dc0f89dc878eafec027236d6f Mon Sep 17 00:00:00 2001 From: John Smith Date: Tue, 18 Sep 2012 10:06:04 +0900 Subject: Fix for 979567 : Object context menu (right-click) acts on bottom-most instead of top-most object under cursor position (bzr r11672) --- src/event-context.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/event-context.cpp') diff --git a/src/event-context.cpp b/src/event-context.cpp index 848865b95..2c9ed1abd 100644 --- a/src/event-context.cpp +++ b/src/event-context.cpp @@ -691,9 +691,11 @@ static gint sp_event_context_private_root_handler( int const wheel_scroll = prefs->getIntLimited( "/options/wheelscroll/value", 40, 0, 1000); +#if GTK_CHECK_VERSION(3,0,0) // Size of smooth-scrolls (only used in GTK+ 3) gdouble delta_x = 0; gdouble delta_y = 0; +#endif /* shift + wheel, pan left--right */ if (event->scroll.state & GDK_SHIFT_MASK) { @@ -1059,10 +1061,18 @@ static void set_event_location(SPDesktop *desktop, GdkEvent *event) { * Create popup menu and tell Gtk to show it. */ void sp_event_root_menu_popup(SPDesktop *desktop, SPItem *item, GdkEvent *event) { + + // It seems the param item is the SPItem at the bottom of the z-order + // Using the same function call used on left click in sp_select_context_item_handler() to get top of z-order + // fixme: sp_canvas_arena should set the top z-order object as arena->active + item = sp_event_context_find_item (desktop, + Geom::Point(event->button.x, event->button.y), FALSE, FALSE); + /* fixme: This is not what I want but works for now (Lauris) */ if (event->type == GDK_KEY_PRESS) { item = sp_desktop_selection(desktop)->singleItem(); } + ContextMenu* CM = new ContextMenu(desktop, item); CM->show(); -- cgit v1.2.3