Make sure the tray icon point is in screen coordinates
authorKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 15 Jul 2020 09:23:11 +0000 (11:23 +0200)
committerKevin Ottens <ervin@ipsquad.net>
Wed, 15 Jul 2020 10:22:54 +0000 (12:22 +0200)
commit6b8d2270c6ff6b56ddc25f0536db430a3b7dbbf5
tree0938437dea821b9c9d6dd879f4432cbbabb47e57
parent2c50ecd4d39d85c0ca8782b3cd1bdc4329e9016f
Make sure the tray icon point is in screen coordinates

Previously we were using QCursor::pos() in the Linux case, which is a
fair heuristic except it will always be relative to the primary screen
and not the current screen. This explains why we had to adjust with the
virtual geometry.

In the Windows and Mac case we got the position out of QSystemTrayIcon
and that one was already relative to the current screen.

So now we use QCursor::pos(currentScreen()) which ensures we give the
coordinates relatively to the current screen also in the Linux case.

Since all platforms are now having that point in the same coordinate
system we don't need to mess around with the virtual geometry to
compensate.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/systray.cpp