domferr / tilingshell

Extend Gnome Shell with advanced tiling window management. Supports multiple monitors, Windows 11 Snap Assistant, Fancy Zones, customised tiling layouts and more.
https://extensions.gnome.org/extension/7065/tiling-shell/
GNU General Public License v2.0
446 stars 7 forks source link

Monitor names/indices are messed up #92

Closed EfogDev closed 1 month ago

EfogDev commented 1 month ago

Describe the bug Hey so what I actually see when moving a window with Ctrl is the opposite of what I see in the layouts popup. I.e. the laptop screen has 2 zones and the external monitor has 3.

To Reproduce Steps to reproduce the behavior:

  1. Have monitors with different names
  2. Set different layouts

Screenshots image

Information

Additional information

$ inxi -G
Graphics:
  Device-1: AMD Phoenix3 driver: amdgpu v: kernel
  Device-2: Chicony Integrated Camera driver: uvcvideo type: USB
  Display: wayland server: X.Org v: 24.1.1 with: Xwayland v: 24.1.1
    compositor: gnome-shell v: 46.3.1 driver: gpu: amdgpu resolution:
    1: 2560x1440~120Hz 2: 2880x1800~120Hz
  API: EGL v: 1.5 drivers: radeonsi,swrast
    platforms: wayland,x11,surfaceless,device
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.1.3-arch1.1
    renderer: AMD Radeon Graphics (radeonsi gfx1103_r1 LLVM 18.1.8 DRM 3.57
    6.9.9-zen1-1-zen)
domferr commented 1 month ago

Hey, thank you for opening this issue. To investigate further, it would be awesome to read some logs! Can you run journalctl -b /usr/bin/gnome-shell -n 300 --no-pager and look for something like this? Thank you

lug 14 21:39:33 domenico-laptop gnome-shell[58759]: [tilingshell] [extension] building a tiling manager for each monitor
lug 14 21:39:33 domenico-laptop gnome-shell[58759]: [tilingshell] [TilingManager 0] Work area for monitor 0: 192 27 3440x1413
lug 14 21:39:33 domenico-laptop gnome-shell[58759]: [tilingshell] [TilingManager 1] Work area for monitor 1: 0 1440 3840x2160
lug 14 21:39:33 domenico-laptop gnome-shell[58759]: [tilingshell] [extension] extension is enabled
lug 14 21:39:33 domenico-laptop gnome-shell[58759]: [tilingshell] [extension] building a tiling manager for each monitor
lug 14 21:39:33 domenico-laptop gnome-shell[58759]: [tilingshell] [TilingManager 0] Work area for monitor 0: 192 33 3440x1407
lug 14 21:39:33 domenico-laptop gnome-shell[58759]: [tilingshell] [TilingManager 1] Work area for monitor 1: 0 1440 3840x2160
lug 14 21:39:33 domenico-laptop gnome-shell[58759]: [tilingshell] [DefaultMenu] [{"name":"LG Electronics 34\"","x":192,"y":0,"width":3440,"height":1440},{"name":"Built-in display","x":0,"y":1440,"width":3840,"height":2160}]

If you don't see it, maybe the logs are far in time. You can restart (or logout/login) or you can increase the value of -n which I set to 300 on that command. Thanks

EfogDev commented 1 month ago

@domferr sure thing, here you go:

Jul 14 23:21:17 efog-laptop gnome-shell[1889]: [tilingshell] [extension] building a tiling manager for each monitor
Jul 14 23:21:17 efog-laptop gnome-shell[1889]: [tilingshell] [TilingManager 0] Work area for monitor 0: 2880 0 2560x1440
Jul 14 23:21:17 efog-laptop gnome-shell[1889]: [tilingshell] [TilingManager 1] Work area for monitor 1: 0 937 2880x1736
Jul 14 23:21:17 efog-laptop gnome-shell[1889]: [tilingshell] [DefaultMenu] [{"name":"Built-in display","x":0,"y":436,"width":1440,"height":900},{"name":"Samsung Electric Company 27\"","x":2880,"y":0,"width":2560,"height":1440}]

Samsung is 2560x1440 with 1x scale and the builtin is 2880x1800 with 2x scale (so it seems correct here).

domferr commented 1 month ago

Wow, this is strange!

Work area for monitor 0: 2880 0 2560x1440: this is the Samsung one. It is correctly recognized by the DefaultMenu's script. Work area for monitor 1: 0 937 2880x1736: this is the built-in display and it is NOT recognized correctly (the name is there but the coordinates and the sizes are wrong)

Moreover, the order is different ahahah your current situation is basically against all the assumptions behind how the indicator draws the layouts! Hold on a minute, I'm attaching to you a possible bug fix. Meanwhile, are you on Wayland or X11?

domferr commented 1 month ago

Here it is. Let me know if it solves the problem. This is a quick fix, may not work, but at least we tried ;)

tilingshell@ferrarodomenico.com.zip

EfogDev commented 1 month ago

I'm on Wayland. Will try the build right now.

EfogDev commented 1 month ago

@domferr well idk why "monitor 2" but its better now :)

image

EfogDev commented 1 month ago

Also my primary monitor is the builtin one. It is really weird it is listed as second. I'd prefer it to be the first one but whatever, its fine. Thanks for your help!

domferr commented 1 month ago

Oh that's greaaat! :partying_face:

You're welcome! The problem you had was caused by two issues: the DefaultMenu finds a monitor named "Built-in display" with wrong coordinates and sizes, and the order of the monitor found by DefaultMenu is wrong.

I solved the ordering problem, so now the Built-in display is the second one. At least you can use the multi-monitor feature now ahahah

Meanwhile I was able to reproduce the remaining unsolved problem on my laptop too! I had to turn on the fractional scaling. Can you confirm you have that setting enabled? Thank you

EfogDev commented 1 month ago

Hmm no I don't have it enabled, it is 200% for the builtin and 100% for the external one. I don't have the relevant setting in the dconf either.

domferr commented 1 month ago

Oh thank you for the feedback! I'll investigate eheheh

Please consider that you now have the upcoming release, so you may find something new somewhere ahaha (spoiler: right-click on window title :stuck_out_tongue_winking_eye:). Of course, if you prefer, I can share the bugfix with version v11.1.

However, next release is coming early next week and it will include the bug fix to this issue! :partying_face:

EfogDev commented 1 month ago

Also as I can see here:

(incorrect) [tilingshell] [TilingManager 1] Work area for monitor 1: 0 937 2880x1736
(correct) [tilingshell] [DefaultMenu] [{"name":"Built-in display","x":0,"y":436,"width":1440,"height":900},{"name":"Samsung Electric Company 27\"","x":2880,"y":0,"width":2560,"height":1440}]

There are different values, yours and what DefaultMenu returns, not sure you've seen that

EfogDev commented 1 month ago

Just to avoid confusion, here's the log from the latest version (the one with the fix)

Jul 14 23:50:09 efog-laptop gnome-shell[84952]: [tilingshell] [extension] building a tiling manager for each monitor
Jul 14 23:50:09 efog-laptop gnome-shell[84952]: [tilingshell] [TilingManager 0] Work area for monitor 0: 2880 0 2560x1440
Jul 14 23:50:09 efog-laptop gnome-shell[84952]: [tilingshell] [TilingManager 1] Work area for monitor 1: 0 937 2880x1736
Jul 14 23:50:09 efog-laptop gnome-shell[84952]: [tilingshell] [DefaultMenu] [{"name":"Samsung Electric Company 27\"","x":2880,"y":0,"width":2560,"height":1440},{"name":"Built-in display","x":0,"y":436,"width":1440,"height":900}]

I'm specifically talking about this difference: Work area for monitor 1: 0 937 2880x1736 "name":"Built-in display","x":0,"y":436,"width":1440,"height":900

domferr commented 1 month ago

Yeah. The problem of that log is that it is about the work area. I don't print the monitor coords anywhere, however the monitor's name is picked based on monitor coords. They may have different x and y (for example a monitor with a y of 0 may have a work area's y of 33 if that monitor has the top panel and the top panel has a height of 33).

But I don't get why the size is so much different (width of 2880 vs 1440 and height of 1736 vs 900). I expect the size to differ on the height only, based on the top panel height and where the top panel is.

EfogDev commented 1 month ago

Well it looks like the scaling factor of 2 isnt it? 1440x2 = 2880, 900x2 = 1800 minus top panel height

EfogDev commented 1 month ago

@domferr hey so the fixed build actually totally broke tiling with the keyboard, Win + arrows.

domferr commented 1 month ago

@domferr hey so the fixed build actually totally broke tiling with the keyboard, Win + arrows.

What do you mean? Feel free to open a new issue

EfogDev commented 1 month ago

@domferr sure, see https://github.com/domferr/tilingshell/issues/94