Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
4.8.0, 5.1.0
-
linux
Description
I'd like to force my app (Qt Creator) into the foreground, e.g. when the app currently debugged hits a breakpoint. However,
raise(); activateWindow():
doesn't work reliably for me. Sometimes it activates Qt Creator, sometimes it just 'flashes' the icon of Qt Creator, sometimes it does nothing.
That's because the X11 _NET_ACTIVE_WINDOW event is initialized with
e.xclient.data.l[1] = X11->userTime;
depending on the last interaction with Qt Creator this might have been loong ago. Changing it to
e.xclient.data.l[1] = X11->time;
Makes raise() behave as expected!
If activateWindow() is called in ubuntu (unity) it does not brings the focus to the window as it can be demonstrated in showHide example atttached.
-Run the example and press C (to create a new window)
-Press T to toggle Hide and show,if focus is not in new window it will hide