[PATCH weston 2/2] shell/zoom: Increment/decrement disable_planes only when zoom.active changes
Ander Conselvan de Oliveira
ander.conselvan.de.oliveira at intel.com
Fri Nov 16 01:48:47 PST 2012
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
disable_planes should only be incremented when zoom.active actually
toggles. Otherwise the counter will be incremented too many times,
and planes will no longer get used.
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
---
src/shell.c | 2 +-
src/zoom.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/shell.c b/src/shell.c
index cccfe66..6bd89ec 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -2438,7 +2438,7 @@ do_zoom(struct wl_seat *seat, uint32_t time, uint32_t key, uint32_t axis,
output->zoom.level = 0.0;
else if (output->zoom.level > output->zoom.max_level)
output->zoom.level = output->zoom.max_level;
- else {
+ else if (!output->zoom.active) {
output->zoom.active = 1;
output->disable_planes++;
}
diff --git a/src/zoom.c b/src/zoom.c
index 674a80e..3be27f6 100644
--- a/src/zoom.c
+++ b/src/zoom.c
@@ -123,7 +123,7 @@ weston_zoom_frame_z(struct weston_animation *animation,
output->zoom.spring_z.current = 0.0;
if (weston_spring_done(&output->zoom.spring_z)) {
- if (output->zoom.level <= 0.0) {
+ if (output->zoom.active && output->zoom.level <= 0.0) {
output->zoom.active = 0;
output->disable_planes--;
}
--
1.7.10.4
More information about the wayland-devel
mailing list