When two monitors are used, page.window_center () is displayed in the wrong position
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17k
- Forks
- 694
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 33
Description
Description
I have two monitors in use, and the resolution of the two monitors is not the same, the left is 2560x1440, the right is 1920x1080, page.window_center () is displayed in the wrong position, it is displayed on the right side of the monitor, but only the left side of the program window is displayed
Code example to reproduce the issue:
# -*- coding: utf-8 -*-
import flet as ft
def main(page: ft.Page):
page.add(ft.Text('hello'))
page.window_center()
page.update()
if __name__ == "__main__":
ft.app(target=main)
Describe the results you received:
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.18.0
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page:
Author: Appveyor Systems Inc.
Author-email: hello@flet.dev
License: Apache-2.0
Location: C:\Python311\venv311\Lib\site-packages
Requires: cookiecutter, flet-runtime, packaging, qrcode, watchdog, websocket-client, websockets
Required-by:
Operating system:
windows 11
Additional environment details:
attention: the resolution of the two monitors is not the same, the left is 2560x1440, the right is 1920x1080
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied Python reproduction using page.window_center() and run it on Windows 11 with two monitors at the reported resolutions. Trace the page.window_center() implementation and compare the calculated position with the expected centered location; done means the window is centered correctly on the intended monitor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100