Skip to content

Toggling window.frameless property more than once fails #4750

Open
@ndonkoHenri

Description

@ndonkoHenri

Discussed in #4743

Originally posted by SKD8 January 20, 2025

Question

When I tried to toggle the window frame, it went frameless on the first tap, but the frame did not restore back on the second tap. Why?

Code sample

import flet as ft

async def main(page: ft.Page):
    page.window.title_bar_hidden = True
    page.window.title_bar_buttons_hidden = True
    page.window.frameless = True
    page.window.height = 100
    page.window.width = 151

    def dock_click(e):
        page.window.frameless = not page.window.frameless
        page.update()

    dock = ft.WindowDragArea(
        content=ft.Container(
            width=100,
            height=100,
            bgcolor=ft.colors.WHITE70,
            border = ft.border.all(2, ft.colors.WHITE),
            border_radius=5,
            on_click=dock_click,
        ),
        maximizable=False,
    )

    page.add(dock)


ft.app(target=main)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions