### 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 <sys/types.h>
#include <unistd.h>
#undef CursorShape
#include <X11/XKBlib.h>
#define WM_NormalState 1L  window normal state
#define WM_IconicState 3L  window minimized
#define _NET_WM_STATE_REMOVE 0L  remove/unset property
#define _NET_WM_STATE_ADD 1L  add/set property
#define XINPUT_CLIENT_VERSION_MAJOR 2
#define XINPUT_CLIENT_VERSION_MINOR 2
#define VALUATOR_ABSX 0
#define VALUATOR_ABSY 1
#define VALUATOR_PRESSURE 2
#define VALUATOR_TILTX 3
#define VALUATOR_TILTY 4
#ifdef DISPLAY_SERVER_X11_DEBUG_LOGS_ENABLED
#define DEBUG_LOG_X11(...) printf(__VA_ARGS__)
#else
#define DEBUG_LOG_X11(...)
#endif
static const double abs_resolution_mult = 10000.0;
static const double abs_resolution_range_mult = 10.0;
struct Hints {
	unsigned long flags = 0;
	unsigned long functions = 0;
	unsigned long decorations = 0;
	long inputMode = 0;
	unsigned long status = 0;
};
static String get_atom_name(Display *p_disp, Atom p_atom) {