Revert "fix up macOS fullscreen mode (kinda)"

This reverts commit 983a4b6d93.
This commit is contained in:
maxichrome
2022-05-11 12:53:46 -05:00
parent 983a4b6d93
commit d02fc9400a
2 changed files with 11 additions and 16 deletions

View File

@@ -2,15 +2,15 @@ use tauri::{GlobalWindowEvent, Runtime, Window, Wry};
pub(crate) fn handle_window_event(event: GlobalWindowEvent<Wry>) {
match event.event() {
tauri::WindowEvent::Focused(_focus) => {
// let fullscreen = event.window().is_fullscreen().unwrap_or(false);
tauri::WindowEvent::Resized(_size) => {
let fullscreen = event.window().is_fullscreen().unwrap_or(false);
// println!("fullscreen, {}", fullscreen);
println!("fullscreen, {}", fullscreen);
// #[cfg(target_os = "macos")]
// event
// .window()
// .set_transparent_titlebar(!fullscreen, !fullscreen);
#[cfg(target_os = "macos")]
event
.window()
.set_transparent_titlebar(!fullscreen, !fullscreen);
}
_ => {}
}
@@ -56,15 +56,10 @@ impl<R: Runtime> WindowExt for Window<R> {
let id = self.ns_window().unwrap() as cocoa::base::id;
let mut style_mask = id.styleMask();
// println!("existing style mask, {:#?}", style_mask);
style_mask.set(
NSWindowStyleMask::NSFullSizeContentViewWindowMask,
transparent,
);
style_mask.set(
NSWindowStyleMask::NSTexturedBackgroundWindowMask,
transparent,
);
style_mask.set(
NSWindowStyleMask::NSUnifiedTitleAndToolbarWindowMask,
transparent && large,

View File

@@ -36,6 +36,7 @@ import ExperimentalSettings from './screens/settings/ExperimentalSettings';
import { TagScreen } from './screens/Tag';
const queryClient = new QueryClient();
export const AppPropsContext = React.createContext<AppProps | null>(null);
@@ -61,10 +62,9 @@ function AppLayout() {
const [hasWindowBorder, setHasWindowBorder] = useState(true);
useEffect(() => {
// no longer need this with our window mask fixes
// if (appPropsContext?.platform === 'macOS') {
// setIsWindowRounded(false);
// }
if (appPropsContext?.platform === 'macOS') {
setIsWindowRounded(true);
}
if (appPropsContext?.platform === 'browser') {
setHasWindowBorder(false);
}