summaryrefslogtreecommitdiff
blob: 34249bb1d7dc0fc6d6378b395349d9962654793a (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
From babd8078cc92b3f46dbab0286d7629ada1c2d10f Mon Sep 17 00:00:00 2001
From: David Redondo <kde@david-redondo.de>
Date: Tue, 22 Mar 2022 10:52:04 +0100
Subject: [PATCH] khamburgermenu: Ensure menu is polished before creating
 window

By force creating the window, there is no chance for the style
to change the surface format that will be used because it's fixed
once the window has been created.
This caused for example  in a graphical glitch with Breeze, so
manually ensure the menu is polished.
---
 src/khamburgermenuhelpers.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/khamburgermenuhelpers.cpp b/src/khamburgermenuhelpers.cpp
index d1ae2835..beecba7c 100644
--- a/src/khamburgermenuhelpers.cpp
+++ b/src/khamburgermenuhelpers.cpp
@@ -50,6 +50,9 @@ bool ButtonPressListener::eventFilter(QObject *watched, QEvent *event)
         if (!menu) {
             return false;
         }
+        // ensure polished so the style can change the surfaceformat of the window which is
+        // not possible once the window has been created
+        menu->ensurePolished();
         menu->winId(); // trigger being a native widget already, to ensure windowHandle created
         // generic code if not known if the available parent widget is a native widget or not
         auto parentWindowHandle = watchedButton->windowHandle();
-- 
GitLab