Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad multimonitor support for tile-window #396

Closed
JonasLoos opened this issue Nov 25, 2020 · 3 comments
Closed

bad multimonitor support for tile-window #396

JonasLoos opened this issue Nov 25, 2020 · 3 comments
Assignees
Milestone

Comments

@JonasLoos
Copy link

JonasLoos commented Nov 25, 2020

Describe the bug

When swiping 3 fingers right or left for window-tiling on my second display the windows are placed at bad positions. The top window-position seems to be calculated using the main display position-data, so in my case there is a gap on top of the newly placed window.

The left, bottom and right sides of the window seem to be placed correctly. Maximizing the window works fine. The standard keyboard shortcut for window tiling (e.g. super+left) works fine.

Steps to reproduce

  1. Connect a second monitor
  2. (maybe optional) in gnome display settings, arrange the monitors with an offset
  3. on the second monitor, swipe right/left with 3 fingers on any application

Expected behaviour

The window should take up half the monitor, without any gaps.

Your environment

  • Version of Touchégg: v2.0.3 (.deb)
  • Operating System: Ubuntu
  • Desktop Environment: Gnome 3.38.1
@JoseExposito
Copy link
Owner

TL;DR: I'll try to fix this

Hi!

Thanks for your bug report!!

In order to calculate the space the window should use, I read this property:
https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm46165187160080

In case you are curios, you can see the value running this command:

$ xprop -root | grep "_NET_WORKAREA(CARDINAL)"
_NET_WORKAREA(CARDINAL) = 0, 30, 3840, 1050

As you can see, this property it is a rectangle indicating what parts of your screen are not being used by panels. That 30 means that my panel has a height of 30px, but there is no distinction between the primary display (the one with the panel) and the secondary display (without panel).
There is no standard way to calculate this.

However, it looks like Gnome is implementing a non standard property that I could use to fix your issue:

$ xprop -root | grep _GTK_WORKAREAS_D 

Note for my future self trying to fix this:

  • Use _GTK_WORKAREAS_DX when it is available
  • Check if there is something similar in KDE

@JonasLoos
Copy link
Author

Don't know if this is relevant, but for me the command returns 8 numbers:

# single monitor
$ xprop -root | grep "_NET_WORKAREA(CARDINAL)"
_NET_WORKAREA(CARDINAL) = 0, 54, 3840, 2346, 0, 54, 3840, 2346
$ xprop -root | grep _GTK_WORKAREAS_D 
_GTK_WORKAREAS_D3(CARDINAL) = 0, 0, 3840, 2160, 3840, 54, 3840, 2346
_GTK_WORKAREAS_D2(CARDINAL) = 0, 0, 3840, 2160, 3840, 54, 3840, 2346
_GTK_WORKAREAS_D1(CARDINAL) = 0, 54, 3840, 2346
_GTK_WORKAREAS_D0(CARDINAL) = 0, 54, 3840, 2346

# 2nd monitor plugged in
$ xprop -root | grep "_NET_WORKAREA(CARDINAL)"
_NET_WORKAREA(CARDINAL) = 0, 865, 7680, 2346, 0, 865, 7680, 2346
$ xprop -root | grep _GTK_WORKAREAS_D
_GTK_WORKAREAS_D3(CARDINAL) = 0, 0, 3840, 2160, 3840, 54, 3840, 2346
_GTK_WORKAREAS_D2(CARDINAL) = 0, 0, 3840, 2160, 3840, 54, 3840, 2346
_GTK_WORKAREAS_D1(CARDINAL) = 0, 0, 3840, 2160, 3840, 865, 3840, 2346
_GTK_WORKAREAS_D0(CARDINAL) = 0, 0, 3840, 2160, 3840, 865, 3840, 2346

This is the way my monitors are arranged:
image

@JoseExposito JoseExposito added this to the 2.0.4 milestone Dec 4, 2020
@JoseExposito JoseExposito self-assigned this Dec 4, 2020
@JoseExposito
Copy link
Owner

Just fixed it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants