Fix offset issue in dual hidpi screen
Needs ReviewPublic

Authored by guoyunhe on Sep 17 2019, 8:09 PM.

Details

Reviewers
None
Group Reviewers
Spectacle
Summary

The issue is caused by Qt's weired geometry in X11. Though we set position (0, 0), Qt will place it to somewhere like (0, -640) or (-640, 0), depending on your screen layouts. The fix is ugly but it works: detect position, if it is negtive, set it to 0.

BUG: 385885

Diff Detail

Repository
R166 Spectacle
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16710
Build 16728: arc lint + arc unit
guoyunhe created this revision.Sep 17 2019, 8:09 PM
Restricted Application added a project: Spectacle. · View Herald TranscriptSep 17 2019, 8:09 PM
Restricted Application added a subscriber: Spectacle. · View Herald Transcript
guoyunhe requested review of this revision.Sep 17 2019, 8:09 PM
guoyunhe edited the summary of this revision. (Show Details)Sep 17 2019, 8:10 PM
guoyunhe added a reviewer: Spectacle.
guoyunhe edited the summary of this revision. (Show Details)Sep 17 2019, 8:14 PM
ngraham edited the summary of this revision. (Show Details)Sep 17 2019, 8:31 PM
ngraham added inline comments.
src/QuickEditor/QuickEditor.cpp
486

Coding style:

int newX = x();
int newY = y();
guoyunhe updated this revision to Diff 66341.Sep 17 2019, 8:54 PM

Better code style

guoyunhe marked an inline comment as done.Sep 17 2019, 8:55 PM

Nice! The code change seems same given the bug we're working around, and this doesn't seem to regress anything for me, but I can't test the fix since I don't have two high DPI screens. Hopefully someone with this kind of hardware can give the patch a whirl.

thiago added a subscriber: thiago.Sep 17 2019, 10:16 PM

This really needs to be fixed in Qt. 5.13.1 has an overhaul of the system, please make sure that the patch is still required there and does not make things worse.

And please report positioning issues that you can reproduce in https://bugreports.qt.io/browse/QTBUG-77086

This really needs to be fixed in Qt. 5.13.1 has an overhaul of the system, please make sure that the patch is still required there and does not make things worse.

And please report positioning issues that you can reproduce in https://bugreports.qt.io/browse/QTBUG-77086

I am testing with Qt 5.13.1. I didn't see they are planning to fix it soon in Qt. The patch doesn't have any side effects in my test.