### Godot version

4.1.1-1

### System information

Godot v4.1.1.stable unknown - Arch Linux #1 SMP PREEMPT_DYNAMIC Thu, 21 Sep 2023 11:06:39 +0000 - Vulkan (Forward+) - dedicated AMD Radeon RX 460 Graphics () - Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 Threads)

### Issue description

After switching to ibus-anthy (Japanese IME, version 1.5.14-2), the entire Godot window stops responding to any keypress. This happened on both Godot editor and Godot projects/games.
Mouse clicks are still working. Keypress on Godot's dialog (like the dialog for closing confirmation) are also working (it looks like it only affect one window).

This problem doesn't appear when using ibus-rime (Chinese) and ibus-hangul (Korean).

There are some logs I'm able to capture when running Godot from the terminal:
```
ERROR: Caller thread can't call this function in this node (/root). Use call_deferred() or call_thread_group() instead.
   at: propagate_notification (scene/main/node.cpp:2208)
ERROR: Caller thread can't call this function in this node (/root). Use call_deferred() or call_thread_group() instead.
   at: propagate_notification (scene/main/node.cpp:2208)
ERROR: Caller thread can't call this function in this node (/root). Use call_deferred() or call_thread_group() instead.
   at: propagate_notification (scene/main/node.cpp:2208)
```



### Steps to reproduce

https://github.com/godotengine/godot/assets/45139213/5eefadc2-3107-4181-8521-f177849fc8ea

1. Go to a text box in Godot
2. Change IME to ibus-anthy
3. Type anything
4. Godot stop responding to any shortcut and input keys

### Minimal reproduction project

N/A
#include "display_server_x11.h"
#ifdef X11_ENABLED
#include "x11/detect_prime_x11.h"
#include "x11/key_mapping_x11.h"
#include "core/config/project_settings.h"
#include "core/math/math_funcs.h"
#include "core/string/print_string.h"
#include "core/string/ustring.h"
#include "drivers/png/png_driver_common.h"
#include "main/main.h"
#include "scene/resources/atlas_texture.h"
#if defined(VULKAN_ENABLED)
#include "servers/rendering/renderer_rd/renderer_compositor_rd.h"
#endif
#if defined(GLES3_ENABLED)
#include "drivers/gles3/rasterizer_gles3.h"
#endif
#include <dlfcn.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>