Skip to content

Conversation

@MichaelEPope
Copy link

This is a temporary workaround for the bug that occurs when you double click an item that opens in the viewer. It works for the Viewer for Images, Videos, and PDFs for sure. I didn't test audio, but it probably works for it as well.

The main cause of the issue is that when a file is double clicked, the file is opened twice. However, something weird occurs when this happens. openFile() is only called once, while close() and cleanup() are immediately called. What I'm guessing happens is that the original file loads, and is closed somehow, followed by the second file opening. I'm not sure which of those files calls openFile() and which doesn't. One result of this though is that when the second file is closed, close() is called, but cleanup() is not. This patch ensures that it is called, which resolves the issue.

There are still some cases where the double clicking can cause the black background of the viewer to not appear (to get this to happen, you have to double click, but put some spaces between the clicks that are a part of the double click, it's difficult to get the timing right, so try it a few times). But this at least solves the one issue.

Signed-off-by: Michael Pope [email protected]

This is a temporary workaround for the bug that occurs when you double click an item that opens in the viewer.  It works for the Viewer for Images, Videos, and PDFs for sure.  I didn't test audio, but it probably works for it as well.

The main cause of the issue is that when a file is double clicked, the file is opened twice.  However, something weird occurs when this happens.  openFile() is only called once, while close() and cleanup() are immediately called.  What I'm guessing happens is that the original file loads, and is closed somehow, followed by the second file opening.  I'm not sure which of those files calls openFile() and which doesn't.  One result of this though is that when the second file is closed, close() is called, but cleanup() is not.  This patch ensures that it is called, which resolves the issue.

There are still some cases where the double clicking can cause the black background of the viewer to not appear (to get this to happen, you have to double click, but put some spaces between the clicks that are a part of the double click, it's difficult to get the timing right, so try it a few times).  But this at least solves the one issue.
@MichaelEPope
Copy link
Author

@skjnldsv Do I need to redo this pull request because of the DCO?

@szaimen
Copy link
Contributor

szaimen commented Apr 21, 2022

@skjnldsv Do I need to redo this pull request because of the DCO?

You can also fix dco differently (look at the logs of dco)

But if you are not familiar with git redoing is probably easier...

@blizzz blizzz added this to the Nextcloud 25 milestone Apr 21, 2022
@MichaelEPope
Copy link
Author

@szaimen Thanks. Yeah, I'm sorry to say I'm not too familiar with git redoing (probably oughta be at some point but not yet). I just submitted another pull request that passed ( #1218 ), so hopefully that one will work for you guys :).

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants