-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(theming): Conitionally disable blur filter for performance #45395
base: master
Are you sure you want to change the base?
Conversation
$isChromium = $this->request !== null && $this->request->isUserAgent([Request::USER_AGENT_CHROME, Request::USER_AGENT_MS_EDGE]); | ||
// Allow to force the blur filter | ||
$forceEnableBlur = $this->config->getUserValue( | ||
$this->userSession->getUser()->getUID(), |
Check notice
Code scanning / Psalm
PossiblyNullReference Note
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
To be discussed by @nextcloud/designers |
Thanks for working on it 👍 Apparently my chromium has no hardware acceleration any longer (it's a snap package now, maybe that's related). It's basically impossible to use Nextcloud and especially navigation and dashboard. Screencast.from.2024-05-18.16-46-36.webmScreencast.from.2024-05-18.16-55-12.webmThe auto-detection worked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach in general :)
One thing: leaving the sharp edges of a picture below the text can make it hard to read. I think that when we disable the blur we should also add a solid background, not transparent. We can use an average of the background similar to the auto primary? But lighter or darker depending on the theme.
Can we also narrow this down to windows && chromium users only?
It is not only Windows, I once got this (I run a rolling release distro) on Linux and had to wait like 2 days for bleeding edge Chromium fixing their GPU layer (not sure what they are using because I never had issues with Firefox).
For 30+ with #42977 this would work fine, but with older (we need to backport) we can basically only mix with primary color and hope it matches somewhat the background. |
I think for such a case we can reasonably expect people to go and find the checkbox themselves Another Idea that I had in the past was creating a blurred version of the background on the server and use that one with
The resulting compressed blurred image will also be much lighter than the actual background, so it shouldn't impact loading times too much |
If chromium/chrome can use the hardware acceleration depends on the operating system, gpu, gpu drivers and packaging. We cannot just assume it does not work on Windows but everywhere else. I'm using Ubuntu 24.04 with Chromium (snap), and have no hardware acceleration either. It did work with Ubuntu 23.10 and Chromium (apt). I think you should get an idea, how annoying the current state is, if you turn off the graphics acceleration in your chrome/chromium settings. |
That's the point, it seems like a very niche use case compared to the vast majority of chrome based browsers on platforms other than windows. People with setups similar to yours can surely reach into the settings and force-disable the blur. That said, what do you think about this idea |
How would someone know that for the sluggish appearance is caused by a blur filter that can be turned off by a configuration option? ;) What are your thoughts on enabling the blur filter by default only for chrome/chromium on macosx and android?
I am not sure if I understood the idea. Server will provide a blurred version of the background image. The default background is the not-blurred version. The blurred version is placed on top of the default background image and only visible if there is a transparent element to be shown? Is the background image then loaded twice, and how does an element know that the other background is needed? Furthermore, I'm not familiar enough with the topic and therefore trust your decision. |
I think this is hard to be done correctly implementation-wise, meaning to ensure the blurred version is shown on the correct location with correct scaling. This would need no changes at all in all apps and library, we just need to patch server theming variables. For example:
|
@susnux I fiddled a bit with it and I think we can accomplish this with a pseudo element. Here's a code pen: https://codepen.io/marukodesu/pen/RwmRbpr If this can be solved without creating a setting, I think we should go down that route. |
We can also start with creating it on frontend side once on load, but could be not very fast as well. |
I created an issue with the approach I propose for 30+ |
Summary
As an alternative for #45049 but this one is not removing the blurry background for all users but only for chrome + edge by default.
User can force enable if it works for them (e.g. they have hardware acceleration) or force disable if they suffer performance issues.
Firefox and Safari are not affected by the performance issues, and Android should also be ok as they have proper hardware acceleration.
Mostly Windows is affected and Linux with faulty GPU drivers.
Screencast
a.mp4
Checklist