From 0456311be3ee2233a55b2a007c95e070a06dce3d Mon Sep 17 00:00:00 2001 From: Technohacker Date: Sun, 10 May 2020 19:19:35 +0530 Subject: [PATCH] Don't force borderless mode when using per-pixel transparency --- platform/osx/os_osx.mm | 4 ---- platform/windows/os_windows.cpp | 4 ---- platform/x11/os_x11.cpp | 4 ---- 3 files changed, 12 deletions(-) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 53fe11b3bb5c..df3e57e28294 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -2661,7 +2661,6 @@ static int get_screen_index(NSScreen *screen) { if (!is_layered_allowed()) return; if (layered_window != p_enabled) { if (p_enabled) { - set_borderless_window(true); GLint opacity = 0; [window_object setBackgroundColor:[NSColor clearColor]]; [window_object setOpaque:NO]; @@ -2691,9 +2690,6 @@ static int get_screen_index(NSScreen *screen) { if (p_borderless) { [window_object setStyleMask:NSWindowStyleMaskBorderless]; } else { - if (layered_window) - set_window_per_pixel_transparency_enabled(false); - [window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | (resizable ? NSWindowStyleMaskResizable : 0)]; // Force update of the window styles diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 40cee5d15f6f..a8c3551671c3 100755 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2210,7 +2210,6 @@ void OS_Windows::set_window_per_pixel_transparency_enabled(bool p_enabled) { if (!is_layered_allowed()) return; if (layered_window != p_enabled) { if (p_enabled) { - set_borderless_window(true); //enable per-pixel alpha DWM_BLURBEHIND bb = { 0 }; @@ -2239,9 +2238,6 @@ void OS_Windows::set_borderless_window(bool p_borderless) { if (video_mode.borderless_window == p_borderless) return; - if (!p_borderless && layered_window) - set_window_per_pixel_transparency_enabled(false); - video_mode.borderless_window = p_borderless; preserve_window_size = true; diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 2a1bdb6b8192..9b9d141f7ad5 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -964,7 +964,6 @@ void OS_X11::set_window_per_pixel_transparency_enabled(bool p_enabled) { if (!is_layered_allowed()) return; if (layered_window != p_enabled) { if (p_enabled) { - set_borderless_window(true); layered_window = true; } else { layered_window = false; @@ -1683,9 +1682,6 @@ void OS_X11::set_borderless_window(bool p_borderless) { if (get_borderless_window() == p_borderless) return; - if (!p_borderless && layered_window) - set_window_per_pixel_transparency_enabled(false); - current_videomode.borderless_window = p_borderless; Hints hints;