wayland native
All checks were successful
Build project / Build (push) Successful in 1m33s

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2026-03-28 15:14:18 +02:00
parent 17ee1db583
commit 5656d3d424
2 changed files with 17 additions and 16 deletions

View File

@@ -52,10 +52,11 @@
isDarwin = pkgs.stdenv.isDarwin; isDarwin = pkgs.stdenv.isDarwin;
x11Libs = with pkgs; [ x11Libs = with pkgs; [
libX11 wayland
libXcursor #libX11
libXi #libXcursor
libXrandr #libXi
#libXrandr
libxkbcommon libxkbcommon
]; ];

View File

@@ -7,8 +7,10 @@ use std::{
use anyhow::{Result, anyhow}; use anyhow::{Result, anyhow};
use macroquad::{ use macroquad::{
color::*, color::*,
miniquad::{error, info}, miniquad::{
window::set_fullscreen, conf::LinuxBackend,
error, info,
},
}; };
use midly::Smf; use midly::Smf;
use serialport::SerialPortType; use serialport::SerialPortType;
@@ -173,8 +175,6 @@ struct App {
tx: Sender<SerialCommand>, tx: Sender<SerialCommand>,
rx: Receiver<SerialStatus>, rx: Receiver<SerialStatus>,
connected: Option<String>, connected: Option<String>,
startup_time: f64,
fullscreen_set: bool,
} }
impl App { impl App {
@@ -187,8 +187,6 @@ impl App {
tx: tx_cmd, tx: tx_cmd,
rx: rx_status, rx: rx_status,
connected: None, connected: None,
startup_time: macroquad::time::get_time(),
fullscreen_set: false,
} }
} }
@@ -253,11 +251,6 @@ impl App {
} }
async fn update(&mut self) { async fn update(&mut self) {
if !self.fullscreen_set && macroquad::time::get_time() - self.startup_time >= 1.0 {
set_fullscreen(true);
self.fullscreen_set = true;
}
match self.rx.recv_timeout(Duration::from_millis(100)) { match self.rx.recv_timeout(Duration::from_millis(100)) {
Ok(status) => match status { Ok(status) => match status {
SerialStatus::SerialDisconnected => self.connected = None, SerialStatus::SerialDisconnected => self.connected = None,
@@ -292,7 +285,14 @@ impl App {
} }
} }
#[macroquad::main("singer")] fn window_conf() -> macroquad::prelude::Conf {
let mut conf = macroquad::prelude::Conf::default();
conf.fullscreen = true;
conf.platform.linux_backend = LinuxBackend::WaylandWithX11Fallback;
conf
}
#[macroquad::main(window_conf)]
async fn main() { async fn main() {
let mut app = App::new(); let mut app = App::new();
app.run().await; app.run().await;