### Godot version

v4.2.dev.custom_build [16a93563b]

### System information

Godot v4.2.dev (16a93563b) - Linux Mint 21.2 (Victoria) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti (nvidia; 525.125.06) - Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 Threads)

### Issue description



https://github.com/godotengine/godot/assets/30386067/335cd974-1261-4c88-829c-159a771eaae3

When dragging the mouse in the inspector to modify a value, the editor would crash if the left mouse button was released.


```
ERROR: FATAL: DEV_ASSERT failed  "!root->gui.windowmanager_window_over" is false.
   at: _event_callback (scene/main/window.cpp:675)
```

<details><summary>Crash log</summary>

```
================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.2.dev.custom_build (16a93563bfd3b02ca0a8f6df2026f3a3217f5571)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f765fc42520] (??:0)
[2] Window::_event_callback(DisplayServer::WindowEvent) (/opt/godot/godot-editor-l10n/godot/scene/main/window.cpp:675)
[3] void call_with_variant_args_helper<Window, DisplayServer::WindowEvent, 0ul>(Window*, void (Window::*)(DisplayServer::WindowEvent), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:308)
[4] void call_with_variant_args<Window, DisplayServer::WindowEvent>(Window*, void (Window::*)(DisplayServer::WindowEvent), Variant const**, int, Callable::CallError&) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:418)
[5] CallableCustomMethodPointer<Window, DisplayServer::WindowEvent>::call(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/./core/object/callable_method_pointer.h:105)
[6] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/core/variant/callable.cpp:51)
[7] DisplayServerX11::_send_window_event(DisplayServerX11::WindowData const&, DisplayServer::WindowEvent) (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/x11/display_server_x11.cpp:3771)
[8] DisplayServerX11::mouse_set_mode(DisplayServer::MouseMode) (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/x11/display_server_x11.cpp:383)
[9] DisplayServer::_input_set_mouse_mode(Input::MouseMode) (/opt/godot/godot-editor-l10n/godot/servers/display_server.cpp:944)
[10] Input::set_mouse_mode(Input::MouseMode) (/opt/godot/godot-editor-l10n/godot/core/input/input.cpp:90)
[11] EditorSpinSlider::gui_input(Ref<InputEvent> const&) (/opt/godot/godot-editor-l10n/godot/editor/gui/editor_spin_slider.cpp:81)
[12] Control::_call_gui_input(Ref<InputEvent> const&) (/opt/godot/godot-editor-l10n/godot/scene/gui/control.cpp:1806)
[13] Viewport::_gui_call_input(Control*, Ref<InputEvent> const&) (/opt/godot/godot-editor-l10n/godot/scene/main/viewport.cpp:1562)
[14] Viewport::_gui_input_event(Ref<InputEvent>) (/opt/godot/godot-editor-l10n/godot/scene/main/viewport.cpp:1831)
[15] Viewport::push_input(Ref<InputEvent> const&, bool) (/opt/godot/godot-editor-l10n/godot/scene/main/viewport.cpp:3128)
[16] Window::_window_input(Ref<InputEvent> const&) (/opt/godot/godot-editor-l10n/godot/scene/main/window.cpp:1482)
[17] void call_with_variant_args_helper<Window, Ref<InputEvent> const&, 0ul>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, Callable::CallError&, IndexSequence<0ul>) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:303)
[18] void call_with_variant_args<Window, Ref<InputEvent> const&>(Window*, void (Window::*)(Ref<InputEvent> const&), Variant const**, int, Callable::CallError&) (/opt/godot/godot-editor-l10n/godot/./core/variant/binder_common.h:418)
[19] CallableCustomMethodPointer<Window, Ref<InputEvent> const&>::call(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/./core/object/callable_method_pointer.h:105)
[20] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (/opt/godot/godot-editor-l10n/godot/core/variant/callable.cpp:51)
[21] DisplayServerX11::_dispatch_input_event(Ref<InputEvent> const&) (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/x11/display_server_x11.cpp:3751)
[22] DisplayServerX11::_dispatch_input_events(Ref<InputEvent> const&) (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/x11/display_server_x11.cpp:3723)
[23] Input::_parse_input_event_impl(Ref<InputEvent> const&, bool) (/opt/godot/godot-editor-l10n/godot/core/input/input.cpp:721)
[24] Input::flush_buffered_events() (/opt/godot/godot-editor-l10n/godot/core/input/input.cpp:979)
[25] DisplayServerX11::process_events() (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/x11/display_server_x11.cpp:4819)
[26] OS_LinuxBSD::run() (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/os_linuxbsd.cpp:908)
[27] /opt/godot/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(main+0x1fe) [0x560f366a986e] (/opt/godot/godot-editor-l10n/godot/platform/linuxbsd/godot_linuxbsd.cpp:74)
[28] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f765fc29d90] (??:0)
[29] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f765fc29e40] (??:0)
[30] /opt/godot/godot/bin/godot.linuxbsd.editor.dev.x86_64.llvm(_start+0x25) [0x560f366a95a5] (??:?)
-- END OF BACKTRACE --
================================================================
```
</details> 

This seems to be a regression from #67791.

### Steps to reproduce

1. Click on the number field with the left mouse button;
2. Drag the mouse to change the value;
3. The editor will crash when the left mouse button is released.

### Minimal reproduction project

N/A
ERR_FAIL_COND(!windows.has(p_window));
	WindowData &wd = windows[p_window];
	if (p_enabled && !window_get_flag(WINDOW_FLAG_BORDERLESS, p_window)) {
		
		Hints hints;
		Atom property;
		hints.flags = 2;
		hints.decorations = 0;
		property = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True);
		if (property != None) {
			XChangeProperty(x11_display, wd.x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5);
		}
	}
	if (p_enabled) {
		
		_update_size_hints(p_window);
	}
	
	XEvent xev;
	Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False);
	Atom wm_fullscreen = XInternAtom(x11_display, "_NET_WM_STATE_FULLSCREEN", False);
	memset(&xev, 0, sizeof(xev));
	xev.type = ClientMessage;
	xev.xclient.window = wd.x11_window;
	xev.xclient.message_type = wm_state;
	xev.xclient.format = 32;
	xev.xclient.data.l[0] = p_enabled ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
	xev.xclient.data.l[1] = wm_fullscreen;
	xev.xclient.data.l[2] = 0;