Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-69745

Optimize QWindowSystemInterfacePrivate::getNonUserInputWindowSystemEvent()

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12
    • QPA
    • None

    Description

      The current logic is:

      while (QWindowSystemInterfacePrivate::windowSystemEventsQueued()) {
        QWindowSystemInterfacePrivate::WindowSystemEvent *event =
                  (flags & QEventLoop::ExcludeUserInputEvents) ?
                      QWindowSystemInterfacePrivate::getNonUserInputWindowSystemEvent() :
                      QWindowSystemInterfacePrivate::getWindowSystemEvent();
              if (!event)
                  break;
      }
      

      where

      QWindowSystemInterfacePrivate::WindowSystemEvent *QWindowSystemInterfacePrivate::getNonUserInputWindowSystemEvent()
      {
          return windowSystemEventQueue.takeFirstNonUserInputOrReturnNull();
      }
      
              WindowSystemEvent *takeFirstNonUserInputOrReturnNull()
              {
                  const QMutexLocker locker(&mutex);
                  for (int i = 0; i < impl.size(); ++i)
                      if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
                          return impl.takeAt(i);
                  return 0;
              }
      

      Every time we search from the beginning for non-UserInputEvents. This can be optimized by caching the index.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              paeglis Gatis Paeglis
              Veli-Pekka Heinonen Veli-Pekka Heinonen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes