Watch
1
0
Fork
You've already forked nexus
0
forked from Nexus/nexus

gate android branches of window_manager

This commit is contained in:
Henry Hiles 2026-10-22 17:31:43 -04:00
commit e0b5dc58d0
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 9 additions and 4 deletions

View file

@ -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);

View file

@ -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(