Commit 9247a25c04f3c39825ddc807bb7eb6570f5b5655 Parent: 764d9cf329b641a2da4924235ac2d719ba8b3b35 Author: mcol <mcol@posteo.net> Date: 2021-02-12 10:49:49 +0000 Committer: mcol <mcol@posteo.net> Committed: 2021-02-12 10:49:49 +0000 pan_to_view: only damage when panning required
src/shell.c Modified
@@ -149,19 +149,25 @@ .is_percentage = false, }; + int panning = 2; if (x < 0) { motion.dx = x * zoom; } else if (x + width > extents->width / zoom) { motion.dx = (x + width) * zoom - extents->width; + } else { + panning -= 1; } if (y < 0) { motion.dy = y * zoom; } else if (y + height > extents->height / zoom) { motion.dy = (y + height) * zoom - extents->height; + } else { + panning -= 1; + } + if (panning) { + pan_desk(&motion); + damage_all_outputs(); } - pan_desk(&motion); - - damage_all_outputs(); }