Menu

#13 GalaXQL empties clipboard on exit

2.3
open
nobody
None
2015-11-15
2015-11-15
No

If you copy text from the GalaXQL editor to the clipboard then close GalaXQL, you can no longer paste the text that you copied. This is weird and not how most Windows applications behave.

This appears to be a bug I introduced in 2.1 when I switched the editor to use Scintilla. The wxStyledTextCtrl (which is the wxWidgets wrapper for Scintilla) uses the wxClipboard to implement its copying. The wxClipboard, by default, will empty any contents which it owns on exit.

The fix is straight-foward: call wxTheClipboard->Flush() when exiting. This makes wxClipboard forget that it pasted the content and therefore it won't erase it on exit.

Steps To Reproduce:

  1. Type some SQL into the GalaXQL editor
  2. Select the SQL
  3. Ctrl+c (to copy it)
  4. Open notepad.exe
  5. In notepad, press Ctrl+v (to paste it)
  6. Close GalaXQL
  7. In notepad, press Ctrl+v (to paste it)

What Happens:
At Step 5 the text is pasted. At Step 7, the text is not pasted

Exepected Result:
The text is pasted at both Step 5 and Step 7

Discussion


Log in to post a comment.

MongoDB Logo MongoDB