krunner: Prevent window of results overflowing screen vertically when floating (positioned at centre of screen)
Reason for the change
Fixes a UI bug which also gets in the way of functionality: the lowest KRunner search results are inaccessible when the position on screen of KRunner is centre ("floating") rather than top, because the results list extends below the screen's boundary.
Test plan
There aren't any autotests for the height, for position on screen = top or centre, but this may be a good learning opportunity for me (I already know Python with classes); I'll let you know if I've managed to add them around tomorrow midday 2025-09-04T11:00:00Z.
Steps to reproduce:
- Alt+Space to open Krunner; click the "configure krunner" icon to the left of the search bar, and wait for a configuration window to open.
- Set "position on screen" to "centre" (termed floating in the code) and apply the config
- Type something that gets a lot of results. For me "time" or "tim" works.
- If this doesn't fill the whole screen height, lower the screen resolution in system settings then repeat the instructions.
Expected:
Bottom of results list is exactly at bottom of screen, and scrollbar is present. This is already the observed result when "position on screen" is "top".
Observed:
Bottom of results list extends below the bottom of the screen, and scrollbar can be present but this still doesn't allow seeing the lowest results on the list.
Screenshots or screen recordings
(Zoom in to the bottom of each image)
| Before | After |
|---|---|
![]() |
![]() |
Bugs fixed
Bugfix for a bug not on bugs.kde.org (sorry, I didn't register it there as it was quicker to fix straight away; should I add it now and reference it from the MR for the record?).

