swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.74k stars 1.11k forks source link

floating application started on the wrong (not focused) monitor #8449

Open mm1ke opened 2 weeks ago

mm1ke commented 2 weeks ago

Please fill out the following:

The real issue is that usually, $drun should open on the focues monitor. $drun is in my case tofi. If there are no open application this works as expected, if there is kitty open on both monitor, tofi always open on DP-1 - even if kitty on DP-2 is focus. Starting a application would however open it on the right monitor. It's just that tofi is placed wrong.

Interestingly, this is not always the case. Having for example firefox open on DP-2 would also open tofi correctly on DP-2 (if the focus is there). I made some tests:

DP-1: empty, DP-2: empty -> tofi always starts on focused monitor (expected behavior) DP-1: kitty, DP-2: empty -> tofi always starts on focused monitor (expected behavior) DP-1: empty, DP-2: kitty -> tofi always starts on focused monitor (expected behavior) DP-1: kitty, DP-2: kitty -> tofi always starts on DP-1 DP-1: kitty, DP-2: firefox -> tofi always starts on focused monitor (expected behavior) DP-1: kitty, DP-2: pcmanfm-qt -> tofi always starts on DP-1 DP-1: kitty, DP-2: spicy (floating app) -> tofi always starts on DP-1

Another interesting thing is that if i change tofi with something else like spicy - which is another floating app - it seems to work as expected. (but I haven't test too much)

Not sure it the debug logs helps, i've tried to test a few times the behavior while it was running. Unfortunately this is also a regression of 1.10. There are no issues with 1.9. Please let me know if you need any further information.

emersion commented 2 weeks ago

This comment is not helpful. Please refrain from posting such comments (and keep in mind we're all volunteers here).

Edit: the comment this was replying to has been deleted.

mukul1729 commented 2 weeks ago

This comment is not helpful. Please refrain from posting such comments (and keep in mind we're all volunteers here).

I am sorry if you didnt find it right, sway is great and I still use it as my daily driver but I will share the whole workflow video please take a look.

  1. Before 1.10 the workspace 1 was my laptop and workspace 2 was my Monitor. When the system would start all my applications would open only on workspace 2 which is my monitor but as u can see its actually mirroring everything i do on both the displays

  2. You can see in the video that i cannot interact with anything on my monitor using the mouse pointer , i have to get the pointer to my laptop screen first and only then i can interact with anything, I only use the defaults sway settings and no custom config for workspaces.

  3. Cannot send any window to any other output. Everything works when i run the command swaymsg reload. https://github.com/user-attachments/assets/7a0ff8a1-a67b-42f9-b2ce-7b63944a4da6

FlowingMercury commented 1 week ago

I'm having the same issue, I have three monitors and the upgrade to 1.10 effectively reversed the order they were initialized in. Essentially sway thinks my leftmost monitor is on the right and my rightmost is on the left, which is really cumbersome when I try moving my cursor to other monitors.

I'm able to fix this by setting the monitor positions manually in the sway config as so:

output DP-1 mode 2560x1440@144.000Hz pos 0 0 output DP-2 mode 1920x1080@164.917Hz pos 2560 0 output HDMI-A-1 mode 1920x1080@60.000Hz pos 4480 0

This would be the end of my problems as it fixes the layout issue. However, sway thinks HDMI-A-1 is the main monitor / Screen 0 because it is initialized first. So whenever I load a game on steam it always starts at 1080p even on my 1440p monitor, which I now have to change manually in every game I run.

I can also fix that issue by turning my monitors off and on in the order I want them initialized in but this is obviously far from ideal and not an actual solution to the problem.