From fa90f9797c7ffb6fdd416ac2ebdde3e6dab2fb52 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 18 Oct 2013 00:51:52 +0200 Subject: GUI: Check for screen change whenever an event is polled. This should *hopefully* really fix all GUI crashes when resizing with OpenGL. --- gui/gui-manager.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gui/gui-manager.cpp') diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 1505c8c707..999d61e854 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -309,6 +309,19 @@ void GuiManager::runLoop() { Common::Event event; while (eventMan->pollEvent(event)) { + // We will need to check whether the screen changed while polling + // for an event here. While we do send EVENT_SCREEN_CHANGED + // whenever this happens we still cannot be sure that we get such + // an event immediately. For example, we might have an mouse move + // event queued before an screen changed event. In some rare cases + // this would make the GUI redraw (with the code a few lines + // below) when it is not yet updated for new overlay dimensions. + // As a result ScummVM would crash because it tries to copy data + // outside the actual overlay screen. + if (event.type != Common::EVENT_SCREEN_CHANGED) { + checkScreenChange(); + } + // The top dialog can change during the event loop. In that case, flush all the // dialog-related events since they were probably generated while the old dialog // was still visible, and therefore not intended for the new one. -- cgit v1.2.3 From f5dfe6725a8f25bf53bf6dcce247f89bd5a26001 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:20 +0100 Subject: GUI: Make GPL headers consistent in themselves. --- gui/gui-manager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'gui/gui-manager.cpp') diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 999d61e854..80c3c2a552 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -17,6 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * */ #include "common/events.h" -- cgit v1.2.3