Commit 2a8be23d authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

gtk: fix entering of Option-foo symbols on the Mac

define GTK_NO_TEXT_INPUT_MOD_MASK in gtkprivate.h
and use it in the IM contexts, so Option-foo is no longer
filtered away.
parent d3df4678
......@@ -895,7 +895,7 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context,
(priv->in_hex_sequence && !hex_keyval &&
!is_hex_start && !is_hex_end && !is_escape && !is_backspace))
{
if (event->state & (GDK_MOD1_MASK | GDK_CONTROL_MASK) ||
if (event->state & GTK_NO_TEXT_INPUT_MOD_MASK ||
(priv->in_hex_sequence && priv->modifiers_dropped &&
(event->keyval == GDK_KEY_Return ||
event->keyval == GDK_KEY_ISO_Enter ||
......
......@@ -350,7 +350,7 @@ gtk_im_multicontext_filter_keypress (GtkIMContext *context,
if (slave)
return gtk_im_context_filter_keypress (slave, event);
else if (event->type == GDK_KEY_PRESS &&
(event->state & (GDK_MOD1_MASK | GDK_CONTROL_MASK)) == 0)
(event->state & GTK_NO_TEXT_INPUT_MOD_MASK) == 0)
{
gunichar ch;
......
......@@ -67,6 +67,16 @@ const gchar *_gtk_get_data_prefix ();
#define GTK_DEFAULT_ACCEL_MOD_MASK GDK_META_MASK
#endif
/* When any of these modifiers are active, a key
* event cannot produce a symbol, so should be
* skipped when handling text input
*/
#ifndef GDK_WINDOWING_QUARTZ
#define GTK_NO_TEXT_INPUT_MOD_MASK (GDK_MOD1_MASK | GDK_CONTROL_MASK)
#else
#define GTK_NO_TEXT_INPUT_MOD_MASK (GDK_MOD2_MASK | GDK_CONTROL_MASK)
#endif
gboolean _gtk_fnmatch (const char *pattern,
const char *string,
gboolean no_leading_period);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment