pdulvp.fr

Horizontal wheel over the desktop switches screens, with a slide has been fixed.

See more details at : https://github.com/pdulvp/pmane-sa/issues/3

  • a wheel tilted left or right over the bare desktop moves to the previous or

the next screen in menu order, one notch per screen and no wrap at the ends

  • every screen change, the Screens menu and Ctrl+1..9 included, is shown as

a slide: the screen leaving goes off one side as the arriving one comes in

  • ScreenTransition paints that slide from two grabs of the MDI viewport,

taken before and after the swap, rather than moving the real group windows,
so the new desktop is simply uncovered when the animation ends

  • the overlay is opaque and blits at a point: without that, each frame

repainted the viewport and every group window of the screen arriving, which
showed as a slide that dragged in one direction only

  • sendPostedEvents() before the second grab, since qApp->setPalette() posts

its change events: a screen with a theme of its own was otherwise pictured in
the colours of the one being left, and only took its own once the slide ended

  • the picture of the screen being left is held over the desktop while it is

emptied and rebuilt, so the repaint that same flush delivers is covered
instead of showing as a blink before the slide

Horizontal wheel on the desktop switches screens, with a sliding animation

<sub>2026-10-29-1245-horizontal-wheel-switches-screens-with-a-slide.md — 2026-10-29 12:45</sub>

A tilt of the mouse wheel left or right over the bare desktop (the MDI area's
viewport, not a group window) moves to the previous or the next screen in menu
order. The change is shown as a slide: the screen leaving moves off one side
while the screen arriving comes in from the other.

Decisions

  • Menu order (ScreenManager::names()) is the order stepped through. No wrap:

a tilt at either end does nothing.

  • angleDelta().x() is positive when the wheel is tilted left, so positive

steps to the previous screen. Deltas are accumulated and one step is taken
per 120 units, so a free-spinning or touchpad gesture does not jump several
screens at once.

  • The animation is a painted overlay, not a real move of the windows: the

viewport is grabbed before the switch and again after it, and the two
pictures are slid across a child widget raised above the group windows. The
new desktop is already in place behind it, so nothing has to be put back
when the animation ends.

  • The slide runs for every screen change through switchToScreen(), so the

Screen menu and Ctrl+1..9 get it too; creating or duplicating a screen does
not animate.

Steps

  • [x] 1. src/ScreenTransition.{h,cpp}: the overlay widget. `run(outgoing,

incoming, direction)` fills the parent, paints both pictures at the
offset the animation is at, and hides itself when it finishes.

  • [x] 2. CMakeLists.txt: the two files in PMANE_SOURCES.
  • [x] 3. src/MainWindow.{h,cpp}: create the overlay on the viewport; in

switchToScreen() grab before and after and start the slide.

  • [x] 4. src/MainWindow.cpp eventFilter(): the wheel on the viewport,

accumulated, stepping to the neighbouring screen; the event is consumed
so the MDI area does not scroll instead.

  • [x] 5. Build, and run the desktop to check the slide and both directions.
  • [x] 6. README: a line about the wheel in the screens section.

<sub>Filed by prel from the completed plans at commit time.</sub>