mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-03 09:29:30 +02:00
Clear the clipboard when the project from which it was copied closes.
This commit is contained in:
parent
1405f3a41e
commit
7e85fc9f9f
@ -716,9 +716,27 @@ void ProjectManager::OnCloseWindow(wxCloseEvent & event)
|
|||||||
|
|
||||||
// DanH: If we're definitely about to quit, clear the clipboard.
|
// DanH: If we're definitely about to quit, clear the clipboard.
|
||||||
// Doing this after Deref'ing the DirManager causes problems.
|
// Doing this after Deref'ing the DirManager causes problems.
|
||||||
|
auto &clipboard = Clipboard::Get();
|
||||||
if ((AllProjects{}.size() == 1) &&
|
if ((AllProjects{}.size() == 1) &&
|
||||||
(quitOnClose || AllProjects::Closing()))
|
(quitOnClose || AllProjects::Closing()))
|
||||||
Clipboard::Get().Clear();
|
clipboard.Clear();
|
||||||
|
else {
|
||||||
|
auto clipboardProject = clipboard.Project().lock();
|
||||||
|
if ( clipboardProject.get() == &mProject ) {
|
||||||
|
// Closing the project from which content was cut or copied.
|
||||||
|
// For 3.0.0, clear the clipboard, because accessing clipboard contents
|
||||||
|
// would depend on a database connection to the closing project, but
|
||||||
|
// that connection should closed now so that the project file can be
|
||||||
|
// freely moved.
|
||||||
|
// Notes:
|
||||||
|
// 1) maybe clipboard contents could be saved by migrating them to
|
||||||
|
// another temporary database, but that extra effort is beyond the
|
||||||
|
// scope of 3.0.0.
|
||||||
|
// 2) strictly speaking this is necessary only when the clipboard
|
||||||
|
// contains WaveTracks.
|
||||||
|
clipboard.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// JKC: For Win98 and Linux do not detach the menu bar.
|
// JKC: For Win98 and Linux do not detach the menu bar.
|
||||||
// We want wxWidgets to clean it up for us.
|
// We want wxWidgets to clean it up for us.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user