Skip to content

Conversation

@yuukibarns
Copy link
Contributor

@yuukibarns yuukibarns commented Apr 29, 2025

Describe your PR, what does it fix/add?

fix #9422.

When open a floating window (i.e. windowrule float applied on the window), it should use the stored size if persistentsize is set.

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

I want to further improve the windowrule persistentsize by storing the sizes in cache or config file so that sizes can be persistent across boots, but I am a newbie in C++ and I don't know the conventional method to do this in this project, so I will wait for your kind instructions.

@yuukibarns yuukibarns changed the title fix(window): use stored size for new floating window when persistentsize is set. fix hyprwm#9422. fix(window): use stored size for new floating window when persistentsize is set. fix #9422. Apr 29, 2025
@yuukibarns yuukibarns changed the title fix(window): use stored size for new floating window when persistentsize is set. fix #9422. fix(window): use stored size for new floating window when persistentsize is set Apr 29, 2025
@yuukibarns
Copy link
Contributor Author

Related #10161

@yuukibarns
Copy link
Contributor Author

yuukibarns commented Apr 30, 2025

COMMIT 1: use stored size for new floating window
COMMIT 2: replace any_of with ranges::any_of
COMMIT 3: use initialClass and initialTitle when storing sizes on close

May I explain the COMMIT 3. The previous implementation use class and title when storing sizes on close but I find title can be too changeable to be used as an indicator (for example title of anki's Browse page is like Browse (Selected xxx from xxx)), so I think it can be more reliable to use initialClass and initialTitle.

However, this introduce a new problem, see below.

@yuukibarns
Copy link
Contributor Author

yuukibarns commented Apr 30, 2025

However, there are still problems to solve:

  1. some windows can have the same initialTittle and initialClass, (for example, anki's browse and syncing);
  2. store size information in caches or config files for persistence across boots.

@vaxerski
Copy link
Member

2 is too complicated to do in this MR, I say leave it.
1 you can incorporate the xdg-tag protocol here for when these apps start supporting it

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.

rest lgtm

@yuukibarns
Copy link
Contributor Author

However, there are still problems to solve:

1. some windows can have the same initialTittle and initialClass, (for example, anki's browse and syncing);

2. store size information in caches or config files for persistence across boots.

Any plan on 2?

@yuukibarns yuukibarns requested a review from vaxerski May 2, 2025 15:34
@vaxerski
Copy link
Member

vaxerski commented May 4, 2025

not for now

vaxerski
vaxerski previously approved these changes May 4, 2025
@vaxerski vaxerski merged commit 930eeac into hyprwm:main May 6, 2025
12 checks passed
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.

2 participants