1 |
commit: e5f1554d74e6ef57cf96b7ba67f361c784e645d1 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 4 12:35:58 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 4 13:12:42 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5f1554d |
7 |
|
8 |
kde-plasma/kwin: Fix build on problematic platforms |
9 |
|
10 |
Upstream commit df11acd46778e1e43183c2660bc9dcb1a8ad3282 |
11 |
|
12 |
Reported-by: David Flogeras <dflogeras2 <AT> gmail.com> |
13 |
Closes: https://bugs.gentoo.org/813228 |
14 |
Package-Manager: Portage-3.0.26, Repoman-3.0.3 |
15 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
16 |
|
17 |
.../kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch | 35 +++++++++++++++------- |
18 |
1 file changed, 25 insertions(+), 10 deletions(-) |
19 |
|
20 |
diff --git a/kde-plasma/kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch b/kde-plasma/kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch |
21 |
index 6db52bdd749..d185d5e41fe 100644 |
22 |
--- a/kde-plasma/kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch |
23 |
+++ b/kde-plasma/kwin/files/kwin-5.22.5-libglvnd-1.3.4.patch |
24 |
@@ -12,15 +12,30 @@ BUG: 440372 |
25 |
* asturm 2021-09-21: Merged with upstream commits: |
26 |
38e24ecd6416a975db0989c21b70d6a4cc242f35 "Fix build with 32-bit" |
27 |
e26ea6bf2313c021db7e5ca5454cd8b1e2e2037f "Fix build on 32bit platforms" |
28 |
+ |
29 |
+* asturm 2021-10-04: Merged with upstream commit: |
30 |
+From df11acd46778e1e43183c2660bc9dcb1a8ad3282 Mon Sep 17 00:00:00 2001 |
31 |
+From: Vlad Zahorodnii <vlad.zahorodnii@×××.org> |
32 |
+Date: Tue, 21 Sep 2021 17:34:59 +0300 |
33 |
+Subject: [PATCH] x11: Cast Window to EGLNativeWindowType using a C cast |
34 |
+ |
35 |
+reinterpret_cast<>() will fail if the types we cast from and to have |
36 |
+mismatching sizes. |
37 |
+ |
38 |
+Unfortunately, there are platforms that have Window and |
39 |
+EGLNativeWindowType of different size. This results in compilation |
40 |
+errors. |
41 |
+ |
42 |
+In order to work around those problematic platforms, this change |
43 |
+replaces reinterpret_cast cast with a c style cast. |
44 |
--- |
45 |
- src/plugins/platforms/x11/common/eglonxbackend.cpp | 13 +++++++------ |
46 |
- 1 file changed, 7 insertions(+), 6 deletions(-) |
47 |
+ src/plugins/platforms/x11/common/eglonxbackend.cpp | 16 +++++++++------ |
48 |
+ 1 file changed, 10 insertions(+), 6 deletions(-) |
49 |
|
50 |
-diff --git a/src/plugins/platforms/x11/common/eglonxbackend.cpp b/src/plugins/platforms/x11/common/eglonxbackend.cpp |
51 |
-index c62ec170d..d2900c7c3 100644 |
52 |
+diff -u a/src/plugins/platforms/x11/common/eglonxbackend.cpp b/src/plugins/platforms/x11/common/eglonxbackend.cpp |
53 |
--- a/src/plugins/platforms/x11/common/eglonxbackend.cpp |
54 |
+++ b/src/plugins/platforms/x11/common/eglonxbackend.cpp |
55 |
-@@ -213,15 +213,16 @@ EGLSurface EglOnXBackend::createSurface(xcb_window_t window) |
56 |
+@@ -213,15 +213,19 @@ |
57 |
return EGL_NO_SURFACE; |
58 |
} |
59 |
|
60 |
@@ -38,11 +53,11 @@ index c62ec170d..d2900c7c3 100644 |
61 |
+ surface = eglCreatePlatformWindowSurfaceEXT(eglDisplay(), config(), (void *) &nativeWindow, nullptr); |
62 |
} else { |
63 |
- surface = eglCreateWindowSurface(eglDisplay(), config(), window, nullptr); |
64 |
-+ // eglCreateWindowSurface() expects a Window, not a pointer to the Window. |
65 |
-+ surface = eglCreateWindowSurface(eglDisplay(), config(), reinterpret_cast<EGLNativeWindowType>(nativeWindow), nullptr); |
66 |
++ // eglCreateWindowSurface() expects a Window, not a pointer to the Window. Use |
67 |
++ // a c style cast as there are (buggy) platforms where the size of the Window |
68 |
++ // type is not the same as the size of EGLNativeWindowType, reinterpret_cast<>() |
69 |
++ // may not compile. |
70 |
++ surface = eglCreateWindowSurface(eglDisplay(), config(), (EGLNativeWindowType) nativeWindow, nullptr); |
71 |
} |
72 |
|
73 |
return surface; |
74 |
--- |
75 |
-GitLab |
76 |
- |