Skip to content

Commit

Permalink
desktop: Make the title bar transparent on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Jun 26, 2022
1 parent 1f8c873 commit 5b234f6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions flux-desktop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use glutin::window::Window;
use glutin::PossiblyCurrent;
use std::rc::Rc;

#[cfg(target_os = "macos")]
use glutin::platform::macos::WindowBuilderExtMacOS;

fn main() {
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("debug")).init();

Expand Down Expand Up @@ -106,11 +109,23 @@ pub fn get_rendering_context(
EventLoop<()>,
) {
let event_loop = glutin::event_loop::EventLoop::new();

#[cfg(not(target_os = "macos"))]
let window_builder = glutin::window::WindowBuilder::new()
.with_title("Flux")
.with_decorations(true)
.with_resizable(true)
.with_inner_size(logical_size);

#[cfg(target_os = "macos")]
let window_builder = glutin::window::WindowBuilder::new()
.with_title("Flux")
.with_inner_size(logical_size)
.with_resizable(true)
.with_title_hidden(true)
.with_titlebar_transparent(true)
.with_fullsize_content_view(true);

let window = glutin::ContextBuilder::new()
.with_vsync(true)
.with_multisampling(0)
Expand Down

0 comments on commit 5b234f6

Please sign in to comment.