Skip to content

windowManager.setClosable(false) not working on Linux #563

@sgaabdu4

Description

@sgaabdu4

Bug Description

The setClosable(false) method does not work on Linux platforms. When called, it has no effect and users can still close the window using the window manager's close button.

Environment

  • Operating System: Linux (Ubuntu 22.04)
  • Flutter Version: 3.29.3
  • window_manager Version: ^0.5.1

Steps to Reproduce

  1. Create a Flutter desktop app for Linux
  2. Add window_manager dependency
  3. Call await windowManager.setClosable(false) in your initialization code
  4. Run the app on Linux
  5. Try to close the window using the X button in the title bar

Expected Behavior

The window should not be closable when setClosable(false) is called. The close button should be disabled or the close action should be prevented.

Actual Behavior

The window remains closable despite calling setClosable(false). The close button remains active and functional (works on Windows)

Code Sample

import 'package:window_manager/window_manager.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await windowManager.ensureInitialized();
  
  WindowOptions windowOptions = WindowOptions(
    size: Size(800, 600),
    center: true,
  );
  
  windowManager.waitUntilReadyToShow(windowOptions, () async {
    await windowManager.show();
    await windowManager.focus();
    await windowManager.setClosable(false); // This doesn't work on Linux
  });
  
  runApp(MyApp());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions