gate android branches of window_manager
This commit is contained in:
parent
ffbf2722f7
commit
e0b5dc58d0
2 changed files with 9 additions and 4 deletions
|
|
@ -88,7 +88,8 @@ class UnifiedPushController extends AsyncNotifier<String?> {
|
||||||
|
|
||||||
if (notification == null ||
|
if (notification == null ||
|
||||||
(!isInBackground &&
|
(!isInBackground &&
|
||||||
(WindowManager.instance.getCurrent()?.isFocused ?? true) &&
|
(!Platform.isAndroid &&
|
||||||
|
(WindowManager.instance.getCurrent()?.isFocused ?? true)) &&
|
||||||
ref.read(SelectedRoomController.provider) ==
|
ref.read(SelectedRoomController.provider) ==
|
||||||
notification.roomId)) {
|
notification.roomId)) {
|
||||||
if (isInBackground) exit(0);
|
if (isInBackground) exit(0);
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ final class const Appbar({
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final isDesktop = !(Platform.isAndroid || Platform.isIOS);
|
||||||
|
|
||||||
void maximize() {
|
void maximize() {
|
||||||
final window = WindowManager.instance.getCurrent();
|
final window = WindowManager.instance.getCurrent();
|
||||||
if (window == null) return;
|
if (window == null) return;
|
||||||
|
|
@ -38,7 +40,7 @@ final class const Appbar({
|
||||||
onPanStart: ref
|
onPanStart: ref
|
||||||
.watch(SettingsController.provider)
|
.watch(SettingsController.provider)
|
||||||
.whenOrNull(
|
.whenOrNull(
|
||||||
data: (settings) => settings.linuxMobileMode
|
data: (settings) => !isDesktop || settings.linuxMobileMode
|
||||||
? null
|
? null
|
||||||
: (_) => WindowManager.instance.getCurrent()?.startDragging(),
|
: (_) => WindowManager.instance.getCurrent()?.startDragging(),
|
||||||
),
|
),
|
||||||
|
|
@ -51,10 +53,12 @@ final class const Appbar({
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: IgnorePointer(child: title),
|
child: IgnorePointer(child: title),
|
||||||
),
|
),
|
||||||
flexibleSpace: GestureDetector(onDoubleTap: maximize),
|
flexibleSpace: GestureDetector(
|
||||||
|
onDoubleTap: isDesktop ? maximize : null,
|
||||||
|
),
|
||||||
actions: [
|
actions: [
|
||||||
...actions,
|
...actions,
|
||||||
if (windowControls && !(Platform.isAndroid || Platform.isIOS)) ...[
|
if (windowControls && isDesktop) ...[
|
||||||
if (ref
|
if (ref
|
||||||
.watch(SettingsController.provider)
|
.watch(SettingsController.provider)
|
||||||
.whenOrNull(
|
.whenOrNull(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue