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

@vaxerski vaxerski force-pushed the main branch 9 times, most recently from 7110a04 to 25aec3a Compare April 27, 2024 02:17
@vaxerski vaxerski force-pushed the main branch 2 times, most recently from fb471b8 to 1237732 Compare May 3, 2024 21:40
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.

None yet

3 participants