mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-06 21:53:11 +08:00
Improved fullscreen support
This commit is contained in:
parent
a737d85fa5
commit
32ba9e78fe
@ -430,10 +430,16 @@ void ToggleFullscreen(struct Application *app) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isFullScreen(struct Application *app) {
|
||||||
|
int mask = (int)msg(app->mainWindow, s("styleMask"));
|
||||||
|
bool result = (mask & NSWindowStyleMaskFullscreen) == NSWindowStyleMaskFullscreen;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// Fullscreen sets the main window to be fullscreen
|
// Fullscreen sets the main window to be fullscreen
|
||||||
void Fullscreen(struct Application *app) {
|
void Fullscreen(struct Application *app) {
|
||||||
Debug(app, "Fullscreen Called");
|
Debug(app, "Fullscreen Called");
|
||||||
if( app->fullscreen == 0) {
|
if( ! isFullScreen(app) ) {
|
||||||
ToggleFullscreen(app);
|
ToggleFullscreen(app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -441,7 +447,7 @@ void Fullscreen(struct Application *app) {
|
|||||||
// UnFullscreen resets the main window after a fullscreen
|
// UnFullscreen resets the main window after a fullscreen
|
||||||
void UnFullscreen(struct Application *app) {
|
void UnFullscreen(struct Application *app) {
|
||||||
Debug(app, "UnFullscreen Called");
|
Debug(app, "UnFullscreen Called");
|
||||||
if( app->fullscreen == 1) {
|
if( isFullScreen(app) ) {
|
||||||
ToggleFullscreen(app);
|
ToggleFullscreen(app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user