From e4eaeb74e580cbdc2949f3b1457ac6721cc56628 Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Thu, 14 Mar 2024 19:59:31 +0900 Subject: [PATCH] src/ibusengine: Identify SUPER_MASK in GTK4 with MOD4_MASK GTK4 now returns IBUS_SUPER_MASK for Super modifier key while others returns IBUS_MOD4_MASK. Now IBusEngine checks both modifier for Emoji and Unicode shortcut keys. BUG=https://github.com/ibus/ibus/issues/2607 --- src/ibusengine.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ibusengine.c b/src/ibusengine.c index 321a58a16..2380093f0 100644 --- a/src/ibusengine.c +++ b/src/ibusengine.c @@ -2,7 +2,7 @@ /* vim:set et sts=4: */ /* ibus - The Input Bus * Copyright (C) 2008-2013 Peng Huang - * Copyright (C) 2018-2023 Takao Fujiwara + * Copyright (C) 2018-2024 Takao Fujiwara * Copyright (C) 2008-2021 Red Hat, Inc. * * This library is free software; you can redistribute it and/or @@ -317,10 +317,7 @@ static const guint IBUS_MODIFIER_FILTER = IBUS_BUTTON2_MASK | IBUS_BUTTON3_MASK | IBUS_BUTTON4_MASK | - IBUS_BUTTON5_MASK | - IBUS_SUPER_MASK | - IBUS_HYPER_MASK | - IBUS_META_MASK); + IBUS_BUTTON5_MASK); static void ibus_engine_class_init (IBusEngineClass *class) @@ -1133,6 +1130,10 @@ ibus_engine_filter_key_event (IBusEngine *engine, for (; keys; keys++) { if (keys->keyval == 0 && keys->keycode == 0 && keys->state == 0) break; + if ((keys->state != modifiers) && (keys->state & IBUS_MOD4_MASK)) { + keys->state &= ~IBUS_MOD4_MASK; + keys->state |= IBUS_SUPER_MASK; + } if (keys->keyval == keyval && keys->state == modifiers && (keys->keycode == 0 || keys->keycode == keycode)) {