Skip to content
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

Added toggleswallow dispatcher #5548

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

Conversation

tomben13
Copy link
Contributor

Describe your PR, what does it fix/add?

New feature: toggleswallow dispatcher which allows to toggle the swallowed window with a keybind. Only if the window was originally swallowed will it work. Meaning that you can only "unswallow" and then "swallow" again a window, and so on.

Useful when you want to have your terminal swallowed, but sometimes you also want to check the logs of your running application.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Is it ready for merging, or does it need work?

Ready

@@ -687,10 +688,16 @@ void Events::listener_unmapWindow(void* owner, void* data) {
g_pHyprOpenGL->makeWindowSnapshot(PWINDOW);

// swallowing
if (PWINDOW->m_pSwallowed && g_pCompositor->windowExists(PWINDOW->m_pSwallowed)) {
if (PWINDOW->m_pSwallowed) {
Copy link
Member

@vaxerski vaxerski Apr 12, 2024

Choose a reason for hiding this comment

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

what about previouslySwallowed? Also reset this :P

Generally I see no point in the "previously" member as the "swallowed" member shouldnt change anything. Just hide and unhide I'd say

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced with a bool. Is there a better method to handle the hide and unhide in C++ ?

Copy link
Member

Choose a reason for hiding this comment

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

why not check isHidden()? If swallowed != null and swallowed->ishidden(), it's swallowed, if it's not hidden, it's not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about this, but it could be hidden for other reasons, like if another window is fullscreen, no ?

Copy link
Contributor

Choose a reason for hiding this comment

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

grouped windows are hidden

@daniel-hernandez-sony
Copy link

Would love to see this coming online :)

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.

4 participants