Skip to content
Verified Commit ef7affd1 authored by snooxx 💤's avatar snooxx 💤
Browse files

Restore grabbing taskbar and multiple screens

39f712a2 also prevented KMag from showing the taskbar in a single-screen
setup as well as content on secondary screens in a multi-screen setup,
because `screen()->availableGeometry()->width()` is not a suitable
replacement for `QApplication::desktop()->width()`.

Qt provides a multitude of options, even when not using deprecated
functions the original commit tried to port away from:
`availableGeometry()`, `availableVirtualGeometry()`, `virtualGeometry()`
and `geometry()`. To include all screens, the `virtual*` variants are
needed, while on single screens the `available*` variants do not include
the area covered by the taskbar. Therefore for the purpose of KMag,
which should show everything, `virtualGeometry()` is the correct
function to use, switching to the more specific `virtualSize()` when
applicable.

In addition, in `KMagZoomView::mouseMoveEvent` we can eliminate one
extra unneeded variable inside a block, hiding the identically
functioning variable of the same name outside that block.

Test Plan:
  - Taskbar shows on single screen-screen setup.
  - All screens in a multi-screen setup can be magnified, gaps between
    screens are correctly shown with black bars.
  - Cursor position is correct everywhere.
  - HiDPI mode works too.
  - Note 1: KMag currently only supports X11.
  - Note 2: Testing was only performed with Qt5.
  - Note 3: Choose "Mouse Mode", since "Window Mode" has been partially
    broken way back in 095196f3 already and "Screen Edge Mode" from
    1884b51a as a replacement for the questionable "Screen Mode" has
    never been forward-ported to the Qt4 branch created before that
    commit.
parent ec406590
Pipeline #151703 skipped
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment