[geary] Avoid WebKit bug when spelling suggestions not found
- From: Charles Lindsay <clindsay src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Avoid WebKit bug when spelling suggestions not found
- Date: Wed, 5 Mar 2014 02:09:02 +0000 (UTC)
commit 5bb9349692f429f8ae5306f252e177a967bd0f6f
Author: Robert Schroll <rschroll gmail com>
Date: Sun Mar 2 16:13:32 2014 -0500
Avoid WebKit bug when spelling suggestions not found
webkit_context_menu_item_get_action() fails an assertion when fed the
item indicating that there are no spelling suggestions. Since this item
is insensitive, we avoid making the call in that case. There are no
other insensitive items we need to do something special with.
Closes: bgo #725518
src/client/composer/composer-window.vala | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/src/client/composer/composer-window.vala b/src/client/composer/composer-window.vala
index fca0af8..e92dfb5 100644
--- a/src/client/composer/composer-window.vala
+++ b/src/client/composer/composer-window.vala
@@ -1433,16 +1433,18 @@ public class ComposerWindow : Gtk.Window {
GLib.List<weak Gtk.Widget> children = context_menu.get_children();
foreach (weak Gtk.Widget child in children) {
Gtk.MenuItem item = (Gtk.MenuItem) child;
- WebKit.ContextMenuAction action = WebKit.context_menu_item_get_action(item);
- if (action == WebKit.ContextMenuAction.SPELLING_GUESS) {
- suggestions = true;
- continue;
+ if (item.is_sensitive()) {
+ WebKit.ContextMenuAction action = WebKit.context_menu_item_get_action(item);
+ if (action == WebKit.ContextMenuAction.SPELLING_GUESS) {
+ suggestions = true;
+ continue;
+ }
+
+ if (action == WebKit.ContextMenuAction.IGNORE_SPELLING)
+ ignore_spelling = item;
+ else if (action == WebKit.ContextMenuAction.LEARN_SPELLING)
+ learn_spelling = item;
}
-
- if (action == WebKit.ContextMenuAction.IGNORE_SPELLING)
- ignore_spelling = item;
- else if (action == WebKit.ContextMenuAction.LEARN_SPELLING)
- learn_spelling = item;
context_menu.remove(child);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]