Jump to content
R C-R

Why does quitting an Affinity app clear the clipboard?

Recommended Posts

In any Affinity app on my Mac, when I copy anything to the clipboard, even something as simple as a few words of text in an artistic or frame text block, I can paste that into another app that accepts that kind of data. I can do this even after closing the Affinity document.

However, if I quit the Affinity app, anything I have copied to the clipboard while running it is lost -- the clipboard has been emptied of all data.

Why does this happen? As best as I can tell there is no good reason for this & other apps do not do this.

Share this post


Link to post
Share on other sites
6 hours ago, Patrick Connor said:

There's a little bit more on this here, explaining why we do not put stuff on the clipboard on exit, "just in case" it will be pasted.

After reading all the posts in this & the Copying Text topics (including my own, which I had forgotten about), & doing some more testing, I still find some things puzzling about this.

For one thing, if delaying rendering to the clipboard is done to speed up closing documents, why do some data types copied to the clipboard remain accessible to certain other apps after I close the Affinity document I copied items to the clipboard from? Various other apps can not only paste certain clipboard data types into their own documents, even on my old & slow iMac with just 8 GB of RAM, this happens with very little delay.

For example, I have been experimenting with this clipboard test.afdesign file by copying all 70 of its objects to the clipboard, closing that file, & then pasting into Apple' Preview or TextEdit apps or into Pixelmator Pro. (For each test I have started by quitting & relaunching AD to make sure there is nothing already on the clipboard.) Granted, the amount of pasted data isn't huge, ranging from about 160 KB to 1.5 MB depending on the app I am pasting into, but all the pastes are completed in under one second. This is only slightly longer than it takes to open a saved file of similar data type & size in any of those apps, so it does not slow down my workflows enough to bother me.

Likewise, copying all 70 objects does not detectably slow down closing the test file compared to copying nothing to the clipboard before closing it. This seemingly contradicts what was said in the other topics about delayed rendering to the clipboard saving time & resources. If it does, the savings are minimal.

Regarding how many people might need some of the clipboard contents after the application quits, consider someone running more than one Affinity app on a system like mine that does not have a lot of RAM. For obvious reasons, when a lot of apps are open at the same time things can start to get sluggish, so quitting some of them to free up RAM for the others is a common practice. But for example, what if I copy my 70 objects to the clipboard in AD, intending to paste them into either one of the other Affinity apps or Pixelmator Pro or whatever? As things are now, I can't quit AD to free up the RAM it uses, which is substantial even when no documents are open in it.

Worse, if I was not aware the clipboard would be cleared when AD quits & I had not saved my AD document before quitting, assuming I still had what I wanted available on the clipboard, I would not be a happy camper.

I know this reply is already quite long but before I post it I have to mention one other thing: as I said in the OP, other similar apps do not clear the clipboard on quitting & that does not seem to cause any problems -- in fact, this can be very useful in some workflows, particularly when passing items between apps. After all, this is what makes the clipboard so useful to begin with, right?

Share this post


Link to post
Share on other sites
33 minutes ago, R C-R said:

Worse, if I was not aware the clipboard would be cleared when AD quits & I had not saved my AD document before quitting, assuming I still had what I wanted available on the clipboard, I would not be a happy camper.

I don't think I have ever closed (or considered closing) an app before I have pasted the data I copied. That just feels risky. For one thing, until I've pasted I can't be sure I copied it correctly or in a usable format for the target app.

Share this post


Link to post
Share on other sites
6 minutes ago, walt.farrell said:

I don't think I have ever closed (or considered closing) an app before I have pasted the data I copied. That just feels risky.

The thing is this works fine with other apps (like with Pixelmator Pro & with every Apple app I have tested) because they do not clear the clipboard when they quit. (Note: in the Mac OS quitting an app & closing a document are two different things, & closing a document in an Affinity app does not clear the clipboard, whether or not it has been saved to a file. Only quitting it does that.)

So while it can be risky with the Affinity apps, from what I can tell it is very nearly if not completely risk-free with the others.

It is also perhaps worth considering the overall impact of having to keep an Affinity app running just to preserve its clipboard contents on system resources. Even with no document open, they use a significant amount of memory & require access to well over one thousand files that must remain open for as long as the app is running. That includes everything from fonts & icc profiles to caches & their own resources & frameworks, so there are good reasons to quit them when there is no immediate need to use them.

So as with so many other things, there are tradeoffs with both approaches to clipboard use. I am just not sure the one Serif has chosen for the Affinity apps is the best one. If nothing else, it would be useful to have the option to clear just the items that no other apps besides the Affinity ones can use.

Share this post


Link to post
Share on other sites
12 hours ago, R C-R said:

if delaying rendering to the clipboard is done to speed up closing documents

You may have misunderstood me, it is not done only to speed up closing .... it is done to speed up any "copy" functions and to reduce memory use. If "copy" put every supported format on the clipboard immediately when "copy" was pressed, then that would be slower and wasteful. We only tend to put the requested format on the clipboard on "paste". That way only the needed formats are rendered and copy can offer more formats quicker because they are not rendered immediately. You are suggesting that we put all the available formats onto the pasteboard on closing the app as if every possible format was requested, just in case they are needed by other apps after Affinity closes. We currently choose not to do that and you are one of only a few people to notice or mind.

Share this post


Link to post
Share on other sites
2 minutes ago, Patrick Connor said:

You are suggesting that we put all the available formats onto the pasteboard on closing the app as if every possible format was requested, just in case they are needed by other apps after Affinity closes.

Basically, that is what I am suggesting, at least as an option.

One of the reasons for this is one of those other apps might be another Affinity one, so it seems at least conceivable that it might be useful in some workflows to put even the formats that only Affinity can use on the clipboard, & leave them there when the 'parent' Affinity app quits.

Another reason is that other apps do not clear the clipboard on quitting, including ones like Pixelmator Pro that can place substantially more data on the clipboard than the Affinity apps, & this does not seem to have any detectable effect on performance, even on my old & slow iMac.

A third reason is that a substantial number of the data types Affinity apps copy are usable in other apps, like the PDF format in Apple's Preview app, & plain and/or styled text formats in several.

29 minutes ago, Patrick Connor said:

We currently choose not to do that and you are one of only a few people to notice or mind.

I am not so sure that is true. I suspect many of the complaints about pasting into other apps not working is because it is not well known that the Affinity apps clear the clipboard when quit, something that to my knowledge very few if any other apps do.

Share this post


Link to post
Share on other sites
54 minutes ago, R C-R said:

something that to my knowledge very few if any other apps do

clipbpard_data.jpg.cbcdcc4a15922857847d199f67952c28.jpg 

This is the PC way of doing it but I suppose that most users would assume that once the originating app is gone, it does not leave stuff around the system. Typically however they do just that, because clearing the content you've placed there requires some extra steps  (emptying the Clipboard after you have ensured that data currently available there is from your app).

Password apps self-evidently remove data copied on the Clipboard, if the user chose to transfer passwords this way (as there are safer methods).

In addition, the Clipboard can operate in a way that requires the originating app to reserve memory e.g. to perform delayed rendering, it needs to free those resources at the time it quits, and in this scenario it probably typically would not bother to place the most recent content on the Clipboard as global data when it is quitting.

Share this post


Link to post
Share on other sites
10 minutes ago, Lagarto said:

This is the PC way of doing it but I suppose that most users would assume that once the originating app is gone, it does not leave stuff around the system.

I don't assume that on my Mac because most Mac apps do not clear the clipboard when quit.

The Illustrator option you show or one similar to it is what I would like the Affinity apps to have.

Share this post


Link to post
Share on other sites
2 minutes ago, R C-R said:

The Illustrator option you show or one similar to it is what I would like the Affinity apps to have.

Yes, as said, it is the PC way. What you say about Mac apps is also true on Windows: it is typical that apps leave data on the Clipboard once they quit, but I do not think that there are any MS recommendations as for correct behavior. Most apps do not perform delayed rendering so I can understand Affinity reasons for clearing the Clipboard. 

Share this post


Link to post
Share on other sites
1 minute ago, Lagarto said:

Most apps do not perform delayed rendering so I can understand Affinity reasons for clearing the Clipboard. 

So can I ... to a point. But I still would like to have the option not to clear it when that better suits my workflow, even if it means it will take longer to quit the app while everything is being rendered.

After all, if this was not a sometimes useful option there would be no reason for Illustrator to include it.

Share this post


Link to post
Share on other sites
7 minutes ago, R C-R said:

After all, if this was not a sometimes useful option there would be no reason for Illustrator to include it.

Yes, they do not show it just to be vain ;-)

Share this post


Link to post
Share on other sites

Even my 20-year-old copy of MS Word 2000 on Windows 10 gives you the option to save the Clipboard contents when you exit from Word. Throughout desktop computer history, good and courteous programs have warned the user about possible loss of data due to an inadvertent, or even deliberate, action. In many cases, such warnings can be disabled in the application's Settings or Preferences. There is wisdom in the way things used to be done.

image.png.856d0f6d983507f79c821fc893c06307.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.