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

--- Comment #6 from nyanpasu64 <nyanpas...@tuta.io> ---
https://bugs.kde.org/show_bug.cgi?id=439137#add_comment

The upstream maintainers have replied:
(https://gitlab.gnome.org/GNOME/gtk/-/issues/4070#note_1197122):

> We set a transient parent, and mark the dialogs as modal.
>
> The rest is up to the wm.

They closed the bug, saying it's not GTK4's problem. However, the
transient-ness of child windows randomly fails to be picked up by kwin, and I
suspect (based on windows opening at the center of the screen) it always fails
to be picked up by xfwm4. I still don't know if xfwm4 and kwin are both broken
in the same scenario but with different symptoms, and mutter and openbox are
unaffected.

I theorize there's a race condition where GTK4 exposes a new window to the WM
before marking it as transient, and the running WM finds a new window and
checks the transient state at some point either before or after GTK sets it.
xfwm4 always fails to see the transient state, KDE sometimes sees the transient
state, and mutter/openbox always see the transient state.

KDE is wonky: If the "Dialogs" window appears "where there's empty room" or "on
top of the parent window", or if the "Message Dialog" appears "on the window",
KDE only puts 2 buttons in the title bar, but adds a gap to the right for a
third button. I suspect this is caused by the same-ish race condition.)

----

I decided to perform more logging of opening the "Dialog" window (not dialog
box), since it had 3 different cases rather than 2. I copied the above command
line:
env QT_LOGGING_RULES="*.debug=true;qt.qpa*.debug=false" kwin_x11 --replace
(I don't know of any analogous command lines for X11 in general, or other WMs.)

*On GTK4*

"Dialog" window spawns at top left:

kwin_core: User timestamp, ASN: 1248132
kwin_core: User timestamp, final: KWin::X11Client(0x5556e3e0ac90,
windowId=0x5000072, caption="Dialogs <2>\u200E",
transientFor=KWin::X11Client(0x5556e3b7aed0, windowId=0x5000004,
caption="Dialogs")) : 1248132
kwin_core: Activation: Belongs to active application

"Dialog" window spawns in empty space (gap to the right of close button):

kwin_core: User timestamp, ASN: 1555150
kwin_core: User timestamp, final: KWin::X11Client(0x5654aa852520,
windowId=0x5000282, caption="Dialogs <2>\u200E") : 1555150
kwin_core: Activation: Belongs to active application

"Dialog" window spawns on top of parent (gap to the right of close button):

kwin_core: User timestamp, ASN: 1669802
kwin_core: User timestamp, final: KWin::X11Client(0x5654aa85c6a0,
windowId=0x50002fe, caption="Dialogs <2>\u200E",
transientFor=KWin::X11Client(0x5654aa257e40, windowId=0x5000004,
caption="Dialogs")) : 1669802
kwin_core: Activation: Belongs to active application

*On GTK3*

"Dialog and Message Boxes" window always ends up in empty space (no gap to the
right of close button):

kwin_core: User timestamp, ASN: 1602765
kwin_core: User timestamp, final: KWin::X11Client(0x5654aa6e0af0,
windowId=0x6000bcf, caption="Dialogs and Message Boxes <2>\u200E",
transientFor=KWin::X11Client(0x5654aa6e2fa0, windowId=0x6000007,
caption="Dialogs and Message Boxes")) : 1602765
kwin_core: Activation: Belongs to active application

*Analysis*

On GTK4, if I spawn the "Dialogs" window, top left" and "on top of parent" both
show transientFor in the debug message. "In empty space" does not.

If I spawn "Message Dialog", both "top left" and "on top of parent" show
transientFor in the debug message, and I've never seen a dialog appear without
a transientFor message, regardless if it's positioned properly or not. This
differs from what qydwhotmail saw!

On GTK3, if I spawn the "Dialogs" window, it always spawns on top of parent and
always shows transientFor.

*Sidenote*

After I alt-tab slowly enough for the sidebar to actually appear, then KWin's
debug logging gets a lot noisier permanently until I restart kwin. For example:

qt.scenegraph.renderloop: - animationStarted()
qt.scenegraph.renderloop: *** Starting animation timer
qt.scenegraph.renderloop: - polish and sync update request
qt.scenegraph.renderloop: polishAndSync (normal)
PlasmaQuick::Dialog(0x55db957c0970, visibility=QWindow::Hidden,
flags=QFlags<Qt::WindowType>(Dialog|X11BypassWindowManagerHint|FramelessWindowHint|WindowMinMaxButtonsHint),
geometry=0,0 396x1440)
qt.scenegraph.renderloop: - not exposed, abort
qt.scenegraph.renderloop: - ticking non-visual timer
qt.scenegraph.renderloop: - ticking non-visual timer
qt.scenegraph.renderloop: - ticking non-visual timer
kwin_core: User timestamp, ASN: 904915
kwin_core: User timestamp, final: KWin::X11Client(0x55db95dca8f0,
windowId=0x3a00326, caption="Dialogs <2>\u200E") : 904915
kwin_core: Activation: Belongs to active application

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

Reply via email to