Skip to content

Add iconify and restore 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

Merged
merged 2 commits into from
Jun 21, 2025

Conversation

weihsinyeh
Copy link
Collaborator

@weihsinyeh weihsinyeh commented Jun 16, 2025

This pull request introduces iconify and restore 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 iconified and is the topmost window.

Summary by Bito

This pull request enhances the window management system by introducing minimize and maximize functionality, along with an iconify property in the window structure. It updates the drawing logic to reflect the active state of windows based on their minimized status, changing the window frame color accordingly.

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

@jserv
Copy link
Contributor

jserv commented Jun 21, 2025

The subject '"dd iconify and maximize features on window frame" is misleading. It is indeed a window operation for iconifying and adjusting back to the original setting, meaning that there is no real "maximize" operation applied to any window.

Add a condition in twin_window_dispatch() to handle clicks on the
iconify and restore buttons located on the window frame. The
positions of these buttons are calculated for click detection.

A iconified 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 iconified.

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

Signed-off-by: Wei-Hsin Yeh <[email protected]>
@weihsinyeh weihsinyeh changed the title Add minimize and maximize features on window frame Add iconify and restore features on window frame Jun 21, 2025
@jserv jserv merged commit 5eb41fa into sysprog21:main Jun 21, 2025
3 checks passed
@jserv
Copy link
Contributor

jserv commented Jun 21, 2025

Thank @weihsinyeh for contributing!

@weihsinyeh weihsinyeh deleted the minimize branch June 21, 2025 15:07
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