summaryrefslogtreecommitdiffstats
path: root/src/webview.h
diff options
context:
space:
mode:
authorSimon Rettberg2021-10-25 13:51:12 +0200
committerSimon Rettberg2021-10-25 13:59:43 +0200
commit1e0ee56159ce0c11138c3dfd8c011ad33a86e8a8 (patch)
tree63b2f4490aeecad3d3b575611e06011797ef065f /src/webview.h
parentAdd "Mobile" to User-Agent header for embedded browser (diff)
downloadslxgreeter-1e0ee56159ce0c11138c3dfd8c011ad33a86e8a8.tar.gz
slxgreeter-1e0ee56159ce0c11138c3dfd8c011ad33a86e8a8.tar.xz
slxgreeter-1e0ee56159ce0c11138c3dfd8c011ad33a86e8a8.zip
Webview: Use keyboard & mouse input to track inactivity
Using page loads to track inactivity breaks on SPA websites. Use user input instead.
Diffstat (limited to 'src/webview.h')
-rw-r--r--src/webview.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/webview.h b/src/webview.h
index 79b4a64..a03d517 100644
--- a/src/webview.h
+++ b/src/webview.h
@@ -20,7 +20,12 @@ public:
void reset(const QString baseUrl);
protected:
- QWebView *createWindow(QWebPage::WebWindowType);
+ QWebView *createWindow(QWebPage::WebWindowType) override;
+ void mousePressEvent(QMouseEvent*) override;
+ void keyPressEvent(QKeyEvent*) override;
+ void wheelEvent(QWheelEvent*) override;
+
+ void resetTimeout();
signals:
void triggerReset(const QString &message);
@@ -37,6 +42,7 @@ private:
QStack<QUrl> _urls;
QTimer *_timerAbortMessage;
bool _abortedDownload;
+ bool _inErrorState;
QString _token;
QTimer *_timerReset;
};