flet-dev / flet-dev/flet

page.window_visible not working correctly on MacOS

Open
#1,614 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug has reproducible steps has-upstream platform: macOS
Dominant language
Python
Stars
17k
Forks
694
Avg merge
1d 14h
Merged PRs (30d)
33

Description

I'm trying to make a window that becomes invisible for 1 sec when I click a button and then turns visible again. The code is super simple and it works perfectly on a Windows PC. But on MacOS it somehow doesn't work. The window disappears and doesn't show up again.

import flet as ft
import time

def main(page: ft.Page):

    def btn_click(e):
        page.window_visible = False
        page.update() 
        time.sleep(1)

        page.window_visible = True
        page.update()

    page.add(
            ft.ElevatedButton("Say hello!", on_click=btn_click),
        )

ft.app(target=main)

Flet version: 0.8.2
MacOS 13.4.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior on macOS 13.4.1 using the example in the issue, focusing on the btn_click handler and Flet 0.8.2. Done means the window becomes invisible for one second and then becomes visible again after the button is clicked, as it does on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.