Skip to content

Commit 7e3fe31

Browse files
committed
fix: fix compiling on non-windows os
1 parent 7bd21de commit 7e3fe31

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎player/src/gui.rs‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,17 @@ impl MainWindow {
213213
val.powf(3.) as f32
214214
}
215215

216+
#[cfg(not(target_os = "windows"))]
216217
pub fn fix_taskbar_after_show(&mut self) {
217218
// TODO: implement on other platforms? lmao
219+
}
220+
#[cfg(target_os = "windows")]
221+
pub fn fix_taskbar_after_show(&mut self) {
218222
unsafe {
219223
shitty_windows_only_hack(&mut self.main_win);
220224
}
221225
}
226+
222227
pub fn add_bar(
223228
win: &mut DoubleWindow,
224229
s: Sender<UIEvent>,
@@ -564,17 +569,19 @@ impl MarqueeLabel {
564569
false
565570
}
566571
}
567-
568572
}
569573
}
570574

575+
#[cfg(target_os = "windows")]
571576
use winapi::shared::windef::HWND;
572577

578+
#[cfg(target_os = "windows")]
573579
use winapi::um::winuser::{
574580
GetWindowLongPtrW, SetWindowLongPtrW, ShowWindow, GWL_EXSTYLE, SW_HIDE, SW_SHOW,
575581
};
576582

577583
// this is fucking cursed
584+
#[cfg(target_os = "windows")]
578585
unsafe fn shitty_windows_only_hack(w: &mut DoubleWindow) {
579586
let handle: HWND = std::mem::transmute(w.raw_handle());
580587
ShowWindow(handle, SW_HIDE);

0 commit comments

Comments
 (0)