Skip to content

Fix zoom pan glitches on Wayland#828

Open
pscheyen wants to merge 2 commits intoderf:masterfrom
pscheyen:fix-zoom-pan-wayland
Open

Fix zoom pan glitches on Wayland#828
pscheyen wants to merge 2 commits intoderf:masterfrom
pscheyen:fix-zoom-pan-wayland

Conversation

@pscheyen
Copy link
Copy Markdown
Contributor

BUG REPORT: At random times when pressing the zoom or pan keys, the zoom or pan will appear to be ignored or in the wrong direction. User experience is a very random.

  1. Preserve zoom and pan across ConfigureNotify events (it seems the Wayland compositor sends these events at unexpected times, triggering the had_resize code path and resetting zoom/recentering the image and clobbering the user's intent. Added a manual_zoom flag to winwidget, set on user zoom input and cleared on image load. When this flag is set, skip the zoom/position reset in the had_resize block.

  2. Force an immediate frame presentation after each render since Wayland batches XSetWindowBackgroundPixmap/XClearWindow requests.

focus was set to menu_cover on menu open but never restore on
hide (say after performing a File->Delete); on Xwayland RevertToPointerRoot
doesn't recover it; added an explicit call to XSetInputFocus back
to fehwin->win before destroying the cover window.
… times when pressing the zoom or pan keys, the zoom or pan will appear to be ignored or in the wrong direction. User experience is a very random experience.

Two related fixes:
1. Preserve zoom and pan across ConfigureNotify events (it seems the Wayland compositor sends these events at unexpected times, triggering the had_resize code path and resetting zoom/recentering the image and clobbering the user's intent.  Added a manual_zoom flag to winwidget, set on user zoom input and cleared on image load.  When this flag is set, skip the zoom/position reset in the had_resize block.

2. Force an immediate frame presentation after each render since Wayland batches XSetWindowBackgroundPixmap/XClearWindow requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant