Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [solved] Qt + DirectFB == Windows Losing Focus
Forum Updated to NodeBB v4.3 + New Features

[solved] Qt + DirectFB == Windows Losing Focus

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 1.5k Views 1 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.
  • B Offline
    B Offline
    Brandybuck
    wrote on last edited by
    #1

    My apps running under DirectFB platform plugin are either permanently losing focus, or never get focus. The main window will appear, but either it has no focus so that I cannot use the mouse or keyboard, or it loses the focus the instant the cursor exits any edit widget (QLineEdit, QTextEdit, etc). This applies to all widgets, buttons are not clickable, sliders will not slide, etc.

    Some apps seem to be fine, but most apps show the problem. I am unsure what the difference is. For example, the "wiggly" example works fine, but the "lineedits" does not.

    I thought this was a problem on my target platform, but it occurs on the desktop as well. With a .directfbrc file to run directfb under X11, the behavior is the same.

    To reproduce (on desktop):

    • Create a minimal .directfbfc file under Linux/Unix (just put in the line "system=x11"), and make sure Qt was build with directfb support.
    • run wiggly: wiggly -platform directfb
    • run lineedits: lineedits -platform directfb

    With some judicious qDebug statements in qdirectfbinput.cpp, I've narrowed the problem down to DirectFB simply not reporting ANY input events at all to the affected windows, including DWET_GOTFOCUS.

    Is this a problem with DirectFB? Or with Qt? Any special configurations or environment variables I need? Any workarounds? I've been searching for a while but have found no answers online. Please help. Surely someone out there is using the DirectFB platform.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Brandybuck
      wrote on last edited by
      #2

      Source of problem found, fix applied. Basically the DirectFB places every new window at the top of the z-order by default. Which is normally the right thing to do... except for QDesktopWidget windows. The app was not getting any events because there was an invisible desktop window in the way.

      The fix was to have the directfb plugin lower all desktop windows (those with a Qt:Desktop window flag) to the bottom when created.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Nice you found and thanks for sharing !

        Can you also please update the thread title prepending [solved] so other forum users may know a solution has been found :)

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        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