bing-wallpaper-gnome-extension icon indicating copy to clipboard operation
bing-wallpaper-gnome-extension copied to clipboard

Lock screen gets blurred again when resuming from suspend

Open pacho2 opened this issue 3 years ago • 13 comments

It suffers from the same issue as https://github.com/PRATAP-KUMAR/Control_Blur_Effect_On_Lock_Screen extension was suffering some time ago: when resuming from suspend, lock screen gets blurred again.

The problem is that I cannot see their git history before version 6 to know how do they fix it :S

I think they solve it commenting these lines: https://github.com/PRATAP-KUMAR/Control_Blur_Effect_On_Lock_Screen/blob/master/extension.js#L26

But I am not completely sure

Thanks a lot

pacho2 avatar Jun 10 '21 07:06 pacho2

I cannot say if this problem was added in version 33. I think that probably was all the time there but, until know, I was using both extensions (bing and control blur). Then, probably control blur extension was getting used at resume time and it seemed to work. But, for some reason, with last bing extension v33, both extensions have started to collide getting lock screen to stop working completely. I disabled control-blur to prevent that and I hit this issue :/

pacho2 avatar Jun 10 '21 07:06 pacho2

You shouldn't run both these extensions with Blur enabled, as they work exactly the same way.

I can confirm I see the same issue. The solution above means that extension can't be disabled in a session, so not really a good option (in fact it's a reason for the extension to be rejected by the extensions.gnome.org moderators). I'm not sure when disable() is called, with an active extension (presumably standby), but we shouldn't ignore it.

neffo avatar Jun 10 '21 09:06 neffo

I found the old bug in the other extension https://github.com/PRATAP-KUMAR/Control_Blur_Effect_On_Lock_Screen/issues/1

If I remember correctly, that was the only option as, during suspend, "disable" will be called but, at resume time, extensions are not re-loaded until screen is unlocked :/

Well, the other option could be to try to detect if the other extension is enabled to skip the blur part. In any case, I don't understand what changed between v33 and v32 that caused both extensions to collide and cause lock screen to not work at all :/

pacho2 avatar Jun 10 '21 11:06 pacho2

Possibly the order the extensions are loaded has changed. I'd suggest disabling Blur control in this extension. and leaving it on in the other.

neffo avatar Jun 10 '21 12:06 neffo

OK, I will do it , thanks

pacho2 avatar Jun 11 '21 19:06 pacho2

I tried to use Control_Blur extension and disable it from Bing, but they still collide as reported in https://github.com/PRATAP-KUMAR/Control_Blur_Effect_On_Lock_Screen/issues/5

It is because of this: https://github.com/neffo/bing-wallpaper-gnome-extension/blob/master/extension.js#L736

As that reseting of blur is called even when the blur setting is disabled from bing, it gets the blur messed up when resuming from suspend. Maybe that lines should be called only when blur._switch is enabled, otherwise bing extension will reset blur values when it wakes up from suspend (still don't understand why it can reset the blur from lock screen but not set it to the desired values... I guess it comes from gnome-shell internals about what extensions can do from lock-screen)

Commenting that two lines makes it not collide at all with the other extension, but I don't have the knowledge to make it conditional with the override-lockscreen-blur setting :/

pacho2 avatar Jun 14 '21 19:06 pacho2

Ahh, this should really just check if it's explicitly enabled first. That's fixable.

neffo avatar Jun 14 '21 22:06 neffo

I have applied the commit to v34 and for now it seems to work fine

pacho2 avatar Jun 16 '21 09:06 pacho2

Hi

It seems Gnome 42 now allows extensions to run in lock screen: https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/2bf31dc49fd837e0e16fffba1130ddd9d924bb5f

That probably would avoid this issues

pacho2 avatar May 06 '22 14:05 pacho2

It seems that simply appending the proper session-modes to metadata.json solves the problem for me :D

--- metadata.json.old	2023-01-24 17:24:07.124529927 +0100
+++ metadata.json	2023-01-24 17:24:19.852913263 +0100
@@ -6,5 +6,6 @@
     "description": "Sync your wallpaper to today's Microsoft Bing image of the day (the image you see when you visit Bing.com).\n\n *Disclaimer*: this extension is unofficial and not affiliated with Bing or Microsoft in any way. Images are protected by copyright and are licensed only for use as wallpapers.\n\nFeatures:\n* UHD resolution wallpapers\n* Automatically fetches current Bing wallpaper of the day and sets as both lock screen and desktop wallpaper (user selectable on GNOME versions that support it)\n* Doesn't poll continuously - only once per day and on startup (schedules a refresh when Bing is due to update)\n * random mode (from previously downloaded wallpapers)\n *NEW: select/cycle wallpaper through previously downloaded images\n* Language support: English (en), German (de), Dutch (nl), Italian (it), Polish (pl), Chinese (zh_CN, zh_TW), French (fr_FR), Portuguese (pt, pt_BR), Ukrainian (uk), Russian (ru_RU), Spanish (es), Korean (ko), Indonesian (id), Catalan (ca), Norwegian Bokmål (nb) & Nynorsk (ni), Swedish (sv), Arabic (ar), Hungarian (hu) and Japanese (ja) - a HUGE thanks to the translators\n\nThis extension was forked from the NASA APOD extension by Elinvention (https://github.com/Elinvention) and inspired by Bing Desktop Wallpaper Changer by Utkarsh Gupta (https://github.com/UtkarshGpta).\n\nAlways restart GNOME after manually updating extensions. Please report bugs to the GitHub page below:",
     "version": "44",
     "url": "https://github.com/neffo/bing-wallpaper-gnome-extension",
-    "gettext-domain": "BingWallpaper"
+    "gettext-domain": "BingWallpaper",
+    "session-modes": ["user", "unlock-dialog"]
 }

pacho2 avatar Jan 24 '23 16:01 pacho2

Yep this should work fine, and has the advantage of continuing to fetch new wallpapers. Though you might have the issues with the icon vanishing or remaining active in the lockscreen. Most of the extension is shut down by default (except for the new dynamic blur).

So by default this should work better than it used to.

neffo avatar Jan 24 '23 22:01 neffo

For now I am locally patching it since I commented here without issues... but it is true that I didn't pay attention to the icon in the lockscreen :thinking:

pacho2 avatar May 20 '23 08:05 pacho2

This still looks to be working fine... maybe it could be finally upstreamed?

Thanks a lot

pacho2 avatar Oct 26 '23 14:10 pacho2