Bug 436681

Summary: kmix doesn't show mixer when global scaling is enabled.
Product: [Applications] kmix Reporter: firewalker <firew4lker>
Component: KMix Panel DockingAssignee: Christian Esken <esken>
Status: REPORTED ---    
Severity: grave    
Priority: NOR    
Version First Reported In: 21.04.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description firewalker 2021-05-06 10:44:03 UTC
When global scaling for the display is enabled, kmix doesn't show the mixer slider when left clicking on the system icon.

I tried a fresh user profile. And kmix works as intended. Upon enabling global scaling (System Settings -> Display and Monitor -> Global scale). The issue occurs. In my case the global scale is a fractional number (125% or 1.25)

STEPS TO REPRODUCE
1. Enable Glabal scaling
2. Left click on the system icon of kmix

OBSERVED RESULT
The mixer sliders doesn't show up.

EXPECTED RESULT
The mixer sliders should show up.

SOFTWARE/OS VERSIONS
KDE Frameworks 5.81.0
Qt 5.15.2 (built against 5.15.2)
The xcb windowing system
Comment 1 firewalker 2021-05-07 07:02:27 UTC
Manually setting the scale factor, makes kmix behave as expected.

QT_SCALE_FACTOR=0.8 kmix

1/1.25=0.8

This has nothing to do with fractional scaling. Running with an integer scale factor ha the same wrong behavior. 

QT_SCALE_FACTOR=1.6 kmix

1.25x1.6=2
Comment 2 firewalker 2021-05-07 09:36:48 UTC
OK. I think the problem is in file kmixdockwidget.cpp. 

// Now handle Multihead displays. And also make sure that the dialog is not	// moved out-of-the screen on the right (see Bug 101742).
const QScreen *screen = QGuiApplication::screenAt(pos);
if (screen==nullptr) return;

line 354 const QScreen *screen = QGuiApplication::screenAt(pos);

should change to 

const QScreen *screen = QGuiApplication::screenAt(QCursor::pos());

With this change kmix seems to work OK with scale factors.