morpheusthewhite / nordpy

A gui application to connect automatically to the recommended NordVPN server
GNU General Public License v3.0
105 stars 16 forks source link

Inconvenient centering with multiple displays #38

Closed emulti closed 4 years ago

emulti commented 4 years ago

When using nordpy with multiple monitors, the 'centering' code uses the dimensions of the extended desktop rather than (I suggest) 'screen 1', giving an odd position on setups with differently-sized displays.

Expected behavior nordpy window opens at centre of one of the screens

Actual behaviour nordpy opens at centre of extended desktop

Desktop (please complete the following information):

Very nice application, a lightweight alternative to the "official" nordvpn binary that doesn't use 200MB of memory.

emulti commented 4 years ago

The font scaling behaviour with multiple displays could also be improved. Gnome/Xorg: Fonts appear very tiny unless only one display connected. Probably because dimensions of extended desktop are used in calculating the font size. If only one display connected the behaviour is perfect.

Gnome/Wayland (+ XWayland) Multiple displays: Fonts are slightly larger than normal Single display: normal behaviour.

morpheusthewhite commented 4 years ago

The font scaling behaviour with multiple displays could also be improved. Gnome/Xorg: Fonts appear very tiny unless only one display connected. Probably because dimensions of extended desktop are used in calculating the font size. If only one display connected the behaviour is perfect.

That's strange since the actual size of the font is unchanged in the application, it completely relies on the tkinter library in that sense.

emulti commented 4 years ago

Font size under Wayland is the same with both single/multiple screens. (I was wrong earlier, the dpi is different between the two screens.)

Under Xorg, single screen: xorg_single screen

Xorg, two screens: xorg_two screens

Obviously the centering of the window (which uses self.winfo_screenwidth()) is a separate issue

morpheusthewhite commented 4 years ago

I created a new issue to reference this last problem

emulti commented 4 years ago

Correct, having solved #40 the issue is confined to the centering on startup only.

morpheusthewhite commented 4 years ago

Just installing screeninfo (pip3 install screeninfo) will fix the centering