hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
20.02k stars 851 forks source link

static window rules are not applied on window open #5703

Open SetOfAllSets opened 5 months ago

SetOfAllSets commented 5 months ago

Hyprland Version

System/Version info ```sh Hyprland, built from branch HEAD at commit c5e28ebcfe00a510922779b2c568cfa52a317445 (props: bump ver 0.37.1). Date: Sat Mar 16 14:51:49 2024 Tag: v0.37.1 flags: (if any) System Information: System name: Linux Node name: Gentoo Release: 6.6.13-gentoo Version: #22 SMP PREEMPT_DYNAMIC Thu Apr 4 20:42:34 PDT 2024 GPU information: 00:02.0 VGA compatible controller [0300]: Intel Corporation CometLake-H GT2 [UHD Graphics] [8086:9bc4] (rev 05) (prog-if 00 [VGA controller]) 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU106M [GeForce RTX 2070 Mobile / Max-Q Refresh] [10de:1f14] (rev a1) (prog-if 00 [VGA controller]) os-release: NAME=Gentoo ID=gentoo PRETTY_NAME="Gentoo Linux" ANSI_COLOR="1;32" HOME_URL="https://www.gentoo.org/" SUPPORT_URL="https://www.gentoo.org/support/" BUG_REPORT_URL="https://bugs.gentoo.org/" VERSION_ID="2.14" plugins: ```

Bug or Regression?

Bug

Description

Opening a picture in picture window in ungoogled-chromium does not apply static rules.

How to reproduce

Add windowrulev2 = pin, floating:1 to your config.

Crash reports, logs, images, videos

No response

SetOfAllSets commented 5 months ago

I updated which it did not fix the issue, I've updated the system info to match.

The-Briel-Deal commented 5 months ago

Note this is a guess but, I am able to replicate this, and its for literally all static rules when opening pip in firefox and chromium. I'm guessing the problem is that when a pip is opened. It runs under the same process (notice how in hyprctl clients, it says pid as the same number every firefox and pip window, there is just one firefox process opening windows). I'm gonna dig deeper into this, but I'm thinking that only one evaluation is done per process. But i'll dig deeper into this right now and update when I learn more.

Thanks for the request! Hope things are going well!

SetOfAllSets commented 5 months ago

Thanks, I hope things are going well for you too. That was also my thinking when I found this.

The-Briel-Deal commented 5 months ago

As an alternative in the interim, I just tested using dispatchers and that works. So you can just set a dispatcher to pin active window and that will work.

hyprctl dispatch pin title:Picture-in-Picture

The-Briel-Deal commented 5 months ago

I also see in the debug logs that it is identifying the spawned window and attempting to apply the static rules when its spawned. But it won't even set it as floating with a window rule.

SetOfAllSets commented 5 months ago

Interesting. I might use dispatchers for now, thanks for sharing that workaround.

The-Briel-Deal commented 5 months ago

Still trying to figure out the problem here, debugging this has been a little painful but I'm gonna keep working on this. I'll keep this updated with progress.

The-Briel-Deal commented 5 months ago

@SetOfAllSets

I wish I had a more satisfying answer but I must have been making some mistake earlier. For some reason it is working as expected now that I have the config correct. Please try the following for this to work in firefox pip, and replace dashes with spaces for chromium.

Use

windowrulev2=float,title:^(Picture-in-Picture)$
windowrulev2=pin,title:^(Picture-in-Picture)$

Make sure float comes first and pin comes second.

Let me know how this works.

SetOfAllSets commented 5 months ago

It works, thanks!

vaxerski commented 4 months ago

can this be closed then?