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

refactor fullscreen #7104

Merged
merged 7 commits into from
Jul 31, 2024
Merged

refactor fullscreen #7104

merged 7 commits into from
Jul 31, 2024

Conversation

MightyPlaza
Copy link
Contributor

@MightyPlaza MightyPlaza commented Jul 30, 2024

Refactors fullscreen to:

  • allow passing directly from any state to any other (e.g. maximized to fullscreen)
  • allow fully separating the fullscreen mode hyprland uses and the client sees (e.g. to replace fakefullscreen)

Introduces syncFullscreen to allow enabling and disabling wether the internal and client's state should be the same.
Introduces new dispatcher fullscreenState X Y where X and Y set the internal and the client's fullscreen state respectively (-1 to not alter, 0 for none, 1 for maximized, 2 for fullscreen, 3 for maximized and fullscreen) (using this dispatcher will set value above false).

It's ready for testing and should be fully functional, but still needs some clean up of unused stuff.

should fix #6562
closes #2662

modified:   src/Compositor.cpp
modified:   src/Compositor.hpp
modified:   src/config/ConfigManager.cpp
modified:   src/config/ConfigManager.hpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/LayerSurface.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/desktop/Workspace.cpp
modified:   src/desktop/Workspace.hpp
modified:   src/events/Windows.cpp
modified:   src/helpers/Monitor.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/DwindleLayout.hpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/layout/IHyprLayout.hpp
modified:   src/layout/MasterLayout.cpp
modified:   src/layout/MasterLayout.hpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/KeybindManager.hpp
modified:   src/managers/input/IdleInhibitor.cpp
modified:   src/managers/input/InputManager.cpp
modified:   src/managers/input/Swipe.cpp
modified:   src/protocols/ForeignToplevelWlr.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/config/ConfigManager.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.hpp
modified:   src/desktop/Workspace.cpp
modified:   src/events/Windows.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/input/Swipe.cpp
@MightyPlaza MightyPlaza marked this pull request as draft July 30, 2024 01:37
modified:   src/events/Windows.cpp
@diniamo
Copy link
Contributor

diniamo commented Jul 30, 2024

workspace=f[1], gapsin:0, gapsout:0, border:false, shadow:false, rounding:false, decorate:false <- this workspace rule seems to be broken. It's supposed to disable window decorations for maximized windows.

modified:   src/desktop/Workspace.cpp
@MightyPlaza
Copy link
Contributor Author

should work now

@diniamo
Copy link
Contributor

diniamo commented Jul 30, 2024

Yep, all good

@diniamo
Copy link
Contributor

diniamo commented Jul 30, 2024

Ok I might be schizo but could this PR have broken anything related to cursors?

@diniamo
Copy link
Contributor

diniamo commented Jul 30, 2024

Never mind, it's probably some random commit

modified:   src/config/ConfigManager.cpp
modified:   src/events/Windows.cpp
@MightyPlaza MightyPlaza marked this pull request as ready for review July 30, 2024 23:04
@MightyPlaza
Copy link
Contributor Author

MightyPlaza commented Jul 30, 2024

should be finished and ready for review now
hyprwm/hyprland-wiki#730

modified:   src/config/ConfigManager.hpp
src/desktop/Window.hpp Outdated Show resolved Hide resolved
src/layout/IHyprLayout.hpp Show resolved Hide resolved
modified:   src/desktop/Window.hpp
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

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

yabba dabba doo

@vaxerski vaxerski merged commit e989a0b into hyprwm:main Jul 31, 2024
10 checks passed
@Shaenamity
Copy link

Please allow toggling fullscreenstate if it's already enabled for more convenient, like fakefullscreen used to be.

@MightyPlaza
Copy link
Contributor Author

Please allow toggling fullscreenstate if it's already enabled for more convenient, like fakefullscreen used to be.

#7128

@The-Lost-Light
Copy link

Is it's work with windowrule?
I use fakefullscreen to hide the title in flutter app.
And this rule can't work.

# Flutter Applications
windowrulev2 = fullscreenstate -1 2, class:(localsend)
windowrulev2 = fullscreenstate -1 2, class:(AppFlowy)

@vaxerski
Copy link
Member

vaxerski commented Aug 8, 2024

fakefullscreen = fullscreenstate 0 2 (or 2 0 depending on which fake fullscreen)

@MightyPlaza
Copy link
Contributor Author

fakefullscreen = fullscreenstate 0 2 (or 2 0 depending on which fake fullscreen)

-1 doesn't work for the window rule and somehow I forgot to even add it to the rules in the wiki PR

@The-Lost-Light
Copy link

The-Lost-Light commented Aug 8, 2024

I try fullscreenstate 0 2 and it works at localsend(and most app)
however, AppFlowy will into fullscreen(not fake)
Edit: AppFlowy weird with any fullscreenstate setting

And i found another problem with the windowrule to set it fakefullscreen, i can't manual toggle it by dispatcher like bind = SUPER SHIFT, F, fullscreenstate, 0 2

@MightyPlaza
Copy link
Contributor Author

no ,
bind = SUPER SHIFT, F, fullscreenstate 0 2

@The-Lost-Light
Copy link

no , bind = SUPER SHIFT, F, fullscreenstate 0 2

圖片

@MightyPlaza
Copy link
Contributor Author

no , bind = SUPER SHIFT, F, fullscreenstate 0 2

圖片

you were right, your bind was correct

@MightyPlaza
Copy link
Contributor Author

I try fullscreenstate 0 2 and it works at localsend(and most app) however, AppFlowy will into fullscreen(not fake) Edit: AppFlowy weird with any fullscreenstate setting

And i found another problem with the windowrule to set it fakefullscreen, i can't manual toggle it by dispatcher like bind = SUPER SHIFT, F, fullscreenstate, 0 2

yeah that doesn't work because current internal state is already 0
for now use bind = SUPER SHIFT, F, fullscreenstate, -1 2

@The-Lost-Light
Copy link

I try fullscreenstate 0 2 and it works at localsend(and most app) however, AppFlowy will into fullscreen(not fake) Edit: AppFlowy weird with any fullscreenstate setting
And i found another problem with the windowrule to set it fakefullscreen, i can't manual toggle it by dispatcher like bind = SUPER SHIFT, F, fullscreenstate, 0 2

yeah that doesn't work because current internal state is already 0 for now use bind = SUPER SHIFT, F, fullscreenstate, -1 2

rule: 0 2
bind: -1 2 still not work

rule: 0 3
bind: -1 2 (or 0 2) can work by trans mode(3->2, 2-3 work also)

and AppFlowy weird with any combination

@MightyPlaza
Copy link
Contributor Author

I try fullscreenstate 0 2 and it works at localsend(and most app) however, AppFlowy will into fullscreen(not fake) Edit: AppFlowy weird with any fullscreenstate setting
And i found another problem with the windowrule to set it fakefullscreen, i can't manual toggle it by dispatcher like bind = SUPER SHIFT, F, fullscreenstate, 0 2

yeah that doesn't work because current internal state is already 0 for now use bind = SUPER SHIFT, F, fullscreenstate, -1 2

rule: 0 2 bind: -1 2 still not work

rule: 0 3 bind: -1 2 (or 0 2) can work by trans mode(3->2, 2-3 work also)

and AppFlowy weird with any combination

I'll see why 1st one doesn't work and some other weird cases later
for now don't use the rule and just use the bind to toggle the state (and reopen the window)

@pdf
Copy link

pdf commented Aug 16, 2024

Changing the fullscreen data type from bool to int appears to have been propagated to the socket data structures, making this a breaking change for all external socket clients, and tracking this change down was difficult due to it being marked as an internal refactor in the changelog.

I know it's not always going to be possible, but it would be preferable from a consumer viewpoint to avoid data type changes unless absolutely necessary since it has a flow-on effect for all program logic that consumes the value - a new field might have been introduced (e.g. fullscreenState) to hold the multi-state value, with the existing fullscreen field retaining its bool type to simply indicate whether a window has any positive fullscreen value or not.

@Shaenamity
Copy link

Please allow toggling fullscreenstate if it's already enabled for more convenient, like fakefullscreen used to be.

#7128

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maximized apps can't switch to fullscreen Transition from fullscreen,0 to fullscreen,1 and vice-versa
6 participants