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
Monocle Layout "minimize unfocused windows" fix and improvements #45
Monocle Layout "minimize unfocused windows" fix and improvements #45
Conversation
Could you also change your commit messages to respect CC? |
2bb9f3f
to
cef1f23
Compare
@gikari I've got the original functionality restored. It's kind of hacky but the only way I could find to do it. Basically I added a hook to How do you want to handle the finer points?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we enable this by default?
Not yet. If it works well - we probably should in the future.
Should we make an exception for the focus cycle (or add a separate Action) that includes minimized windows in the queue when switching focus?
We have FocusNextWindow and FocusPreviousWindow. Those should work with this option on as in before. As for Focus Left, Right and so on, I am not sure. How do those work in classic tilings WMs with monocle layout (It seems like Monocle is the terminology, that comes from dwm)?
I will address the comments you raised today -- as for the keyboard shortcuts, it's been a long time since I used DWM, but looking at the source code now it seems that it doesn't implement minimization at all. I currently like the behavior we have of cycling only through visible windows with the I think, just to avoid needing a separate keyboard shortcut, we should either I lean towards |
I meant if the switching between windows in monocle mode works with Next/Previous window shortcuts. If it is, we should do the same, but we can provide an option to exclude minimized windows from the list. |
Using this branch on my machine and so far so good. Here's some notes on the behavior: Assuming monocle layout and
There is still an issue with using this layout in a multi-monitor setup -- if you close the active window in Monocle layout in your secondary monitor, it switches to a window in the primary monitor instead of the same monitor that the closed window was in. I Haven't really figured out why this is happening. I have some code that tries to fix it but it isn't really working. Will update with progress on that. Other than that minor issue, I am comfortable with the experience so far. |
@gikari I wasn't able to get focus to change to the same monitor as the closed window when closing the active window in Moncole mode with |
I see the failing tests. Edited the |
Could you also please update the MR description according to the new template please? |
86ae8a5
to
92c00fa
Compare
PR description updated, hope it's all up to standard :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 🎉 I just tested, and it works very well (except after closing a window in multimonitor it focuses the one, on the other monitor, so after merging you could create an issue for this strange behavior). Just a little small nitpicks (including in-code comments):
I think you can remove WIP it the UI. It still has the multimonitor problem, but I think it works good to be considered WIP feature, and in general marking something WIP in the UI lies not a good impression on the end user.
Also, I apologize for some pasts of CI not working as intended right now. So, could you please format your code with prettier?
And you need to rebase your branch on the current master.
92c00fa
to
f772f21
Compare
Addressed the issues you mentioned, got the husky hooks set up, verified with ESLint (apparently if you have a default parameter in a function, you don't need to declare its type, good to know) and formatted with Prettier. Rebuilt and restarted KWin for good measure. Everything seems good on my end! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I noticed another thing - if I switch to another layout, the windows, that were minimized by the script are not brought back. I think this, can be addressed in another PR. For now, it is good.
@@ -343,42 +350,42 @@ export class TilingEngine implements Engine { | |||
this.windows.remove(window); | |||
} | |||
|
|||
/** | |||
* Focus the next or previous window. | |||
/** Focus next or previous window |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to duplicate JSDoc here.
Summary
Fixes Monocle Layout with
Minimize Unfocused Windows
(internallyconfig.monocleMinimizeRest
) option enabled.Restores previous functionality (before Wayland patches) and adds
Actions
Surface
with this layout properlyBreaking Changes
None
UI Changes
Removed "(WIP)" from "Minimize unfocused windows" option in the config UI.
Test Plan
Related Issues
Closes #43, #55