MEGAsync icon indicating copy to clipboard operation
MEGAsync copied to clipboard

megasync 4.0.2 linux doesn't follow qt5ct settings

Open daddy33 opened this issue 5 years ago • 12 comments

Hello,

launching from command line gives "Error unsetting QT_QPA_PLATFORMTHEME vble", and the theme always falls back to default qt style. If I run megasync --style=gtk2, it is more or less working, but dark themes have issues.

Thanks.

daddy33 avatar Feb 22 '19 05:02 daddy33

Hi @daddy33 , thanks for posting that here. We try to disable QT_QPA_PLATFORMTHEME variable to prevent some Qt crashes when opening some general Qt dialogs. You can however set this variable before starting megasync (ensure it's closed before): DO_NOT_UNSET_QT_QPA_PLATFORMTHEME. This will cease trying to unset QT_QPA_PLATFORMTHEME. Also, setting DO_NOT_SET_DESKTOP_SETTINGS_UNAWARE will prevent megasync from calling QApplication::setDesktopSettingsAware(false); . This might improve its look & feel when having dark themes. In order to do all that, you can launch megasync with

DO_NOT_UNSET_QT_QPA_PLATFORMTHEME=1 DO_NOT_SET_DESKTOP_SETTINGS_UNAWARE=1 megasync

In any case, we might be able to improve you experience if you tell us what's your OS, desktop environment, theme settings, what do you refer with dark themes have issues? Also some screenshots illustrating your issues will be appreciated.

polmr avatar Feb 22 '19 09:02 polmr

Hi, I use "obsidian-2" gtk theme. This is a dark theme and it was rendering fine with megasync 3.7. Now if I start as you suggested : DO_NOT_UNSET_QT_QPA_PLATFORMTHEME=1 DO_NOT_SET_DESKTOP_SETTINGS_UNAWARE=1 megasync,

I get this: capture d ecran du 2019-02-22 11-05-00

daddy33 avatar Feb 22 '19 10:02 daddy33

DO_NOT_UNSET_QT_QPA_PLATFORMTHEME=1 DO_NOT_SET_DESKTOP_SETTINGS_UNAWARE=1 megasync

it also fixes missing tray icon for me

actionless avatar Feb 22 '19 20:02 actionless

I think I'm having the same issue on Fedora 29. MegaSync is not using the system theme. Didn't have the issue before 4.0.2.

MegaSync Upload screenshot from 2019-02-24 22-05-06

Regular file browser screenshot from 2019-02-24 22-06-28

namannehra avatar Feb 24 '19 16:02 namannehra

I noticed the following. If I use kvantum style (megasync --style=kvantum), then I have the same problem with dark themes (background of the application window remains light). But if I tweak the kvantum style with kvantum manager by ticking in the "Compositing & General look" tab the "Translucent windows" option, then I have the expected result!

daddy33 avatar Feb 24 '19 19:02 daddy33

Still not working. That might sound a bit stupid but that's one of the reasons why I cancelled my pro plan a few months ago...

daddy33 avatar Sep 08 '19 09:09 daddy33

Running this fixes the issue for me:

QT_SCALE_FACTOR=1 megasync

maxcodefaster avatar Aug 16 '20 10:08 maxcodefaster

I can confirm that you need both settings

DO_NOT_UNSET_QT_QPA_PLATFORMTHEME=1 DO_NOT_SET_DESKTOP_SETTINGS_UNAWARE=1

in order to have megasync follow my own special Qt theme through qt5ct. Setting only DO_NOT_UNSET_QT_QPA_PLATFORMTHEME is not enough.

If I start it with

DO_NOT_UNSET_QT_QPA_PLATFORMTHEME=1 DO_NOT_SET_DESKTOP_SETTINGS_UNAWARE=1 QT_SCALE_FACTOR=1 megasync &

then I see

Not setting scale factors. Using predefined QT_SCALE_FACTOR= 1

and the dialogs are indeed too small. So QT_SCALE_FACTOR is unrelated to the theme, it corrects only the scaling, as the name suggests. So for me the solution is to run megasync as follows:

DO_NOT_UNSET_QT_QPA_PLATFORMTHEME=1 DO_NOT_SET_DESKTOP_SETTINGS_UNAWARE=1 megasync &

For the developers: maybe you can insert some check like "if you are in Linux and if there is a qt5ct theme active, then behave as if DO_NOT_UNSET_QT_QPA_PLATFORMTHEME=1 DO_NOT_SET_DESKTOP_SETTINGS_UNAWARE=1".

sedimentation-fault avatar Nov 28 '20 08:11 sedimentation-fault

Here is some system information for my above comment:

Portage 2.3.99 (python 3.7.7-final-0, default/linux/amd64/17.0/hardened, gcc-9.3.0, glibc-2.30-r8, 4.19.81-gentoo x86_64)

System uname: Linux-4.19.81-gentoo-x86_64-Intel-R-_Core-TM-i7-6700HQ_CPU@_2.60GHz-with-gentoo-2.6

sh bash 5.0_p17 ld GNU ld (Gentoo 2.33.1 p2) 2.33.1 app-shells/bash: 5.0_p17::gentoo dev-java/java-config: 2.2.0-r4::gentoo dev-lang/perl: 5.30.1::gentoo dev-lang/python: 2.7.18::gentoo, 3.6.10-r2::gentoo, 3.7.7-r2::gentoo, 3.8.2-r2::gentoo dev-util/cmake: 3.16.5::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.6-r1::gentoo sys-apps/openrc: 0.42.1::gentoo sys-apps/sandbox: 2.13::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.11.6-r3::gentoo, 1.12.6::gentoo, 1.13.4-r2::gentoo, 1.14.1::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo sys-devel/binutils: 2.33.1-r1::gentoo sys-devel/gcc: 7.3.0-r3::gentoo, 7.4.0-r2::gentoo, 7.5.0::gentoo, 8.3.0-r1::gentoo, 9.2.0-r2::gentoo, 9.3.0::gentoo sys-devel/gcc-config: 2.2.1::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.2.1-r4::gentoo sys-kernel/linux-headers: 5.4::gentoo (virtual/os-headers) sys-libs/glibc: 2.30-r8::gentoo

Note for anybody using Gentoo (Note for the developers: you can use this info to install megasync on a Gentoo system and test it ;-) This will also give you the environment where this issue manifests itself):

How to install megasync 4.3.7.0 on Gentoo

I used the ebuild from

https://data.gpo.zugaina.org/4nykey/net-misc/megasync/ https://data.gpo.zugaina.org/4nykey/net-misc/meganz-sdk/ https://data.gpo.zugaina.org/4nykey/dev-libs/breakpad/

(all three needed for megasync). I copied the

net-misc/megasync/ net-misc/meganz-sdk/ dev-libs/breakpad/

from above to a local overlay of mine and merged the ebuilds from there.

NOTE: If you do it this way, i.e. without adding the whole 4nykey overlay to your local overlays through layman, you must add the file

https://github.com/4nykey/4nykey/blob/master/profiles/thirdpartymirrors

to the profiles directory of your local overlay. Otherwise, portage will not find the mirrors and the right sources. See https://github.com/4nykey/4nykey/issues/14 .

Now you should be able to reproduce the above. :-)

sedimentation-fault avatar Nov 28 '20 10:11 sedimentation-fault

~I have tried every command in this thread but none worked for me, is there any other solution that I'm missing?~ Apparently, megasync --style=qt5 worked perfectly for me :)

halshar avatar Mar 10 '21 12:03 halshar

~~tried everything in this issue, core dump segfault in ubuntu 21.04~~

issue was unrelated and got solved.

mathieujobin avatar Aug 22 '21 21:08 mathieujobin

I just purchased a 16TB Megasync account and my only complaint is that it doesn't respect the theme. With a dark theme enabled the client looks very bad and is difficult to use. See: 2021-11-25_01-52 I use Arch (TROMjaro) + XFCE (desktop env) + the Vimix theme.

Would be great if you allowed the client to use the default system theme. I really struggle to use it. Thanks!

tio-trom avatar Nov 25 '21 00:11 tio-trom

Error unsetting QT_QPA_PLATFORMTHEME vble fish: 'megasync' terminated by signal SIGSEGV

At Linux Mint LMDE 5 (based on Debian 11).

i18nde avatar Oct 22 '22 05:10 i18nde

for me, the solution was to remove this qt plugin for deepin that was unrelated.

sudo apt remove qt5dxcb-plugin

MEGA's excellent support found the solution as I worked with them sending gdb traces.

hope it helps someone.

mathieujobin avatar Oct 27 '22 22:10 mathieujobin