From 6320b12e8c63bd13ca33c5d206d9d2f322f8b21d Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Sun, 23 Aug 2009 08:59:34 +0200 Subject: [PATCH] Bug 526149 - GtkCellRendererAccel editing conflicts with mnemonics GtkCellRendererAccel also needs to acquire the GTK+ grab in addition to a GDK keyboard grab. With the GDK keyboard grab, KeyPress and KeyRelease events are delivered as usual, although we only want to receive them for our grab widget. --- gtk/gtkcellrendereraccel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c index f3e229688b..4b25289613 100644 --- a/gtk/gtkcellrendereraccel.c +++ b/gtk/gtkcellrendereraccel.c @@ -470,6 +470,7 @@ grab_key_callback (GtkWidget *widget, edited = TRUE; out: + gtk_grab_remove (accel->grab_widget); gdk_display_keyboard_ungrab (display, event->time); gdk_display_pointer_ungrab (display, event->time); @@ -497,6 +498,7 @@ ungrab_stuff (GtkWidget *widget, { GdkDisplay *display = gtk_widget_get_display (widget); + gtk_grab_remove (accel->grab_widget); gdk_display_keyboard_ungrab (display, GDK_CURRENT_TIME); gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME); @@ -606,6 +608,8 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, gtk_widget_show_all (accel->edit_widget); + gtk_grab_add (accel->grab_widget); + g_signal_connect (G_OBJECT (accel->edit_widget), "unrealize", G_CALLBACK (ungrab_stuff), accel);