ionutbortis / gnome-bedtime-mode

Home of the "Bedtime Mode" :zzz: GNOME Shell Extension.
GNU General Public License v3.0
70 stars 12 forks source link

Switching tabs to certain websites on Google Chrome and Firefox cause grayscale filter to turn off #28

Closed patbl closed 2 years ago

patbl commented 2 years ago

Switching tabs to a certain websites with Control-Tab turns off grayscale color filter. I've noticed this when switching to an open Google Doc or Google sheet (https://doc.new or https://sheet.new). I've seen this in both Firefox and Chrome.

To reproduce:

  1. Turn on the grayscale filter, and turn on bedtime mode.
  2. In Firefox or Chrome, sign into Google.
  3. Open https://www.nytimes.com, https://www.macys.com, and https://doc.new.
  4. Use Control-Tab to switch between the open tabs.

Expected behavior: Grayscale remains enabled.

Actual behavior: Switching using Control-Tab (or Alt-) turns off the grayscale color filter while on the Google Docs tab.

On Google Chrome, clicking to switch tabs doesn't trigger this bug. In Firefox, the bug is triggered regardless of whether you click or use keyboard shortcuts. On Firefox, the bug goes away as soon as you switch away from Google Docs, whereas on Chrome the effect often lingers (though the filter does always eventually turn back on without intervention).

ionutbortis commented 2 years ago

@patbl Hi Patrick,

Unfortunately, I wasn't able to reproduce this issue on my live system (Ubuntu 20.04 with Gnome 3.36.8).

Can you provide more details on the system you're experiencing this issue? Linux distro, Gnome version, any other info that might be relevant. Maybe also paste here a neofetch output? (Be aware that Gnome version is not included there and I need that info too).

Another thing. Could you please test this extension on your system and see if it has the same issues? https://extensions.gnome.org/extension/1471/tint-all/

Thanks!

patbl commented 2 years ago

I'd be happy to do those things the weekend after next—feel free to ping me if I haven't responded two weeks from now.

ionutbortis commented 2 years ago

I'd be happy to do those things the weekend after next—feel free to ping me if I haven't responded two weeks from now.

Ping :sweat_smile:

Do you still encounter these issues?

patbl commented 2 years ago

I recorded a video on my phone (because I think a screen recording would show everything in color).

I think the issue is related to Wayland—if I log out and log back in using the "Ubuntu on Xorg" or "Gnome Classic" option, I don't have this issue.

OS: Ubuntu 21.10 x86_64
Host: XPS 13 9370
Kernel: 5.13.0-37-generic
Uptime: 9 days, 4 hours, 39 mins
Packages: 2170 (dpkg), 15 (snap)
Shell: zsh 5.8
Resolution: 3840x2160
DE: GNOME 40.5
WM: Mutter
WM Theme: Adwaita
Theme: Yaru [GTK2/3]
Icons: Yaru [GTK2/3]
CPU: Intel i7-8550U (8) @ 4.000GHz
GPU: Intel UHD Graphics 620
Memory: 5169MiB / 15699MiB

The version of Gnome here is a little different:

image

Not sure why it's so different from your version (3.36.8).

ionutbortis commented 2 years ago

@patbl Hi Patrick,

Thank you for getting back to this, that's a weird issue you found there for sure. I'm not sure what's causing it, I'll have to try to reproduce this on some VMs. It might be some video driver related issue.

Can you please do a quick test using the TintAll extension? https://extensions.gnome.org/extension/1471/tint-all/

Just have a color filter enabled using the TintAll extension, see if it behaves the same and let me know.

In the meantime I'll try your scenario on my end. Thanks!

ionutbortis commented 2 years ago

@patbl Hello again,

Unfortunately, I wasn't able to reproduce this issue on my side :disappointed:

I have a VM with your version of Ubuntu with Gnome 40.4, Wayland, everything works fine. Tried to boot using the Ubuntu 21.10 live cd and switched to Wayland, no issue over there.

I also tried the latest Gnome, version 42, on Fedora 36 Beta, VM and live cd boot, the issue is still no reproducible.

This might be some video drivers related issue, but I'm not sure, and I also don't know on how to search for more info. I have a different laptop with a different video card, that's the only main difference.

On my current system (Ubuntu 20.04) there are some apps which in fullscreen mode are not affected by the Bedtime Mode color effect: Kodi, Stremio, mpv Media Player. I'm assuming it's something related to the video card rendering. Maybe some apps are using hardware accelerated rendering instead of software rendering in some use cases.

Can you please check your Firefox settings? Go to settings and search for Performance -> Uncheck the "Use recommended performance settings" option and the uncheck the "Use hardware acceleration when available" option.

After doing this try again and see if you can reproduce the issue. If it's not reproducible anymore it means that the issue is hardware acceleration related. Please let me know about this. Thanks!

patbl commented 2 years ago

Can you please check your Firefox settings? Go to settings and search for Performance -> Uncheck the "Use recommended performance settings" option and the uncheck the "Use hardware acceleration when available" option.

I tried that but it didn't fix the issue.

Another thing. Could you please test this extension on your system and see if it has the same issues? https://extensions.gnome.org/extension/1471/tint-all/

Sorry that I forgot about this the first time around.

That extension is very buggy on my computer. The first time I installed and enabled it, it tinted the screen when I clicked on the system-bar button. When I clicked the button again, I think my computer froze. After I restarted my computer, I went to https://extensions.gnome.org/extension/1471/tint-all/ and the extension was disabled. When I click the toggle button to toggle it on, it doesn't work—when I refresh the page, the extension is still shown as "Off" and the icon doesn't appear in the system bar.

I tried removing and re-installing the extension but I still can't enable it.

There are a couple of other reports of it crashing people's systems in the user reviews (https://extensions.gnome.org/extension/1471/tint-all/).

patbl commented 2 years ago

I got my shell extensions working again (I think I had to install gnome-shell-extensions and use that to re-enable extensions). Tint All is now working without crashing, and it has the same issue as Bedtime Mode (the filter doesn't work on open Google Docs and Google Sheets).

ionutbortis commented 2 years ago

@patbl Patrick, thank you for trying out these things! :+1:

So the issue seems to be in the way Gnome shell applies those color effects. It might be related to video drivers. As far as I know Intel has pretty good support on linux systems so it's weird that you're experiencing this...

Going further I would advise on updating to the upcoming Ubuntu release, 22.04. It will use the latest Gnome, version 42 so maybe with a little bit of luck you won't have this issue anymore :sweat_smile:

Please let me know after the upgrade if the issue is still present :worried: . If yes, I can follow up with the guys from the Gnome Extensions channel. Some folks over there are more knowledgeable on how Gnome implements its effects and could shed more light on the issue or direct us to some Gnome developers.

Thanks!

patbl commented 2 years ago

This problem seems to be gone in Ubuntu 22.04/Gnome 42.0. Thanks!

ionutbortis commented 2 years ago

Awesome! I will also upgrade in the upcoming days :tada: