mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
Try to fix #241
This commit is contained in:
@@ -503,10 +503,13 @@ mixin class _ReaderWindow {
|
|||||||
|
|
||||||
late WindowFrameController windowFrame;
|
late WindowFrameController windowFrame;
|
||||||
|
|
||||||
|
bool _isInit = false;
|
||||||
|
|
||||||
void initReaderWindow() {
|
void initReaderWindow() {
|
||||||
if (!App.isDesktop) return;
|
if (!App.isDesktop || _isInit) return;
|
||||||
windowFrame = WindowFrame.of(App.rootContext);
|
windowFrame = WindowFrame.of(App.rootContext);
|
||||||
windowFrame.addCloseListener(onWindowClose);
|
windowFrame.addCloseListener(onWindowClose);
|
||||||
|
_isInit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fullscreen() async {
|
void fullscreen() async {
|
||||||
@@ -519,8 +522,12 @@ mixin class _ReaderWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool onWindowClose() {
|
bool onWindowClose() {
|
||||||
App.rootContext.pop();
|
if (Navigator.of(App.rootContext).canPop()) {
|
||||||
|
Navigator.of(App.rootContext).pop();
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void disposeReaderWindow() {
|
void disposeReaderWindow() {
|
||||||
|
Reference in New Issue
Block a user