Skip to content

MacosWindowUtilsConfig breaks native macOS double-click-to-maximize behavior on latest macOS #589

Description

@albe-jj

Description

When applying any MacosWindowUtilsConfig (via macos_ui), the native macOS double-click-to-zoom functionality on the window titlebar stops working. This occurs with all NSWindowToolbarStyle options (unifiedCompact, unified, automatic, expanded), not just specific ones.

This issue only occurs on macOS 26.2 (Tahoe) - the double-click maximize works correctly on previous macOS versions.

The green maximize button still works correctly - only the double-click gesture is broken. with no MacosWindowUtilsConfig also it works correctly.

Steps To Reproduce

  1. Create a new Flutter macOS project with flutter create bug
  2. Add macos_ui dependency with flutter pub add macos_ui
  3. Update main.dart with the code sample below
  4. Run the app on macOS with flutter run -d macos
  5. Double-click on the window titlebar (the area at the top of the window)
  6. Observe that the window does NOT zoom/maximize
Code sample
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:macos_ui/macos_ui.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  if (Platform.isMacOS) {
    // Applying ANY MacosWindowUtilsConfig breaks double-click maximize
    const config = MacosWindowUtilsConfig(
      toolbarStyle: NSWindowToolbarStyle.unifiedCompact,
      // Also broken with: unified, automatic, expanded
    );
    await config.apply();
  }

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Double-Click Bug Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Double-Click Titlebar Bug'),
        ),
        body: const Center(
          child: Padding(
            padding: EdgeInsets.all(24.0),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(
                  'Try double-clicking the window titlebar.',
                  style: TextStyle(fontSize: 18),
                ),
                SizedBox(height: 16),
                Text(
                  'Expected: Window should zoom/maximize\n'
                  'Actual: Nothing happens',
                  textAlign: TextAlign.center,
                ),
                SizedBox(height: 24),
                Text(
                  'Note: The green maximize button still works.\n'
                  'Only the double-click gesture is broken.',
                  style: TextStyle(color: Colors.grey),
                  textAlign: TextAlign.center,
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Expected behavior

Double-clicking the window titlebar should zoom/maximize the window, which is standard macOS behavior that users expect.

Screenshots

N/A - The bug is that nothing visually happens when double-clicking the titlebar.

Logs

Logs

No errors are logged. The double-click event is simply not triggering the zoom action.

flutter run --verbose output:
(No relevant errors - the app runs normally, just the double-click gesture doesn't work)
flutter analyze output:
(No issues found)
flutter doctor -v output:
(Please run and paste your output here)

Additional Context

  • macOS version: 26.2 (Tahoe) - issue does NOT occur on previous macOS versions
  • macos_ui version: 2.2.2
  • macos_window_utils version: 1.9.1 (transitive dependency)

This issue may be related to the changes in version 2.2.1 combined with changes in macOS 26.2:

"Wrap toolbar items with MacosToolbarPassthrough to prevent window move or resize when interacting with toolbar items"

Workaround

Remove MacosWindowUtilsConfig entirely to restore native double-click behavior:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  // Don't apply MacosWindowUtilsConfig
  runApp(const MyApp());
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions