<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Qt5 crash when closing LO with a 2nd consecutive selection"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=131533">131533</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Qt5 crash when closing LO with a 2nd consecutive selection
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>7.0.0.0.alpha0+ Master
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>graphics stack
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>glogow@fbihome.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I couldn't really come up with a good summary, as the reproducer is a bit
complex.

While debugging <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTOURBUG - Regression: LibO 6.2.x|6.3.0beta1 draw with KDE5 vcl: wrong visual feedback when dragging objects in the gallery"
   href="show_bug.cgi?id=125809">bug 125809</a>, I found the following crash, easiest reproducible
with Draw.

1. Start Draw from a terminal
2. Open galleries sidebar
3. Drag anything from the Sidebar into the document. The new item will be and
has to stay selected!
4. Drag anything from the Sidebar into the document again. The new item will be
and has to stay selected!
  - on the terminal you'll see: "QXcbClipboard::setMimeData: Cannot set X11
selection owner"
  - at this point the Qt5 internal selection state doesn't match the LO state
anymore.
5. Close and discard the document without removing the selection (Ctrl + w)
6. Close the start center (Ctrl + w).
7. Crash when QApplication tries to release the LO selection on shutdown.

LO normally release the clipboard when closing a module (Draw). This doesn't
happen correctly now.

The simple workaround is to select something else before closing the document,
so the clipboard state is corrected.

Clearing the clipboard somehow interferes with the D'n'D action when there is
already a selection. I tried to understand, why the setMimeData() call after
the clear() fails, but came up with nothing. I guess the someone else
(clipboard manager?) claims the clipboard after LO gives it up with the
clear(). The current fix is to queue the clear and ignore it, if it's directly
followed by a claiming setContent.

This initially "nice" Qt5Clipboard code already feels like it needs some
refactoring to make it easier to follow...</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>