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

            Bug ID: 416319
           Summary: forceActiveWindow() function raises window but may not
                    give it focus.
           Product: frameworks-kwindowsystem
           Version: 5.65.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kdelibs-b...@kde.org
          Reporter: i...@xuzhao.net
  Target Milestone: ---

Created attachment 125159
  --> https://bugs.kde.org/attachment.cgi?id=125159&action=edit
The screenshot showing the specified window is not getting focus

SUMMARY
I discover this bug when developing a simple KRunner extension that switches
windows on Plasma. 

In this extension, I use forceActiveWindow(Wid w) call to raise and focus a
window, see
https://github.com/xuzhao9/krunner-switcher/blob/master/src/switcher.cpp#L135

This function call successfully returns, the window specified in argument
always raises, but may not get focus (non-deterministic).

STEPS TO REPRODUCE
1. Install the krunner-switcher plugin of KRunner
2. Use KRunner to activate a window

OBSERVED RESULT
The specified window is activated and gets focus.

EXPECTED RESULT
The specified window is raised to the front, but may not get focus (the old
window keeps focus). If you call activeWindow() at this moment, it returns the
new window, i.e., the one specified in the argument of forceActiveWindow().

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:   openSUSE Tumbleweed 20200113
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.65.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
This bug is non-deterministic. You may need to try it multiple times to
reproduce it.

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

Reply via email to