vcl/qt5/QtWidget.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit b20d0f9b3797f6e1e33076d386608fa5eecd1106
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sat Feb 8 14:11:10 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Feb 8 18:00:17 2025 +0100

    tdf#165062 qt: Make only floating window/popup widget bg translucent
    
    For QtWidget, only set the window attributes needed for
    translucent background for floating windows and popups,
    not all QtWidgets.
    
    This fixes rendering issues when resizing a Window
    with Notebookbar (Groupedbar Compact) active (tdf#165062).
    
    Setting those flags was introduced in
    
        commit 9ea767cb568cef1b142190d2adb0e301baa382e2
        Date:   Thu May 26 13:48:38 2022 +0200
    
            tdf#132350 Qt implement SalMenu button interface
    
    whose commit message explains:
    
    >  This also includes the transparency flags for our QtWidget, so the
    >  updater "bubble window" is properly alpha-masked / shaped.
    
    Indeed, the BubbleWindow doesn't properly use alpha
    on X11 if those flags are not set  in a quick test with demo change [1] 
applied
    locally to trigger the update notification.
    
    (Even without those flags set, the window still uses
    a translucent background on Wayland in my tests. It has
    a different problem of being misplaced there, but that's
    a completely independent issue, see tdf#158994.)
    
    [1] https://gerrit.libreoffice.org/c/core/+/106922/4
    
    Change-Id: Ibda381985c0dc562d7548656146f99f01fca1964
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181292
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index f6a932068ba2..d3cc46d34e05 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -716,9 +716,15 @@ QtWidget::QtWidget(QtFrame& rFrame, Qt::WindowFlags f)
     , m_nDeltaX(0)
     , m_nDeltaY(0)
 {
-    setAttribute(Qt::WA_TranslucentBackground);
-    setAttribute(Qt::WA_OpaquePaintEvent);
-    setAttribute(Qt::WA_NoSystemBackground);
+    // make floating windows translucent, needed at least by BubbleWindow
+    // (used for update notifications) on X11
+    if (f & Qt::FramelessWindowHint)
+    {
+        setAttribute(Qt::WA_TranslucentBackground);
+        setAttribute(Qt::WA_OpaquePaintEvent);
+        setAttribute(Qt::WA_NoSystemBackground);
+    }
+
     setMouseTracking(true);
     if (!rFrame.isPopup())
         setFocusPolicy(Qt::StrongFocus);

Reply via email to