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

Pavel Urusov <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #10 from Pavel Urusov <[email protected]> ---
On my PC (openSUSE Tumbleweed, Plasma 6.7.4) this issue happens all KDE apps
that use KSwitchLanguageDialog.

I don't currently have a computer that I can set up for KDE development, but it
looks like the problem is not in the KSwitchLanguageDialog itself but in the
KLanguageButton instead. 

KLanguageButton is a QPushButton with a QMenu attached to it. When the button
is pressed, the following happens:

QPoint menuPos = adjustedMenuPosition();

QMenuPrivate::get(menu)->causedPopup.widget = q;
menu->popup(menuPos);

but adjustedMenuPosition() immediately calls:

QSize menuSize = menu->sizeHint();

QMenu::sizeHint(), in turn, calls updateActionRects() which calculates the menu
layout. However, since adjustedMenuPosition() is called before the call to
QMenu::popup(), the menu is not yet polished and its window handle does not yet
exist at this point. Which is why the menu flies off the screen when opened for
the first time but after that its geometry is recalculated, so it is displayed
correctly if closed and reopened again.

When KSwitchLanguageDialog is dismissed, its child items are destroyed, and the
same sequence happens again.

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

Reply via email to