Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reparent file picker and viewer in fullscreen mode #6879

Merged

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented Feb 7, 2022

Follow up to #6119
Work around for #6151 until nextcloud-libraries/nextcloud-dialogs#427 and nextcloud/viewer#995 are fixed

By default the file picker and the viewer are siblings of the fullscreen element, so they are not visible when in fullscreen mode. It is not possible to specify the parent nor to know when the file picker or the viewer were actually opened, so for the time being they are reparented if needed shortly after calling them.

This is just a temporary hack until it is possible to specify the parent element, but that would require changes in the Vue library, the viewer and the server dialogs, so this horrible code will have to do for now 😢

A slightly better work around would be to look for the element to reparent several times in shorter intervals until it is found rather than just once after one second, but for simplicity I opted for the single timeout (but I can adjust it to the other approach if desired, of course).

How to test (scenario 1)

  • Open a conversation in Talk
  • Change to fullscreen mode
  • Share a file from Nextcloud

Result with this pull request

The file picker is shown (with a small lag)

Result without this pull request

The file picker is not shown until the fullscreen mode is left (for example, by pressing Esc)

How to test (scenario 2)

  • Open a conversation in Talk
  • Share a file from Nextcloud
  • Change to fullscreen mode
  • Click on the file to open the viewer

Result with this pull request

The viewer is shown (with a small lag)

Result without this pull request

The viewer is not shown until the fullscreen mode is left (for example, by pressing Esc)

By default the file picker and the viewer are siblings of the fullscreen
element, so they are not visible when in fullscreen mode. It is not
possible to specify the parent nor to know when the file picker or the
viewer were actually opened, so for the time being they are reparented
if needed shortly after calling them.

This is just a temporary hack until it is possible to specify the parent
element, but that would require changes in the Vue library, the viewer
and the server dialogs, so this horrible code will have to do for now.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@nickvergessen nickvergessen merged commit b87198f into master Feb 8, 2022
@nickvergessen nickvergessen deleted the reparent-file-picker-and-viewer-in-fullscreen-mode branch February 8, 2022 09:23
@nickvergessen
Copy link
Member

Backport to 23?

@danxuliu
Copy link
Member Author

danxuliu commented Feb 8, 2022

/backport to stable23

@danxuliu
Copy link
Member Author

danxuliu commented Feb 8, 2022

/backport to stable22

@danxuliu
Copy link
Member Author

danxuliu commented Feb 8, 2022

/backport to stable21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants