summaryrefslogtreecommitdiff
path: root/gtk/gtkcellrendereraccel.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkcellrendereraccel.c')
-rw-r--r--gtk/gtkcellrendereraccel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c
index f3e229688b..dedbfdae64 100644
--- a/gtk/gtkcellrendereraccel.c
+++ b/gtk/gtkcellrendereraccel.c
@@ -24,6 +24,7 @@
#include "gtkcellrendereraccel.h"
#include "gtklabel.h"
#include "gtkeventbox.h"
+#include "gtkmain.h"
#include "gtkprivate.h"
#include "gdk/gdkkeysyms.h"
#include "gtkalias.h"
@@ -470,6 +471,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 +499,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 +609,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);