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 wrong window position on some linux DEs - worked around invalid g… #1744

Merged
merged 3 commits into from
Mar 1, 2020

Conversation

DominiqueFuchs
Copy link
Contributor

…eometry() returned by QT

Signed-off-by: Dominique Fuchs 32204802+DominiqueFuchs@users.noreply.github.com

Reason is UGLY. Qt's geometry() returns invalid QRect/QPoint (0, 0 / 0, -1) when called on tray icon objects on several linux desktop environments. There has already been major discussion throughout several places over this the last years, but it seems like at Qt one has given up (or never cared about this) as the whole topic with desktop environments is a mess anyway on linux.

Long story short: If geometry() return value is invalid (origin point (0,0)), use the current mouse position instead. Logically this is very ugly and only a workaround, but in practice should work out b/c mouse trigger is the only legitimate way for the tray window to pop up right now. Only exception I could think of is opening this by accessibility methods of the current system, but positioning should not be that important in this case.

Windows and macOS not affected (tested). Current openSUSE Leap:

4
3
2
1

…eometry() returned by QT

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
@ShevT
Copy link

ShevT commented Jan 21, 2020

Also, there is a problem when working with multiple monitors. The window is displayed on the wrong monitor.

…ux DEs

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
…ow.qml

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
@DominiqueFuchs
Copy link
Contributor Author

Thanks @ShevT , this should now also be fixed with 77be672

@DominiqueFuchs
Copy link
Contributor Author

Tested on KDE Plasma, Window, macOS. Further testing is welcome - if no corresponding bugs come up, this should be ready to merge.

@ShevT
Copy link

ShevT commented Jan 22, 2020

Please see another problem - #1746

@tobiasKaminsky
Copy link
Member

I have the same problem.
Is there an easy way for me to test this PR?

@DominiqueFuchs
Copy link
Contributor Author

DominiqueFuchs commented Jan 22, 2020

@tobiasKaminsky Easiest way is building this PR from source (see here for example - this is a little outdated in some parts, but generally building is a bliss after setting some cmake variables and having the prerequisites installed). Edit additional info: Alternatively he next beta will take some days - we are actually having a few issues with the package build chain. But after all beta packages for beta 1 are built, we'll merge this and other PRs into master and soon will give a beta 2.

@tobiasKaminsky
Copy link
Member

Even better, I found that appImage job of drone is already uploading it via transfer.sh, e.g. latest CI is https://transfer.sh/Fz3IF/Nextcloud-PR-1744-0697c81ae6a1c63dc3a8616aca2a102e78143755-x86_64.AppImage

Let me add some link to this…

@DominiqueFuchs
Copy link
Contributor Author

Ah right, totally forgot about the AppImages. Yes, you can also directly get them for specific branches after CI run (checks -> continuous integration -> AppImage Test (in drone) -> link at the end of the output) just to leave a general browser-way here

@tobiasKaminsky
Copy link
Member

I tested this build and I can confirm that it now has the correct position on two monitors, with KDE / plasma.

@ShevT
Copy link

ShevT commented Jan 22, 2020

I tested this build and I can confirm that it now has the correct position on two monitors, with KDE / plasma.

I confirm. Also, in this assembly, icons appeared on the buttons. But, the tray icon is now always black, regardless of the settings.
Screenshot_20200122_151047

@ShevT
Copy link

ShevT commented Jan 30, 2020

How soon will this be added to the compilation?

Copy link
Member

@misch7 misch7 left a comment

Choose a reason for hiding this comment

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

🚀

@misch7 misch7 merged commit eb7ed33 into master Mar 1, 2020
@misch7 misch7 deleted the qt-traygeometry-workaround branch March 1, 2020 06:07
@ShevT
Copy link

ShevT commented Mar 3, 2020

The problem remained when using a 4k monitor. A window pops up in the middle of the screen

@ShevT
Copy link

ShevT commented Mar 3, 2020

cloud4k

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.

4 participants