From a0ed5d62fdcd46b34b055c1c42001529c038e15c Mon Sep 17 00:00:00 2001 From: Alexander Kojevnikov Date: Wed, 7 Jul 2010 18:45:12 +1000 Subject: [PATCH] Re-analyse only if the window width has been changed --- src/spek-spectrogram.vala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/spek-spectrogram.vala b/src/spek-spectrogram.vala index 8d350dd..9afd0b5 100644 --- a/src/spek-spectrogram.vala +++ b/src/spek-spectrogram.vala @@ -94,10 +94,14 @@ namespace Spek { queue_draw (); } + private int prev_width = -1; private override void size_allocate (Gdk.Rectangle allocation) { base.size_allocate (allocation); - if (file_name != null) { + bool width_changed = prev_width != allocation.width; + prev_width = allocation.width; + + if (file_name != null && width_changed) { start (); } }