https://bugs.kde.org/show_bug.cgi?id=491083

Harald Sitter <sit...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
      Latest Commit|                            |https://invent.kde.org/fram
                   |                            |eworks/knewstuff/-/commit/2
                   |                            |80edadfd9b2fd7e683924462b15
                   |                            |65f8a1fbacc8

--- Comment #2 from Harald Sitter <sit...@kde.org> ---
Git commit 280edadfd9b2fd7e683924462b1565f8a1fbacc8 by Harald Sitter.
Committed on 27/08/2024 at 12:32.
Pushed by sitter into branch 'master'.

add especially crappy magic to deal with transient parents in actions

the issue is fairly involved and I am not sure I fully grasp it...

systemsettings has a fairly exotic line up of window entities that form
the final window. transient to that window it should create the KNS
windows. unfortunately that doesn't work right now because the
transience is not explicitly set.

this has in part to do with the also very exotic setup of
NewStuff.Action which internaly has a private QObject and inside that a
property of the type NewStuff.Dialog (the window in question).

now ordinarily there is actual magic code inside qquickwindow to figure
transience out automatically, except it fails here because the parent of
the Dialog is neither an Item nor a Window (it is a QObject of course),
so the magic has no way to deal with it without making a lot of
assumptions about the parent tree.

to fix this situation we introduce a magician assistant. it will first
and foremost warn that this situation is garbage and the developer ought
to provide an explicit transient.
it will then proceed to identify the first QQuickItem in the parent
chain with a window and adopt that window as transient parent. i.e. the
first window we find becomes parent.

the end result is that our Dialog always has a transient parent (when
used as part of Action)

M  +2    -0    src/qtquick/CMakeLists.txt
A  +15   -0    src/qtquick/private/CMakeLists.txt
A  +55   -0    src/qtquick/private/transientmagicianassistant.cpp     [License:
LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
A  +25   -0    src/qtquick/private/transientmagicianassistant.h     [License:
LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]
M  +3    -0    src/qtquick/qml/Action.qml

https://invent.kde.org/frameworks/knewstuff/-/commit/280edadfd9b2fd7e683924462b1565f8a1fbacc8

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to