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).
This commit is contained in:
Mads Marquart
2024-04-27 15:41:14 +02:00
committed by GitHub
parent 0fc8c37721
commit 94664ff687
4 changed files with 4 additions and 3 deletions

View File

@@ -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<Id<Wini
if attrs.transparent {
window.setOpaque(false);
window.setBackgroundColor(Some(unsafe { &NSColor::clearColor() }));
}
// register for drag and drop operations.