[nautilus] canvas-container: fix opening menus using keyboard



commit d48c2e88f4faf756ddbbef057ff766e545316c03
Author: djb <db0451 gmail com>
Date:   Tue Oct 18 11:29:45 2016 +0100

    canvas-container: fix opening menus using keyboard
    
    This was broken by commit 1f57c5b19c099ae44b2c8ec8ca9a1904f1ed7885.
    When the keyboard was used to pop up these menus, a zero-initialised
    GdkEventButton was passed to gtk_menu_popup_at_pointer, which led to
    this warning:
    
    Gtk-CRITICAL **: gtk_menu_popup_at_rect: assertion 'GDK_IS_WINDOW
    (rect_window)' failed"
    
    As suggested by Ernestas Kulik, we can fix this by passing a NULL event
    pointer instead, which leads to the GtkMenu function falling back to the
    current cursor position anyway, and the menu opens OK at that location.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773120

 src/nautilus-canvas-container.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-canvas-container.c b/src/nautilus-canvas-container.c
index 67196f4..e15630e 100644
--- a/src/nautilus-canvas-container.c
+++ b/src/nautilus-canvas-container.c
@@ -5092,12 +5092,10 @@ handle_popups (NautilusCanvasContainer *container,
                GdkEventKey             *event,
                const char              *signal)
 {
-    GdkEventButton button_event = { 0 };
-
     /* ensure we clear the drag state before showing the menu */
     clear_drag_state (container);
 
-    g_signal_emit_by_name (container, signal, &button_event);
+    g_signal_emit_by_name (container, signal, NULL);
 
     return TRUE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]