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. Find the source of a WindowDeactivate event

Find the source of a WindowDeactivate event

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 961 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.
  • A Offline
    A Offline
    allopis
    wrote on last edited by
    #1

    Hello,
    for some reason in my application I am getting a WindowDeactivate event on the mainwindow which is causing it to lose focus.
    I am trying to track where it's coming from. For that I installed an event filter on the application and printed the stack but it is the typical event filter stack that doesn't give much information.

    How can I find the culprit of making my application lose focus?

    Regards

    raven-worxR 1 Reply Last reply
    0
    • A allopis

      Hello,
      for some reason in my application I am getting a WindowDeactivate event on the mainwindow which is causing it to lose focus.
      I am trying to track where it's coming from. For that I installed an event filter on the application and printed the stack but it is the typical event filter stack that doesn't give much information.

      How can I find the culprit of making my application lose focus?

      Regards

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @allopis
      attach with a debugger and inspect the stacktrace at the time the event occurs?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2
      • A Offline
        A Offline
        allopis
        wrote on last edited by
        #3

        I can inspect when the event is being processed, by the event loop, but it provides no useful information because I cannot see how it got there. I can see this type of stack when the event is being processed:

        module::FocusDebug::eventFilter(QObject*, QEvent*)
        QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*)
        QApplicationPrivate::notify_helper(QObject*, QEvent*)
        QApplication::notify(QObject*, QEvent*)
        module::Application::notify(QObject*, QEvent*)
        QCoreApplication::notifyInternal(QObject*, QEvent*)
        QApplication::setActiveWindow(QWidget*)
        QApplication::x11ProcessEvent(_XEvent*)
        
        g_main_context_dispatch
        ) [0x34c4844d08]
        g_main_context_iteration
        QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
        
        QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
        QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
        QCoreApplication::exec()
        module::GelApplication::exec()
        
        module::main(module::ApplicationCreator&, int, char**)
        module::main(int, char**)
        

        As you can see, the stack can show the information about when the event is being processed but not how it got into the event queue

        raven-worxR 1 Reply Last reply
        0
        • A allopis

          I can inspect when the event is being processed, by the event loop, but it provides no useful information because I cannot see how it got there. I can see this type of stack when the event is being processed:

          module::FocusDebug::eventFilter(QObject*, QEvent*)
          QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*)
          QApplicationPrivate::notify_helper(QObject*, QEvent*)
          QApplication::notify(QObject*, QEvent*)
          module::Application::notify(QObject*, QEvent*)
          QCoreApplication::notifyInternal(QObject*, QEvent*)
          QApplication::setActiveWindow(QWidget*)
          QApplication::x11ProcessEvent(_XEvent*)
          
          g_main_context_dispatch
          ) [0x34c4844d08]
          g_main_context_iteration
          QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
          
          QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
          QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
          QCoreApplication::exec()
          module::GelApplication::exec()
          
          module::main(module::ApplicationCreator&, int, char**)
          module::main(int, char**)
          

          As you can see, the stack can show the information about when the event is being processed but not how it got into the event queue

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @allopis said in Find the source of a WindowDeactivate event:

          QApplication::setActiveWindow(QWidget*)

          what is the widget paramater here

          QApplication::x11ProcessEvent(_XEvent*)

          what is the type of the event here

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          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