lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.28k stars 161 forks source link

How does tilda manage to set positions for multiple (extended) displays correctly? #353

Closed nspiller closed 6 years ago

nspiller commented 6 years ago

Hi,

the seamless looks of tilda are truly awesome. That's why I am trying to find a way to set the location of my tilda windows automatically depending on the monitor setup I am using.

I wrote a script that determines – via xrandr – which display is currently primary and writes the corresponding show_on_monitor, x_pos, y_pos, max_width and max_height in the tilda config to send tilda to a certain location on the primary screen – for example 10 % from the top and 20 % from the left.

This works great for a single monitor, but my current setup is laptop screen on the left (secondary) and big screen on the right (primary). The max_width and max_height are correct for me, but the x_pos and y_pos are apparently determined from the top left corner of the laptop (secondary) screen. The show_on_monitor setting has no effect on the origin of the coordinate system.

How does tilda know, that there is a secondary monitor to the left and that is has to take the relative position of that one into account?

Best, Nico

nspiller commented 6 years ago

I figured it out, the information was also given in xrandr for the primary display:

DP1 connected primary 2560x1440+1920+0 (normal left inverted right x axis y axis) 597mm x 336mm

In order to set the right coordinate system on the primary display, I had to use 2560 + 1920 for x_pos and 1440 + 0 for y_pos

I was using Cinnamon 3.6.7 (Gtk 3.18.9-1ubuntu3.3).