Skip to content

Commit

Permalink
fix macos
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Oct 24, 2024
1 parent 6941468 commit 4dbdd00
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/platform_impl/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,13 @@ impl UnownedWindow {
let color = win_attribs
.background_color
.map(|(r, g, b, a)| {
NSColor::colorWithRed_green_blue_alpha_(r as f64, g as f64, b as f64, a as f64 / 255.0)
NSColor::colorWithRed_green_blue_alpha_(
nil,
r as f64,
g as f64,
b as f64,
a as f64 / 255.0,
)
})
.unwrap_or_else(|| NSColor::clearColor(nil));
ns_window.setBackgroundColor_(NSColor::clearColor(nil));
Expand Down Expand Up @@ -864,11 +870,11 @@ impl UnownedWindow {
pub fn set_background_color(&self, color: Option<crate::window::RGBA>) {
let color = color
.map(|(r, g, b, a)| {
NSColor::colorWithRed_green_blue_alpha_(r as f64, g as f64, b as f64, a as f64 / 255.0)
NSColor::colorWithRed_green_blue_alpha_(nil, r as f64, g as f64, b as f64, a as f64 / 255.0)
})
.or_else(|| {
.unwrap_or_else(|| {
if self.transparent {
Some(NSColor::clearColor(nil))
NSColor::clearColor(nil)
} else {
nil
}
Expand Down

0 comments on commit 4dbdd00

Please sign in to comment.