Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window does not restore from minimization on Linux #525

Open
erflaber opened this issue Jan 22, 2025 · 0 comments
Open

Window does not restore from minimization on Linux #525

erflaber opened this issue Jan 22, 2025 · 0 comments

Comments

@erflaber
Copy link

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:

  1. Run the provided minimal program.
  2. Click the button to minimize the window.
  3. After the window minimizes, click on any other window (e.g., a terminal or browser).
  4. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant