window_manager
window_manager copied to clipboard
Window does not restore from minimization on Linux
Description:
On Linux (X11), when a window is minimized and another window is clicked afterward, the original window fails to restore with windowManager.restore().
Steps to Reproduce:
- Run the provided minimal program.
- Click the button to minimize the window.
- After the window minimizes, click on any other window (e.g., a terminal or browser).
- Observe that the original window does not restore after 3 seconds.
Expected Behavior:
The window should restore from minimization, regardless of whether another window was clicked during the minimization.
Actual Behavior:
The window does not restore if another window is clicked during the minimization.
Minimal Reproducible Code:
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:window_manager/window_manager.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await windowManager.ensureInitialized();
WindowOptions windowOptions = const WindowOptions(
title: "Window Controller",
size: Size(600, 400),
center: true,
);
await windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
await windowManager.focus();
});
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Window Controller')),
body: Center(
child: ElevatedButton(
onPressed: () {
windowManager.minimize();
Timer(const Duration(seconds: 3), () => windowManager.restore());
},
child: const Text('Minimize & Restore'),
),
),
),
);
}
}
System Information:
- OS: Linux Mint 22.1
- Display Server: X11
- Graphics Environment: Cinnamon 6.4.6
- window_manager version: ^0.4.3
Additional Notes:
If no other window is clicked during the minimization, the window restores correctly after 3 seconds.