[vlc-commits] [Git][videolan/vlc][master] qt: call `QWidget::ensurePolished()` before setting transient parent in VLCMenu

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Aug 2 08:05:56 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f6ce0828 by Fatih Uzunoglu at 2024-08-02T07:49:03+00:00
qt: call `QWidget::ensurePolished()` before setting transient parent in VLCMenu

`QVLCDialog::setWindowTransientParent()` first creates a window if it is not
already created.

Depending on the platform, a `QMenu` might use special attributes for its
underlying window. Some of these special attributes, such as, translucent
background requires them to be set prior to creation.

`QMenu` does such adjustments in polishing stage. Calling `ensurePolished()`
before calling `QVLCDialog::setWindowTransientParent()` satisfies that the
window is going to be what `QMenu` really wants.

- - - - -


1 changed file:

- modules/gui/qt/menus/menus.hpp


Changes:

=====================================
modules/gui/qt/menus/menus.hpp
=====================================
@@ -40,7 +40,10 @@ public:
     {
         assert(p_intf);
         if (isWindow())
+        {
+            ensurePolished();
             QVLCDialog::setWindowTransientParent(this, nullptr, p_intf);
+        }
     }
 
     explicit VLCMenu(const QString& title, qt_intf_t* p_intf) : VLCMenu(p_intf)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f6ce0828b3a7f6b724d89a48d9b06e9c7d03bb64

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f6ce0828b3a7f6b724d89a48d9b06e9c7d03bb64
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list