2.0 KiB
2.0 KiB
Old Patches
Patches that were once part of EnginePatch but are no longer needed.
Kept here for reference in case the underlying issue resurfaces.
LinuxWindow.cpp — force override_redirect for borderless child windows
Removed when the engine was upgraded to UE 5.7, which uses SDL3. SDL3 has
better Wayland support, so this workaround is believed to be unnecessary.
The original purpose was to make Unreal play better with Wayland: under
XWayland, non-override-redirect popup windows don't receive input events
from the compositor. SDL already sets override_redirect for tooltips and
popup menus, but other borderless child windows (notification popups,
dialogs) also needed it, so we temporarily enabled
SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT around the SDL_CreateWindow call.
--- Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxWindow.cpp.orig 2026-04-12 22:58:34.538334467 -0400
+++ Engine/Source/Runtime/ApplicationCore/Private/Linux/LinuxWindow.cpp 2026-04-12 22:48:15.848291098 -0400
@@ -235,7 +235,26 @@
// The SDL window doesn't need to be reshaped.
// the size of the window you input is the sizeof the client.
+
+ // Under XWayland, non-override-redirect popup windows don't receive input
+ // events from the compositor. SDL already sets override_redirect for
+ // tooltips and popup menus, but other borderless child windows (like
+ // notification popups and dialogs) also need it. We temporarily enable
+ // the SDL hint to force override_redirect for these windows.
+ bool bForceOverrideRedirect = !Definition->HasOSWindowBorder
+ && InParent.IsValid()
+ && !(WindowStyle & (SDL_WINDOW_TOOLTIP | SDL_WINDOW_POPUP_MENU));
+ if (bForceOverrideRedirect)
+ {
+ SDL_SetHint(SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT, "1");
+ }
+
HWnd = SDL_CreateWindow( TCHAR_TO_ANSI( *Definition->Title ), X, Y, ClientWidth, ClientHeight, WindowStyle );
+
+ if (bForceOverrideRedirect)
+ {
+ SDL_SetHint(SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT, "0");
+ }
// produce a helpful message for common driver errors
if (HWnd == nullptr)
{