sway icon indicating copy to clipboard operation
sway copied to clipboard

Floating window rule affects other windows

Open arrudagates opened this issue 2 years ago • 6 comments

  • Sway Version:

    • 1.8-dev-2dace6b8 (upgraded to check if the bug still happens [it does])
    • 1.7 (version I was actually using)
  • Debug Log:

    • https://gist.github.com/arrudagates/82546a6f2d55008bd5c895acc77caeb6#file-sway-log
  • Configuration File:

    • Irrelevant with default config, bug is related to specific floating window rules
    • https://gist.github.com/arrudagates/82546a6f2d55008bd5c895acc77caeb6#file-sway-config
  • Stack Trace:

    • Irrelevant, sway doesn't crash
  • Description:

    • Have a floating rule for a Firefox popup extension like this
    • With Firefox open, make the extension open, triggering the floating window

    Below are images to demonstrate the issue:

Firefox before the floating window opens

image

Firefox affected by the floating window, which itself isn't rendering correctly either

image

How they should actually render (fixed by cycling float states twice on both Firefox and the extension window)

image

arrudagates avatar Apr 20 '22 13:04 arrudagates

Hi ! I'm also experiencing the same issue. Not with firefox, but the rest fits perfectly.

nicolas-graves avatar Sep 16 '22 21:09 nicolas-graves

Will add my two cents, I figured out that it happens to rules with CRITERIA using title.

Original state: image

Case 1

Works correctly, as expected, uses only app_id as a CRITERIA.

The rule:

for_window [app_id="emacs"] floating enable

After I launch an app, matching the rule: image

Case 2

Works incorrectly, uses title in CRITERIA.

The rule:

for_window [app_id="emacs" title="pass - Emacs Client"] floating enable

After I launch the same app, matching the rule: image

After the app is killed: image

abcdw avatar Sep 20 '22 05:09 abcdw

This issue should get some level of priority, as it makes it impossible to have different rules for specific windows of the same app.

arrudagates avatar Sep 25 '22 15:09 arrudagates

CC: @emersion

abcdw avatar Nov 28 '22 07:11 abcdw

I'm not able to reproduce this. I use a title criteria to float a foot terminal for selecting passwords as well. It floats the terminal with the altered title and has no effect on the others.

rpigott avatar Nov 28 '22 08:11 rpigott

@RPigott Can you try to reproduce it using emacs (on wayland it either requires to have xwayland or to be built with pgtk flag) or with firefox like @arrudagates mentioned?

I'll try to reproduce it on alacritty and foot.

abcdw avatar Nov 28 '22 10:11 abcdw

I was able to reproduce the same issue with alacritty, but it happens rarely, in most cases floating rule just don't apply and window still tiled. Another observation if I move mouse coursor outside of newly created window float rule applies, if I move mouse inside newly created window, it doesn't. Sometimes floating get applied, but the window is not centered, but somehow shifted and have different proportions than usual.

sway 1.6.1.

1.sh:

echo -ne "\033]0;SOME TITLE HERE\007"
sh

sway/config:

for_window "[title=\"SOME TITLE HERE\"]" floating enable
for_window "[title=\".* - Emacs Client\"]" floating enable

Command I use to perform test: alacritty -e ./1.sh

abcdw avatar Nov 29 '22 07:11 abcdw

Also it behaves differently if I have no other windows: image And if I have one window: image Or a few: image

abcdw avatar Nov 29 '22 07:11 abcdw

Reproduces on sway 1.7 and 1.8.

abcdw avatar Nov 29 '22 11:11 abcdw

Hi, I have a bug probably related to this one. With rule: for_window [title="red"] floating enable, resize set 900 450, move to workspace 10 and opening specifically this website in firefox the rule apply to firefox. Also happened with certain sites in chromium.

asoymos avatar Dec 23 '22 19:12 asoymos

OK, I found this where it's explained how the rule 'title=', as an regex expresion apply if it matches a part of a windows title (no wonder why this happened only in browsers). I solved it using a lot more specific title rules.

asoymos avatar Dec 23 '22 20:12 asoymos

Hey all, I've been away from this issue for a bit, has anyone managed to find a workaround to solve this until it gets fixed?

arrudagates avatar Feb 04 '23 13:02 arrudagates

Reproduces on sway 1.7 and 1.8.

Reproduces on 1.9-dev-0695f3fa

arrudagates avatar Feb 04 '23 13:02 arrudagates

@emersion, maybe you know the possible cause of the problem?

abcdw avatar Feb 04 '23 15:02 abcdw

This has been happening to me as well and for quite some time. I'm currently using sway 1.9-dev-2c0f68b7 with this window rule:

for_window [title="Extension: \(Pushbullet\).*"] floating enable

This applies to a firefox window.

jsimonrichard avatar Jun 19 '23 00:06 jsimonrichard