From 94664ff6876cd0943a076763154d82cba0fa7d31 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sat, 27 Apr 2024 15:41:14 +0200 Subject: [PATCH] Don't set the background color when initializing with transparency (#3657) Setting the background color changes how the window title bar appears, which is something that the application should customize itself if it wants this behaviour (and also, it wasn't set when calling `set_transparent`, so the behaviour wasn't consistent). --- Cargo.toml | 1 - src/changelog/unreleased.md | 1 + src/platform_impl/macos/window_delegate.rs | 3 +-- src/window.rs | 2 ++ 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a2b1f4d84b..7a70c5721e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -137,7 +137,6 @@ features = [ "NSApplication", "NSBitmapImageRep", "NSButton", - "NSColor", "NSControl", "NSCursor", "NSDragging", diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index bf13c588c7..7607dfdcb8 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -260,3 +260,4 @@ changelog entry. - On Wayland, fix decoration glitch on close with some compositors. - On Android, fix a regression introduced in #2748 to allow volume key events to be received again. - On Windows, don't return a valid window handle outside of the GUI thread. +- On macOS, don't set the background color when initializing a window with transparency. diff --git a/src/platform_impl/macos/window_delegate.rs b/src/platform_impl/macos/window_delegate.rs index 7e48df075f..b9e51a01ab 100644 --- a/src/platform_impl/macos/window_delegate.rs +++ b/src/platform_impl/macos/window_delegate.rs @@ -12,7 +12,7 @@ use objc2::{ }; use objc2_app_kit::{ NSAppKitVersionNumber, NSAppKitVersionNumber10_12, NSAppearance, NSApplication, - NSApplicationPresentationOptions, NSBackingStoreType, NSColor, NSDraggingDestination, + NSApplicationPresentationOptions, NSBackingStoreType, NSDraggingDestination, NSFilenamesPboardType, NSPasteboard, NSRequestUserAttentionType, NSScreen, NSView, NSWindowButton, NSWindowDelegate, NSWindowFullScreenButton, NSWindowLevel, NSWindowOcclusionState, NSWindowOrderingMode, NSWindowSharingType, NSWindowStyleMask, @@ -605,7 +605,6 @@ fn new_window(attrs: &WindowAttributes, mtm: MainThreadMarker) -> Option