Skip to content

[ENH] Hide TkinterOS window elements when the desktop is not focused #13

@WindowsUninstaller

Description

@WindowsUninstaller

Feature Request: Hide TkinterOS window elements when the desktop is not focused

Description

A clear and concise description of the desired feature/optimization.

  • Current Pain Point: When switching to other fullscreen windows (e.g., fullscreen applications/games), multiple Toplevel windows opened in TkinterOS remain visible on the screen, disrupting the user experience of the active fullscreen application.
  • Desired Outcome: Refactor all independent Toplevel windows into Frame widgets embedded within the main TkinterOS desktop window, with custom title bars for each Frame.
  • Use Case: When the TkinterOS desktop window loses focus (is not the active window), all TkinterOS UI elements (including its "applications") should be completely hidden and not visible over other fullscreen windows.

Proposed Solution

Specific technical approaches and ideas for implementation:

  1. UI Architecture Refactor: Replace all always-on-top Toplevel windows with Frame widgets, each with a custom title bar (to mimic window controls like minimize/maximize/close).
  2. Window Embedding: Use the ctypes.windll.user32.SetParent Windows API function to embed all previously independent Toplevel windows into the main TkinterOS desktop window, ensuring they are only visible when the main window is active.
  3. Focus Detection: Implement focus change detection for the main TkinterOS window – when it loses focus (e.g., user switches to another fullscreen app), hide the entire TkinterOS window/Frame container; when it regains focus, show it again.

Additional Context

Current Unwanted Behavior

Unwanted behavior - TkinterOS windows visible over fullscreen apps

Desired Behavior

Desired behavior - TkinterOS windows hidden when not focused

Key Notes

  • The core goal is to ensure TkinterOS does not "float" over other fullscreen applications when it is not the active/focused window.
  • Maintaining the window management experience (minimize/maximize/close) within TkinterOS is still required after refactoring to Frames.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions