From 150191353fd960bbd562a9c5890760cf15216c3d Mon Sep 17 00:00:00 2001 From: Hilderin <81109165+Hilderin@users.noreply.github.com> Date: Sat, 1 Feb 2025 21:08:39 -0500 Subject: [PATCH] Fix Floating Window not visible after restore on KDE --- editor/window_wrapper.cpp | 5 +++++ platform/linuxbsd/x11/display_server_x11.cpp | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/editor/window_wrapper.cpp b/editor/window_wrapper.cpp index a680dd79c67..4d82df70db9 100644 --- a/editor/window_wrapper.cpp +++ b/editor/window_wrapper.cpp @@ -261,6 +261,11 @@ void WindowWrapper::restore_window_from_saved_position(const Rect2 p_window_rect window_rect = Rect2i(window_rect.position * screen_ratio, window_rect.size * screen_ratio); window_rect.position += real_screen_rect.position; + // Make sure to restore the window if the user minimized it the last time it was displayed. + if (window->get_mode() == Window::MODE_MINIMIZED) { + window->set_mode(Window::MODE_WINDOWED); + } + // All good, restore the window. window->set_current_screen(p_screen); if (window->is_visible()) { diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index cbd3662986c..e73cb4376dd 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -4727,6 +4727,13 @@ void DisplayServerX11::process_events() { // Have we failed to set fullscreen while the window was unmapped? _validate_mode_on_map(window_id); + + // On KDE Plasma, when the parent window of an embedded process is restored after being minimized, + // only the embedded window receives the Map notification, causing it to + // appear without its parent. + if (wd.embed_parent) { + XMapWindow(x11_display, wd.embed_parent); + } } break; case Expose: {