[SOLVED] WA_ShowWithoutActivating on Linux



  • Hi,
    I need to make window that won't grab focus when show up. For that purpose I'm using WA_ShowWithoutActivating attribute. On Windows it works just fine, but on Linux it don't work. This problem only with Qt 5. I tried 5.2.1 and 5.4.1 versions on Ubuntu and Xubuntu. Window will always grab focus even if this attribute is set. I also tried to set window flags as Qt::Tool and set focus policy as Qt::NoFocus but window grab focus anyway. Also I tried to ignore FocusIn even and reset mouse/keyboard focus but nothing helped. I saw this bug - https://bugreports.qt.io/browse/QTBUG-19194 but it's closed in 5.4 version (and there's nothing about Linux). Also this attribute works fine on Linux with Qt 4.8.5.
    Is there anything I should know or it's just bug and I can't do anything about it? Or maybe I can make it by using X11 api?
    I can change project to Qt 4 but it don't have QScreen::name feature that I need. Maybe someone knows how to get screen name in Qt 4 or I need to do that by using system api?
    Thanks.



  • Hi,
    there are still a lot of bugs in Qt5 when it comes to window flags, esp. on Linux. Please file a bug report.



  • I found that Qt::WindowDoesNotAcceptFocus window flag makes what I need.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.