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

Fix File Activities dialog not showing up. #4867

Merged
merged 2 commits into from
Aug 29, 2022

Conversation

allexzander
Copy link
Contributor

@allexzander allexzander commented Aug 25, 2022

Signed-off-by: alex-z blackslayer4@gmail.com

Playing around with Systray by calling the following methods

Systray.forceWindowInit(dialog);
Systray.positionWindowAtScreenCenter(dialog);

leads to FileActivityDialog sometimes showing up and sometimes no, completely randomly.

I am not completely sure why this happens, but, removing those calls seems to fix the issue. The dialog shows up in the center of the screen without centering it.

UPDATE: I have added a second commit with an alternative solution.

The bug can be observed in a video:

file_activities_dialog_won.t_show_up.mp4

@allexzander allexzander marked this pull request as ready for review August 25, 2022 14:07
Copy link
Collaborator

@claucambra claucambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks window positioning on some OSes (like macOS)

The window appears under the system tray window and also behind other windows

@allexzander
Copy link
Contributor Author

@claucambra Any ideas on how to fix it alternatively, such that we don't have a bug of this dialog not showing up until manually opening the Systray as it happens now on Windows?

@allexzander
Copy link
Contributor Author

@claucambra I've added a video demonstration to the description

@codecov
Copy link

codecov bot commented Aug 25, 2022

Codecov Report

Merging #4867 (810ee9e) into master (2e2ed97) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 810ee9e differs from pull request most recent head ba9a398. Consider uploading reports for the commit ba9a398 to get more accurate results

@@            Coverage Diff             @@
##           master    #4867      +/-   ##
==========================================
- Coverage   57.23%   57.21%   -0.02%     
==========================================
  Files         138      138              
  Lines       17144    17144              
==========================================
- Hits         9812     9809       -3     
- Misses       7332     7335       +3     
Impacted Files Coverage Δ
src/libsync/discovery.cpp 84.56% <0.00%> (-0.30%) ⬇️

@claucambra
Copy link
Collaborator

@claucambra Any ideas on how to fix it alternatively, such that we don't have a bug of this dialog not showing up until manually opening the Systray as it happens now on Windows?

It is almost certain that the issue is with forceWindowInit, specifically the Windows-only code in systray.cpp lines 431 and 432

I am not sure why this is an issue for the file activity dialog window and not for other windows (maybe those get a call to show again somewhere?) It does at least seem to be something straightforward to fix or work around

@allexzander
Copy link
Contributor Author

@claucambra Any ideas on how to fix it alternatively, such that we don't have a bug of this dialog not showing up until manually opening the Systray as it happens now on Windows?

It is almost certain that the issue is with forceWindowInit, specifically the Windows-only code in systray.cpp lines 431 and 432

I am not sure why this is an issue for the file activity dialog window and not for other windows (maybe those get a call to show again somewhere?) It does at least seem to be something straightforward to fix or work around

Yes, I have tried fixing the show/hide code in CPP, and it didn't help. Now I have changed the order of calls in QML and it seems to have fixed the issue. Let me know your thoughts.

@allexzander allexzander requested a review from claucambra August 26, 2022 07:59
@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-4867-14ad0c9d41c6dae173963ecd794e6ffb5224fb53-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

Copy link
Collaborator

@claucambra claucambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine on macOS and KDE :)

Signed-off-by: alex-z <blackslayer4@gmail.com>
…ce to fix the issue of Activities dialog not being shown.

Signed-off-by: alex-z <blackslayer4@gmail.com>
@allexzander allexzander force-pushed the bugfix/fix-activity-dialog-not-showing-up branch from 14ad0c9 to ba9a398 Compare August 29, 2022 07:59
@sonarcloud
Copy link

sonarcloud bot commented Aug 29, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@allexzander allexzander merged commit ff51566 into master Aug 29, 2022
@allexzander allexzander deleted the bugfix/fix-activity-dialog-not-showing-up branch August 29, 2022 08:29
@mgallien mgallien added this to the 3.6.0 milestone Sep 2, 2022
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.

4 participants