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

Optimize QWindowSystemInterfacePrivate::getNonUserInputWindowSystemEvent()

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes