5 Commits

Author SHA1 Message Date
3554747a67 Fix window dragging when not supported by Wayland compositor
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
2025-02-02 18:36:03 +02:00
62968dd437 Show current display server in Editor window tooltip 2025-02-02 18:34:47 +02:00
c660fac524 Properly mark floating windows with transparency support 2025-02-02 13:38:15 +02:00
431a69e357 Enable transparency support in Vulkan swapchains 2025-02-01 22:31:50 +02:00
f4fcc07288 Fix compilation for game builds
Some checks failed
Build Android / Game (Android, Release ARM64) (push) Has been cancelled
Build iOS / Game (iOS, Release ARM64) (push) Has been cancelled
Build Linux / Editor (Linux, Development x64) (push) Has been cancelled
Build Linux / Game (Linux, Release x64) (push) Has been cancelled
Build macOS / Editor (Mac, Development ARM64) (push) Has been cancelled
Build macOS / Game (Mac, Release ARM64) (push) Has been cancelled
Build Windows / Editor (Windows, Development x64) (push) Has been cancelled
Build Windows / Game (Windows, Release x64) (push) Has been cancelled
Cooker / Cook (Mac) (push) Has been cancelled
Tests / Tests (Linux) (push) Has been cancelled
Tests / Tests (Windows) (push) Has been cancelled
2025-01-29 16:17:27 +02:00
12 changed files with 44 additions and 9 deletions

View File

@@ -75,7 +75,7 @@ namespace FlaxEditor.GUI.Docking
settings.MaximumSize = Float2.Zero; // Unlimited size
settings.Fullscreen = false;
settings.HasBorder = true;
settings.SupportsTransparency = false;
settings.SupportsTransparency = true;
settings.ActivateWhenFirstShown = true;
settings.AllowInput = true;
settings.AllowMinimize = true;

View File

@@ -84,13 +84,15 @@ namespace FlaxEditor.GUI
ScriptsBuilder.GetBinariesConfiguration(out _, out _, out _, out var configuration);
var driver = Platform.DisplayServer;
_icon = new Image
{
Margin = new Margin(6, 6, 6, 6),
Brush = new TextureBrush(windowIcon),
Color = Style.Current.Foreground,
KeepAspectRatio = false,
TooltipText = string.Format("{0}\nVersion {1}\nConfiguration {3}\nGraphics {2}", _window.Title, Globals.EngineVersion, GPUDevice.Instance.RendererType, configuration),
TooltipText = string.Format("{0}\nVersion {1}\nConfiguration {3}\nGraphics {2} {4}", _window.Title, Globals.EngineVersion, GPUDevice.Instance.RendererType, configuration, driver),
Parent = this,
};

View File

@@ -374,7 +374,9 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height)
swapChainInfo.presentMode = presentMode;
swapChainInfo.clipped = VK_TRUE;
swapChainInfo.compositeAlpha = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR;
if (surfProperties.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR)
if (_window->GetSettings().SupportsTransparency && surfProperties.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR)
swapChainInfo.compositeAlpha = VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR;
else if (surfProperties.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR)
swapChainInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
// Create swap chain

View File

@@ -249,6 +249,15 @@ PlatformType PlatformBase::GetPlatformType()
return PLATFORM_TYPE;
}
#if !PLATFORM_SDL
String PlatformBase::GetDisplayServer()
{
return String::Empty;
}
#endif
bool PlatformBase::Is64BitApp()
{
#if PLATFORM_64BITS

View File

@@ -345,6 +345,11 @@ public:
/// </summary>
API_PROPERTY() static PlatformType GetPlatformType();
/// <summary>
/// Returns the display server name on Linux.
/// </summary>
API_PROPERTY() static String GetDisplayServer() = delete;
/// <summary>
/// Returns true if is running 64 bit application (otherwise 32 bit). It's compile-time constant.
/// </summary>

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
#if USE_EDITOR && PLATFORM_LINUX
#if PLATFORM_LINUX
#include "Engine/Platform/Types.h"
#include "Engine/Platform/ScreenUtilities.h"

View File

@@ -2,7 +2,7 @@
#pragma once
#if USE_EDITOR && PLATFORM_LINUX
#if PLATFORM_LINUX
#include "Engine/Platform/Base/ScreenUtilitiesBase.h"
#include "Engine/Core/Types/BaseTypes.h"

View File

@@ -310,7 +310,7 @@ namespace WaylandImpl
LOG(Warning, "wl_display_roundtrip_queue failed, errno: {}", errno);
// Wait until window has showed up
if (wrappedToplevel == nullptr && dragWindow && Platform::AtomicRead(&WaitFlag) != 0)
if (DragManager != nullptr && wrappedToplevel == nullptr && dragWindow && Platform::AtomicRead(&WaitFlag) != 0)
{
auto toplevel = static_cast<xdg_toplevel*>(SDL_GetPointerProperty(SDL_GetWindowProperties(draggedWindow), SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, nullptr));
if (toplevel != nullptr)
@@ -1431,7 +1431,11 @@ DragDropEffect SDLWindow::DoDragDrop(const StringView& data, const Float2& offse
else
SDL_ShowWindow(_window);
}
WindowBase::Show();
// Only show the window if toplevel dragging is supported
if (WaylandImpl::DragManager != nullptr)
WindowBase::Show();
else
Hide();
WaylandImpl::DraggingWindow = true;
DoDragDropWayland(String(""), dragSourceWindow, dragOffset);

View File

@@ -166,6 +166,18 @@ bool SDLPlatform::HandleEvent(SDL_Event& event)
return true;
}
String SDLPlatform::GetDisplayServer()
{
#if PLATFORM_LINUX
String driver(SDL_GetCurrentVideoDriver());
if (driver.Length() > 0)
driver[0] = StringUtils::ToUpper(driver[0]);
return driver;
#else
return String::Empty;
#endif
}
BatteryInfo SDLPlatform::GetBatteryInfo()
{
BatteryInfo info;

View File

@@ -63,6 +63,7 @@ public:
static bool Init();
static void LogInfo();
static void Tick();
static String GetDisplayServer();
static void SetHighDpiAwarenessEnabled(bool enable);
static BatteryInfo GetBatteryInfo();
static int32 GetDpi();

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
#if USE_EDITOR && PLATFORM_WINDOWS
#if PLATFORM_WINDOWS
#include "Engine/Platform/Types.h"
#include "Engine/Platform/ScreenUtilities.h"

View File

@@ -2,7 +2,7 @@
#pragma once
#if USE_EDITOR && PLATFORM_WINDOWS
#if PLATFORM_WINDOWS
#include "Engine/Platform/Base/ScreenUtilitiesBase.h"
#include "Engine/Core/Types/BaseTypes.h"