[gnome-builder] libide: cancel macro if suppressing unbound input



commit 0dae77e814077c88520738764e0d7980c714fb3f
Author: Christian Hergert <christian hergert me>
Date:   Thu Mar 12 03:29:11 2015 -0700

    libide: cancel macro if suppressing unbound input
    
    We could get into a weird state if we suppress input while a macro is
    recording (since it wont get stopped). This kills it when supressing
    the input.

 libide/ide-source-view-mode.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libide/ide-source-view-mode.c b/libide/ide-source-view-mode.c
index 1ede67f..c73bfb5 100644
--- a/libide/ide-source-view-mode.c
+++ b/libide/ide-source-view-mode.c
@@ -426,8 +426,12 @@ _ide_source_view_mode_do_event (IdeSourceViewMode *mode,
     case IDE_SOURCE_VIEW_MODE_TYPE_PERMANENT:
       {
         /* don't block possible accelerators, but supress others */
-        if (suppress_unbound && ((event->state & GDK_MODIFIER_MASK) == 0))
-          handled = TRUE;
+        if (!handled && suppress_unbound && ((event->state & GDK_MODIFIER_MASK) == 0))
+          {
+            /* cancel any inflight macros */
+            g_signal_emit_by_name (priv->view, "end-macro");
+            handled = TRUE;
+          }
       }
       break;
 


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