flet icon indicating copy to clipboard operation
flet copied to clipboard

When two monitors are used, page.window_center () is displayed in the wrong position

Open vrix opened this issue 6 months ago • 3 comments

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:

image

Describe the results you expected:

image

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: [email protected]
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

vrix avatar Jan 13 '24 13:01 vrix

I have two screens with different resolutions, but the window_center() works normally. The window is centered with respect to the currently active/used screen. Nevertheless, I havent found any opened or closed issue on the window_manager repo used by flet. - we should perhaps open one?

ndonkoHenri avatar Jan 13 '24 14:01 ndonkoHenri

me too. @vrix

BrentHuang avatar Apr 23 '24 09:04 BrentHuang

I have two screens with different resolutions, but the window_center() works normally. The window is centered with respect to the currently active/used screen. Nevertheless, I havent found any opened or closed issue on the window_manager repo used by flet. - we should perhaps open one?

Maybe you are running on the main monitor, try running on another monitor.

BrentHuang avatar Apr 23 '24 09:04 BrentHuang