Skip to content

Add minimize and maximize features on window frame #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

weihsinyeh
Copy link
Collaborator

@weihsinyeh weihsinyeh commented Jun 16, 2025

This pull request introduces minimize and maximize functionality for windows.
It also updates the logic for determining when a window is considered active.
The window frame now changes to blue only when the window is not minimized and is the topmost window.

Summary by Bito

This pull request enhances the window management system by adding minimize and maximize features. It updates the window structure to include a minimize property and refines the drawing logic to visually indicate the active state of windows based on their minimized status.

To prevent twin_stack_blur() from blurring shadows over the window
frame, twin_shadow_border() draws a black border beginning at the top Y
position of the window's client area, offset by
'CONFIG_SHADOW_BLUR / 2 + 1'.

Signed-off-by: Wei-Hsin Yeh <weihsinyeh168@gmail.com>
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refine the subject and descriptions.

@weihsinyeh weihsinyeh changed the title Minimize Add minimize and maximize features on window frame Jun 16, 2025
Add a condition in twin_window_dispatch() to handle clicks on the
minimize and maximize buttons located on the window frame. The
positions of these buttons are calculated for click detection.

A minimized window is inactive, even if it remains at the top of the
screen. A window is considered active when it is the topmost window and
is not minimized.

When the window is active, its title bar turns blue.

Signed-off-by: Wei-Hsin Yeh <weihsinyeh168@gmail.com>
@jserv
Copy link
Contributor

jserv commented Jun 16, 2025

The "maximize" and "minimize" icons are somewhat unclear. In the proposed changes for Mado, they appear to function as toggle options for shadowing and unshadowing rather than traditional window maximizing and minimizing.

See Shadowing X window

@weihsinyeh
Copy link
Collaborator Author

The "maximize" and "minimize" icons are somewhat unclear. In the proposed changes for Mado, they appear to function as toggle options for shadowing and unshadowing rather than traditional window maximizing and minimizing.

See Shadowing X window

In this commit, clicking the minimize button causes the window to display only its title bar.
However, in the description of Shadowing X window, the correct term for this action is actually 'iconify' instead of 'minimize'.

@jserv
Copy link
Contributor

jserv commented Jun 17, 2025

However, in the description of Shadowing X window, the correct term for this action is actually 'iconify' instead of 'minimize'.

Can you clarify the descriptions of this pull request accordingly?

@weihsinyeh
Copy link
Collaborator Author

The "maximize" and "minimize" icons are somewhat unclear.

Originally, I want to put button on these icons.

However, the button's layout mechanism restricts it to being displayed only within the area of the window's client region. Specifically, widget->extents = event->u.configure.extents; in widget.c sets this behavior.

As for where the layout of the widget begins within event->u.configure.extents, it is determined by window->client.top, which is defined based on whether the window is a TwinWindowPlain or a TwinWindowApplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants