-
Notifications
You must be signed in to change notification settings - Fork 593
Closed
Labels
bugSomething isn't workingSomething isn't workinghas reproducible stepsIssue is reproducibleIssue is reproducible
Milestone
Description
Duplicate Check
- I have searched the opened issues and there are no duplicates
Describe the bug
When using WindowDragArea, There's a noticeable slowdown when toggling page.window.maximized value. The same code works instantly when I remove it
Code sample
Code
import flet as ft, time
def main(page: ft.Page):
page.window.title_bar_hidden = True
def maximize(e, text):
start = time.time()
page.window.maximized = not page.window.maximized
page.update()
print(f"{text} updated in: {time.time() - start:.5f}")
button_with_wda = ft.WindowDragArea(
ft.Container(
ft.Icon(
ft.Icons.ABC,
size=30
),
on_click=lambda e: maximize(e, "With WDA")
)
)
button_without_wda = ft.Container(
ft.Icon(
ft.Icons.ABC,
size=30
),
on_click=lambda e: maximize(e, "Without WDA")
)
page.add(button_with_wda)
page.add(button_without_wda)
if __name__ == "__main__":
ft.app(target=main)To reproduce
- Run the code
- Click both buttons several times
- Observe console timing
- Compare times
Expected behavior
No response
Screenshots / Videos
Operating System
Windows
Operating system details
Windows 11
Flet version
0.27.6
Regression
No, it isn't
Suggestions
No response
Logs
No response
Additional details
I tested it with time.time() and found that it's not always slower, but the interface still feels noticeably less responsive, especially when you press it quickly, or your project's bigger
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghas reproducible stepsIssue is reproducibleIssue is reproducible