дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 09:41:34 +02:00
Project tabs in a window group are now one native AppKit tab group behind the page's own tab bar, with AppKit's tab bar hidden. The group shares one frame and enters full screen as a whole, so every tab shows the system window buttons in the bar revealed with the menu bar, and tabs no longer lose their title bar layout after leaving full screen. This removes the full-screen auxiliary windows, the host handover on close, the frame copying between hidden members and the window buttons drawn by the page. The title bar releases the room kept for the window buttons in full screen. Linux and Windows keep showing one member at a time.
29 рядки
910 B
TypeScript
29 рядки
910 B
TypeScript
/**
|
|
* Whether this window fills the screen: native full screen, or a project tab shown in its
|
|
* group's full-screen Space. Native full screen moves the window buttons out of the title bar,
|
|
* so the room kept for them is released.
|
|
*/
|
|
import { useEffect, useState } from "react";
|
|
import { commands, isTauri, onIdeEvent } from "@/platform/ipc";
|
|
|
|
export function useFullscreen(): boolean {
|
|
const [fullscreen, setFullscreen] = useState(false);
|
|
useEffect(() => {
|
|
// The plain-browser shell and tests have no Tauri window to ask.
|
|
if (!isTauri()) return;
|
|
let disposed = false;
|
|
const sync = () =>
|
|
void commands
|
|
.windowIsFullscreen()
|
|
.then((on) => !disposed && setFullscreen(on))
|
|
.catch(() => {});
|
|
sync();
|
|
const off = onIdeEvent("windowFullscreenChanged", sync);
|
|
return () => {
|
|
disposed = true;
|
|
off();
|
|
};
|
|
}, []);
|
|
return fullscreen;
|
|
}
|