Skip to content

Commit f23d196

Browse files
committed
Merge pull request #106247 from bruvzg/ac_wl_resize
Do not call `accessibility_set_window_rect` on Wayland, fix main windows accessibility context creation.
2 parents a377f50 + 5441a82 commit f23d196

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

platform/linuxbsd/wayland/display_server_wayland.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,6 +2074,16 @@ DisplayServerWayland::DisplayServerWayland(const String &p_rendering_driver, Win
20742074
wd.rect.size = p_resolution;
20752075
wd.title = "Godot";
20762076

2077+
#ifdef ACCESSKIT_ENABLED
2078+
if (accessibility_driver && !accessibility_driver->window_create(wd.id, nullptr)) {
2079+
if (OS::get_singleton()->is_stdout_verbose()) {
2080+
ERR_PRINT("Can't create an accessibility adapter for window, accessibility support disabled!");
2081+
}
2082+
memdelete(accessibility_driver);
2083+
accessibility_driver = nullptr;
2084+
}
2085+
#endif
2086+
20772087
show_window(MAIN_WINDOW_ID);
20782088

20792089
#ifdef RD_ENABLED

scene/main/window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ void Window::_rect_changed_callback(const Rect2i &p_callback) {
761761
size = p_callback.size;
762762
_update_viewport_size();
763763
}
764-
if (window_id != DisplayServer::INVALID_WINDOW_ID) {
764+
if (window_id != DisplayServer::INVALID_WINDOW_ID && !DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SELF_FITTING_WINDOWS)) {
765765
Vector2 sz_out = DisplayServer::get_singleton()->window_get_size_with_decorations(window_id);
766766
Vector2 pos_out = DisplayServer::get_singleton()->window_get_position_with_decorations(window_id);
767767
Vector2 sz_in = DisplayServer::get_singleton()->window_get_size(window_id);

0 commit comments

Comments
 (0)