Bug 405450 - Extend Maximize/Restore action into a tri-state Maximize/Restore/Minimize action
Summary: Extend Maximize/Restore action into a tri-state Maximize/Restore/Minimize action
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-13 19:02 UTC by pmargeti34
Modified: 2021-10-17 15:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pmargeti34 2019-03-13 19:02:55 UTC
PROPOSAL:
Please change the System settings -> Window management -> Window Behavior -> Titlebar Actions -> Maximize/Restore action into a Maximize/Restore/Minimize action

ALTERNATIVE:
Currently it's not possible to implement something like this via KWin scripting since there is no signal for "when you scroll over the titlebar". There isn't even a generic "mouse operation" or "wheel operation" signal on titlebar.
If we had a signal to connect to, we could easily switch between the 3 states using something like:

client.titlebarWheel.connect(function(delta){
    // prevent default action somehow.

    if (delta > 0) { // scroll up
        if (!client.maximized && !client.minimized) {
            client.maximized = true
        }
    } else if (delta < 0) { // scroll down
        if (client.maximized && !client.minimized) {
            client.maximized = false
        } else if (!client.minimized) {
            client.minimized = true
        }
    }
})

RELATED:
the client.maximized does not exist currently as KWin has a complicated MaximizeMode enum that can be MaximizeVertical, MaximizeHorizontal, MaximizeFull (what a normal user considers "maximized"), and MaximizeRestore (not maximized). Since it was a complicated enum property, it seems nobody ever implemented a simple bool maximized property
SEE: https://bugs.kde.org/show_bug.cgi?id=387097

NOTE:
This bug from 2003 with the same wish was solved in 2005, but seems we've dropped that code... 
SEE: https://bugs.kde.org/show_bug.cgi?id=66519
Comment 1 Martin Flöser 2019-03-13 20:24:29 UTC
Maximize/Restore are the options to go from maximize to restore and from restore back to maximize. It makes zero sense to also include minimize in it. Even more minimize in that list would be unacceptable as it's an action which cannot be reversed in the same way.
Comment 2 pmargeti34 2019-03-13 22:04:31 UTC
(In reply to Martin Flöser from comment #1)
>It makes zero sense to also include minimize in it. 
If a window isn't maxized, it would make sense that mouse wheel down minimizes it. What's your argument for why exactly it makes zero sense?

>Even more minimize in that list would be unacceptable as it's an action
> which cannot be reversed in the same way.
Is this a KDE design principle written somewhere? There are other ways to restore a minimized window: alt-tabbing, task manager...
Comment 3 pmargeti34 2019-03-13 22:11:08 UTC
...cont.
Furthermore, you allow Double click: minimize action (which can't be undone in the same way), Minimize is also in the list for Left, Middle and Right buttons, and you can even have it activate on Window Actions->Inner Window,Titlebar & Frame in combination with a modifier key. So why is wheel action an exception all of a sudden?
Comment 4 Christoph Feck 2019-03-14 00:38:45 UTC
Truth is, Kwin developers are already swamped with bug reports (either valid, or invalid, because they are vendor driver specific). Adding more options to KWin will only increase maintainance burden.

Unless you want to step up and implement and maintain the added code for new features, there is little point in piling up more feature requests in bugzilla. That might come as a surprise, but considering the experiences made in the last years, there is no other option.
Comment 5 pmargeti34 2019-03-14 07:16:48 UTC
(In reply to Christoph Feck from comment #4)
> Unless you want to step up and implement and maintain the added code for new
> features, there is little point in piling up more feature requests in
> bugzilla. That might come as a surprise, but considering the experiences
> made in the last years, there is no other option.

There is little point in implementing the code if this bug is instantly marked as RESOLVED INTENTIONAL.