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

fullscreen windows on same workspace issues #3093

Open
kristoferus75 opened this issue Aug 27, 2023 · 8 comments
Open

fullscreen windows on same workspace issues #3093

kristoferus75 opened this issue Aug 27, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@kristoferus75
Copy link

kristoferus75 commented Aug 27, 2023

Description

Hi !

Issue with fullscreen windows (rule maximized or fullscreen 1 windows)

two or more fullscreen windows on same workspace:

issues

  • if close one window on this workspace -> windows on ws become tiled -> is not ok
  • if i open an window on other monitor -> windows on ws become tiled -> is not ok
  • if i move one window to other monitor -> windows on ws become tiled -> is not ok
  • if i open an window on same which have float rule -> windows on ws become tiled -> is not ok
  • if i open an window on ws which have no window rule -> windows on ws become tiled -> is ok
  • if i open an window on ws which have maximized rule -> windows on ws stay maximized -> is ok

Is it possible to fix this issues or enhance hyprland ? (let maximized windows stay maximized)

Thanks

@kristoferus75 kristoferus75 added the enhancement New feature or request label Aug 27, 2023
@vaxerski
Copy link
Member

you can script this. Make a script check on window close whether it was maximized and if so, maximize the first window on that workspace.

@kristoferus75
Copy link
Author

kristoferus75 commented Aug 28, 2023

ok but sorry this is only a workaround for close :-(

@vaxerski
Copy link
Member

same method can be applied for open events.

@misuzu
Copy link

misuzu commented Aug 29, 2023

Likely related #2050

@kristoferus75
Copy link
Author

script does close windows but not fullscreen -> What is wrong ?

#!/usr/bin/env bash

addr_focused="$(hyprctl -j activewindow | gojq -r '.address')"
active_win_fullscreen="$(hyprctl -j activewindow | gojq -r '.fullscreen')"

active_ws_clients="$(hyprctl clients -j | jq -r ".[] | select(.workspace.id == "$(hyprctl activewindow -j | jq -r '.workspace.id')\)"")"
first_address="$(echo $active_ws_clients | jq -r '.address' | head -1)"

if [[ "$active_win_fullscreen" == "true" ]]; then
  hyprctl --batch "dispatch closewindow address:${addr_focused};"
  hyprctl --batch "dispatch focuswindow address:${first_address}; dispatch fullscreen 1;"
  #echo ${addr_focused}
  #echo ${first_address}
else
 hyprctl --batch "dispatch closewindow address:${addr_focused};"
 #echo "test"
fi

@vaxerski
Copy link
Member

you need to listen for the window close event from socket2. closewindow sends a close signal to the app, and not explicitly close it that instant.

@kristoferus75
Copy link
Author

Sorry, the whole thing is too cumbersome and too complicated !
Too bad you can't fix it in code :-(
Stay with my dwm! Here everything works as desired and there are no problems and it is absolutely stable

the problem is also if opens a float window in password manager (Rofi script) -> to ask pgp key passwort -> windows also become tiled and you paste username passord in wrong windows -> currently unusable :-(

@jsecchiero
Copy link

jsecchiero commented Jan 6, 2024

Agree with those points

if close one window on this workspace -> windows on ws become tiled -> is not ok
if i move one window to other monitor -> windows on ws become tiled -> is not ok

If you consider that if you have multiple windows open in fullscreen and you can switch between them with 'movefocus' keeping them in fullscreen, but if you close a window everything becomes tiled that behavior seems not consistent with the whole usage

From what comes to my mind so far there could be two 'ok' options to address those cases. E.g. after the close event i would like to:

  1. find the last used window that was configured in fullscreen and put it in fullscreen. OR
  2. verify a workspace toggle options that decide if everything inside should be in fullscreen mode or tile mode. When is on, everything will be fullscreen here, even after closing or moving windows to another workspace or monitor

AFAIK in either option i don't see a really easy way to script those. In the "closewindow" event there is not any information regarding which workspace the windows were in, the event only passes the window address information that can't be used by filtering the Hyprland clients since the window doesn't exist anymore, making both 1. and 2. options impractical.
Even after that, there is no actual window attribute to check which window was before in fullscreen, making option 1. impractical. To be clear in my tests the existing fullscreen attribute is "true" only when is both in the foreground in the workspace and fullscreen.
For the workspace toggle mentioned in option 2., i don't see a way to configure that.
As i can see is possible to just run "dispatch fullscreen 1" at the "closewindow" event and it works well until it brings in fullscreen the focused window that was intentionally set to stay in tile mode. So is not a really elegant solution

As a recent adopter of Hyprland, your insights are appreciated as i may not have fully grasped all its features or may be approaching the project from the wrong perspective

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants