From d6ba00883ef524155569dfcb059bb2988be9e3a2 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 1 Dec 2011 03:47:19 +0000 Subject: [PATCH] Fix infinite loop when opening video with wxgtk Originally committed to SVN as r5954. --- aegisub/src/video_display.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index 07a78ccbb..63681b411 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -312,18 +312,21 @@ void VideoDisplay::UpdateSize(int arType, double arValue) { viewport_height = h; wxSize size(cw, ch); - SetMinClientSize(size); - SetMaxClientSize(size); + if (size != GetClientSize()) { + SetMinClientSize(size); + SetMaxClientSize(size); - SetEvtHandlerEnabled(false); - GetGrandParent()->Layout(); + SetEvtHandlerEnabled(false); + GetGrandParent()->Layout(); - // The sizer makes us use the full width, which at very low zoom levels - // results in stretched video, so after using the sizer to update the - // parent window sizes, reset our size to the correct value - SetSize(cw, ch); + // The sizer makes us use the full width, which at very low zoom + // levels results in stretched video, so after using the sizer to + // update the parent window sizes, reset our size to the correct + // value + SetSize(cw, ch); - SetEvtHandlerEnabled(true); + SetEvtHandlerEnabled(true); + } } if (tool.get())