Skip to content

Fix grabbing for multi-screen configurations

Anton Anikin requested to merge antonanikin/kmag:master into master

The old version always uses the primary screen to capture the image. This leads to problems for some variants of multi-screen configurations. For example, my system uses 2 displays, the primary screen is on the right, but the "zero" of cursor position corresponds to the top-left corner of the left screen. This leads to the grabbing of some "garbage" when moving the cursor on the right (primary) screen, and to the grabbing of the right screen content when moving the cursor on the left screen -- looks like madness :).

The new version selects the correct screen corresponding to the cursor position and also uses relative (to the selected screen) coordinates instead of absolute ones to grabbing the image.

Merge request reports