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

Null pointer crash in QWaylandInputContext::update when a QWaylandWindow's wl_surface is not initialized

    XMLWordPrintable

    Details

    • Platform/s:
      All
    • Commits:
      143a6ad82ea0ded69da482eff1750082fd5b2a6a (qt/qtwayland/5.12)

      Description

      void QWaylandInputContext::update(Qt::InputMethodQueries queries)
      {
          qCDebug(qLcQpaInputMethods) << Q_FUNC_INFO << queries;
      
          if (!QGuiApplication::focusObject() || !textInput())
              return;
      
          if (mCurrentWindow && mCurrentWindow->handle() && !inputMethodAccepted()) {
              struct ::wl_surface *surface = static_cast<QWaylandWindow *>(mCurrentWindow->handle())->object();
              textInput()->disable(surface);
              mCurrentWindow.clear();
          } else if (!mCurrentWindow && inputMethodAccepted()) {
              QWindow *window = QGuiApplication::focusWindow();
              if (window && window->handle()) {
                  struct ::wl_surface *surface = static_cast<QWaylandWindow *>(window->handle())->object();
      #ifdef Q_OS_SYLIXOS // this is a bug for qt. 
                  if (surface) {
      #endif
                  textInput()->enable(surface);
                  mCurrentWindow = window;
      #ifdef Q_OS_SYLIXOS
                  }
      #endif
              }
          }
      
          textInput()->updateState(queries, QtWayland::zwp_text_input_v2::update_state_change);
      }
      

      file: qt5\qtwayland\src\client\qwaylandinputcontext.cpp

        Attachments

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

          Activity

            People

            Assignee:
            johanhelsing Johan Helsing
            Reporter:
            xiaoyan xiao yan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes