From 3ed00d3be75ee56169882dfedf12b5207f832b51 Mon Sep 17 00:00:00 2001 From: Neel Patel Date: Wed, 10 May 2017 13:34:39 +0530 Subject: [PATCH] 1) Fixed compilation issue with QT4. 2) Make trigger action 'RequestClose' backword compatible with annulen webkit. --- runtime/BrowserWindow.cpp | 13 ++++++++++--- runtime/BrowserWindow.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/runtime/BrowserWindow.cpp b/runtime/BrowserWindow.cpp index 482a2bd38..391b884a2 100644 --- a/runtime/BrowserWindow.cpp +++ b/runtime/BrowserWindow.cpp @@ -835,9 +835,16 @@ void BrowserWindow::closetabs() webviewPtr = dynamic_cast(widgetPtr); if (webviewPtr != NULL) { - // Trigger the action for tab window close so unload event - // will be called and resources will be freed properly. - webviewPtr->page()->triggerAction(QWebPage::RequestClose); + /* Trigger the action for tab window close so unload event will be called and + * resources will be freed properly. + * Trigger 'RequestClose' action from Qt5 onwards. Here we have triggerred the action + * 'ToggleVideoFullscreen + 1' because we do not know from which webkit + * version 'RequestClose' action was added so increment with previous enum value so that + * it will be backward webkit version compatible. + */ + #if QT_VERSION >= 0x050000 + webviewPtr->page()->triggerAction(static_cast(QWebPage::ToggleVideoFullscreen + 1)); + #endif } } } diff --git a/runtime/BrowserWindow.h b/runtime/BrowserWindow.h index 35f673645..1465a48e8 100644 --- a/runtime/BrowserWindow.h +++ b/runtime/BrowserWindow.h @@ -33,6 +33,8 @@ #include #else #include + #include + #include #endif #endif