Skip to content

Commit

Permalink
Add xdg activation token on x11 and wayland
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex committed Jun 7, 2024
1 parent 676a594 commit ab14cc9
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions neothesia/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ impl ApplicationHandler<NeothesiaEvent> for NeothesiaBootstrap {
return;
}

let attributes = winit::window::Window::default_attributes()
let mut attributes = winit::window::Window::default_attributes()
.with_inner_size(winit::dpi::LogicalSize {
width: 1080.0,
height: 720.0,
Expand All @@ -260,9 +260,20 @@ impl ApplicationHandler<NeothesiaEvent> for NeothesiaBootstrap {
.with_theme(Some(winit::window::Theme::Dark));

#[cfg(all(unix, not(apple)))]
let attributes = {
use winit::platform::wayland::WindowAttributesExtWayland;
attributes.with_name("com.github.polymeilex.neothesia", "main")
{
use winit::platform::{
startup_notify::{
self, EventLoopExtStartupNotify, WindowAttributesExtStartupNotify,
},
wayland::WindowAttributesExtWayland,
};

if let Some(token) = event_loop.read_token_from_env() {

Check failure on line 271 in neothesia/src/main.rs

View workflow job for this annotation

GitHub Actions / build_macos

no method named `read_token_from_env` found for reference `&ActiveEventLoop` in the current scope
startup_notify::reset_activation_token_env();
attributes = attributes.with_activation_token(token);

Check failure on line 273 in neothesia/src/main.rs

View workflow job for this annotation

GitHub Actions / build_macos

no method named `with_activation_token` found for struct `WindowAttributes` in the current scope
}

attributes = attributes.with_name("com.github.polymeilex.neothesia", "main");

Check failure on line 276 in neothesia/src/main.rs

View workflow job for this annotation

GitHub Actions / build_macos

no method named `with_name` found for struct `WindowAttributes` in the current scope
};

let window = event_loop.create_window(attributes).unwrap();
Expand Down

0 comments on commit ab14cc9

Please sign in to comment.