summaryrefslogtreecommitdiff
path: root/kde-frameworks/khtml/files/khtml-5.90.0-fix-crash-in-wayland.patch
blob: c6ed3499803706806971e884a0d5f31b439d20e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 04aa1739d06d3ff7d16a3296fd27fa392d8ba318 Mon Sep 17 00:00:00 2001
From: Christoph Cullmann <cullmann@kde.org>
Date: Sat, 1 Jan 2022 23:42:16 +0100
Subject: [PATCH] fix khtml crash in wayland session

---
 src/khtmlview.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/khtmlview.cpp b/src/khtmlview.cpp
index 79f0d7c..75df959 100644
--- a/src/khtmlview.cpp
+++ b/src/khtmlview.cpp
@@ -69,6 +69,7 @@
 #include <kstringhandler.h>
 #include <kconfiggroup.h>
 #include <ksharedconfig.h>
+#include <KWindowSystem>
 
 #include <QBitmap>
 #include <QDialog>
@@ -1530,7 +1531,8 @@ void KHTMLView::mouseMoveEvent(QMouseEvent *_mouse)
 
     if (linkCursor != LINK_NORMAL && isVisible() && hasFocus()) {
 #if HAVE_X11
-
+    // ensure we don't trigger this code paths if we run in a Wayland session
+    if (KWindowSystem::isPlatformX11()) {
         if (!d->cursorIconWidget) {
 #if HAVE_X11
             d->cursorIconWidget = new QLabel(nullptr, Qt::X11BypassWindowManagerHint);
@@ -1572,6 +1574,7 @@ void KHTMLView::mouseMoveEvent(QMouseEvent *_mouse)
         //TODO?
 #endif
         d->cursorIconWidget->show();
+      }
 #endif
     } else if (d->cursorIconWidget) {
         d->cursorIconWidget->hide();
-- 
GitLab