screengrab icon indicating copy to clipboard operation
screengrab copied to clipboard

Problem with multiple monitors + scale factors under X11

Open tsujan opened this issue 5 years ago • 3 comments

Steps to Reproduce (for bugs)
  1. Set the global Qt scale factor to 1.5 in LXQt Session Settings.
  2. Set up a double screen.
  3. Run screengrab.

Then its screenshots are ridiculous.

Screenshots are OK with either a double screen or a scale factor.

Possible Solution

I found the problem while fixing another problem. Will fix this one too when I feel motivated to do boring jobs.

System Information

Latest LXQt

tsujan avatar Jun 20 '20 07:06 tsujan

It's very likely that this is about a Qt bug. Also see https://github.com/lxqt/pcmanfm-qt/issues/1145

tsujan avatar Jun 20 '20 16:06 tsujan

The way screengrab does area capture is wrong. First it captures the whole thing (all screens), and then it tries to display it in your main monitor to select from (which obviously doesn't fit). Rather than just directly select from actual screen content like gimp and other screengrabbers (ie, from XFCE) do. Even if there is a qt bug, it is a poor design choice.

Artemis3v avatar Jun 23 '20 16:06 Artemis3v

Screengrab avoids dealing with X11 directly and uses QSreen::grabWindow. Generally, we avoid X11 codes everywhere and use the available Qt or tier-1 KDE methods instead.

As far as I tested with pcmanfm-qt (suffering from a similar issue with multi-screen + scale factors), the screen coordinates are reported correctly. Why the first screen is painted incorrectly, I don't know yet.

tsujan avatar Jun 23 '20 17:06 tsujan