[gimp] app: handle gtk_accel_map_change_entry () failure...



commit eab4929a782ef63a06284515f8e518592152ee47
Author: Jehan <jehan girinstud io>
Date:   Fri Nov 25 05:16:35 2016 +0100

    app: handle gtk_accel_map_change_entry () failure...
    
    ... for "windows-display-*" actions.
    I should not happen, but let's be thorough and properly handle failure
    with a message since this is a runtime issue.

 app/actions/windows-actions.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/app/actions/windows-actions.c b/app/actions/windows-actions.c
index a92292c..eea4f63 100644
--- a/app/actions/windows-actions.c
+++ b/app/actions/windows-actions.c
@@ -431,9 +431,13 @@ windows_actions_update_display_accels (GimpActionGroup *group)
           else
             accel_key = GDK_KEY_0;
 
-          gtk_accel_map_change_entry (accel_path,
-                                      accel_key, GDK_MOD1_MASK,
-                                      TRUE);
+          if (! gtk_accel_map_change_entry (accel_path,
+                                            accel_key, GDK_MOD1_MASK,
+                                            TRUE))
+            {
+              g_warning ("%s: failed to set accelerator for %s",
+                         G_STRFUNC, accel_path);
+            }
         }
     }
 }


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