Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] WA_ShowWithoutActivating on Linux
Qt 6.11 is out! See what's new in the release blog

[SOLVED] WA_ShowWithoutActivating on Linux

Scheduled Pinned Locked Moved General and Desktop
linuxc++qt5
3 Posts 2 Posters 3.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Solree
    wrote on last edited by Solree
    #1

    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.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Solree
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved