Skip to content

(Linux) Size of the window is not the one specified by window width and height when is set to not resizable  #1375

Open
@LucianCrainic

Description

@LucianCrainic

Description

Hello, i found out on Linux that when i set page.window_resizable to False the window is not resizable but the size of the window is not the one specified by page.window_width and page.window_height. The window is bigger than the specified size. I tested it on a MacOs machine and it works as expected. I emulated the bug on a VM with Ubuntu 22.04.1 LTS and Python 3.10.6 using UTM. I also tested it on a real machine with Ubuntu (same version) and i still get the same issue.

Code example to reproduce the issue:

import flet
from flet import IconButton, Page, Row, TextField, icons

def main(page: Page):
    page.title = "Flet counter example"
    page.vertical_alignment = "center"
    
    # if i comment out the following line then the window has the correct size
    page.window_resizable = False
    page.window_width = 200
    page.window_height = 200

    txt_number = TextField(value="0", text_align="right", width=100)

    def minus_click(e):
        txt_number.value = int(txt_number.value) - 1
        page.update()

    def plus_click(e):
        txt_number.value = int(txt_number.value) + 1
        page.update()

    page.add(
        Row(
            [
                IconButton(icons.REMOVE, on_click=minus_click),
                txt_number,
                IconButton(icons.ADD, on_click=plus_click),
            ],
            alignment="center",
        )
    )

flet.app(target=main)

Describe the results you received:
When page.window_resizable is set to False the window is not resizable but the size of the window is not the one specified by page.window_width and page.window_height. The window is bigger than the specified size.

flet-bug.mov

Describe the results you expected:
I expected when the window_resizable is set to False to have a window with the size specified by window_width and window_height that is not resizable.

Flet version (pip show flet):

Version: 0.5.2
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: /home/lucian/.local/lib/python3.10/site-packages
Requires: flet-core, httpx, oauthlib, packaging, watchdog, websocket-client, websockets
Required-by:

Operating system:
Linux Ubuntu 22.04.1 LTS

Additional environment details:
I emulated the bug on a VM with Ubuntu 22.04.1 LTS and Python 3.10.6 using UTM. I also tested it on a real machine with Ubuntu (same version) and i still get the same issue. I also tested it on a MacOs machine and it works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions