flet icon indicating copy to clipboard operation
flet copied to clipboard

Please note, it is a fatal bug! In versions 0.12.2 and 0.17.0 (and maybe all versions 0.12.2 to 0.17.0) when using did_mount, the window cannot be opened again after being minimized

Open gpt9796 opened this issue 1 year ago • 11 comments

Please note, it is a fatal bug! In versions 0.12.2 and 0.17.0 (and maybe all versions 0.12.2 to 0.17.0) when using did_mount, the window cannot be opened again after being minimized. But there is no such bug in versions 0.12.1 and below.

Code example to reproduce the issue:

import flet as ft
import time, threading

class Countdown(ft.UserControl):
    def __init__(self, seconds):
        super().__init__()
        self.seconds = seconds

    def did_mount(self):
        self.running = True
        self.th = threading.Thread(target=self.update_timer, args=(), daemon=True)
        self.th.start()

    def will_unmount(self):
        self.running = False

    def update_timer(self):
        while self.seconds and self.running:
            mins, secs = divmod(self.seconds, 60)
            self.countdown.value = "{:02d}:{:02d}".format(mins, secs)
            self.update()
            time.sleep(1)
            self.seconds -= 1

    def build(self):
        self.countdown = ft.Text()
        return self.countdown

def main(page: ft.Page):
    page.add(Countdown(120), Countdown(60))

ft.app(target=main)

Describe the results you received:

企业微信截图_1703483917131

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Flet version (pip show flet):

Name: flet
Version: 0.12.2
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page:
Author: Appveyor Systems Inc.
Author-email: [email protected]
License: Apache-2.0
Location: d:\b\code\python\novamss\venv-cpu\lib\site-packages
Requires: cookiecutter, flet-runtime, packaging, qrcode, watchdog, websocket-client, websockets
Required-by:

Operating system: Windows

Additional environment details:

gpt9796 avatar Dec 25 '23 06:12 gpt9796

unfortunately, this bug also applies to "clean" flet window, someone on discord mentioned this bug but unfortunately this error affects only a few people ( including me )

kacper-the-programmer avatar Dec 26 '23 21:12 kacper-the-programmer

unfortunately, this bug also applies to "clean" flet window, someone on discord mentioned this bug but unfortunately this error affects only a few people ( including me )

However, this bug is likely to affect all versions from 0.12.2 to 0.17.0. I think this is a very serious problem and I hope the author can pay attention to it. Because of this problem, I had to roll back from 0.17.0 to version 0.12.1

gpt9796 avatar Dec 27 '23 02:12 gpt9796

so maybe you could write about this bug on discord, maybe one of devs will fix it if you mention it again

kacper-the-programmer avatar Dec 27 '23 19:12 kacper-the-programmer

I also happend this trouble

fanxing2022 avatar Dec 28 '23 01:12 fanxing2022

so maybe you could write about this bug on discord, maybe one of devs will fix it if you mention it again

I have already written once on discard, but no one responded. I will continue to write.

gpt9796 avatar Dec 28 '23 08:12 gpt9796

I also happend this trouble

It seems that many people have encountered this problem

gpt9796 avatar Dec 28 '23 08:12 gpt9796

The only thing I know about this bug is that this bug is random ( sometimes it happens and sometimes it doesn't ) and that it only affects windows users

kacper-the-programmer avatar Dec 28 '23 12:12 kacper-the-programmer

The only thing I know about this bug is that this bug is random ( sometimes it happens and sometimes it doesn't ) and that it only affects windows users

The above code is directly copied from the flet document. this bug is always appear in my env.

gpt9796 avatar Dec 29 '23 08:12 gpt9796

Any updates on this issue? @FeodorFitsner It happens more and more frequently to me now.

Jorge-lopz avatar Feb 26 '24 09:02 Jorge-lopz

Any updates on this issue? @FeodorFitsner It happens more and more frequently to me now.

@FeodorFitsner Hi, Are you hava any idea of this bug? Looking forward to your reply!Thanks

gpt9796 avatar Mar 09 '24 09:03 gpt9796