1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

MouseGestures: Restore force context on mouse release value on plugin unload

This commit is contained in:
David Rosca 2017-01-22 09:45:24 +01:00
parent e4d7445c77
commit 0dd682d317
2 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
/* ============================================================
* Mouse Gestures plugin for QupZilla
* Copyright (C) 2013-2016 David Rosca <nowrep@gmail.com>
* Copyright (C) 2013-2017 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -306,6 +306,7 @@ void MouseGestures::init()
initFilter();
// We need to override right mouse button events
m_oldWebViewForceContextMenuOnRelease = WebView::forceContextMenuOnMouseRelease();
WebView::setForceContextMenuOnMouseRelease(m_button == Qt::RightButton || m_enableRockerNavigation);
}
@ -389,4 +390,7 @@ MouseGestures::~MouseGestures()
{
m_filter->clearGestures(true);
delete m_filter;
// Restore original value
WebView::setForceContextMenuOnMouseRelease(m_oldWebViewForceContextMenuOnRelease);
}

View File

@ -1,6 +1,6 @@
/* ============================================================
* Mouse Gestures plugin for QupZilla
* Copyright (C) 2012-2014 David Rosca <nowrep@gmail.com>
* Copyright (C) 2012-2017 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -80,6 +80,8 @@ private:
bool m_blockNextRightMouseRelease;
bool m_blockNextLeftMouseRelease;
bool m_oldWebViewForceContextMenuOnRelease = false;
};
#endif // MOUSEGESTURES_H