Fix computing screen geometry on multiple HiDPI monitors
Needs ReviewPublic

Authored by printesoi on Mon, May 11, 9:44 PM.

Details

Summary

When using setups with multiple HiDPI displays, Yakuake did not show up on all the other monitors except for the top-left one, due to the fact that the screen geometry is not properly computed, so the getDesktopGeometry returns QRect(0,0 0x0). The QScreen::geometry() method appears to behave "weird" on HiDPI displays: the top left corner is given in physical pixels, while the width,height are in device independent pixels. For example, if using two 4K displays, one on top and one on bottom, the QScreen::geometry() will return for the bottom monitor QRect(0,2160 1920x1080).

This also needs https://phabricator.kde.org/D29569 to properly show on such setups.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
printesoi requested review of this revision.Mon, May 11, 9:44 PM
printesoi created this revision.
printesoi added reviewers: hein, ngraham, mweepigeon.
mweepigeon resigned from this revision.Mon, May 11, 10:00 PM

Afraid I don't have HiDPI displays to test with. Glad the issue is finally seeing work though!

printesoi updated this revision to Diff 82648.Tue, May 12, 11:15 AM

Fixed a problem in MainWindow::getScreen() due to the fact the list of screens is 0 based while Yakuake stores the screen number starting from 1.

printesoi updated this revision to Diff 82864.Thu, May 14, 3:34 PM

Fix crash when unplugging monitor on which Yakuake is set to open

Thanks! This might get a bit more attention if you re-submit it as a merge request at https://invent.kde.org/utilities/yakuake/-/merge_requests, now that KDE has moved patch review to GitLab. Here's some documentation if you're unfamiliar with the workflow: https://community.kde.org/Infrastructure/GitLab