ionutbortis / gnome-bedtime-mode

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

[Wayland] It doesn't work on fullscreen windows. #36

Open mabequinho opened 1 year ago

mabequinho commented 1 year ago

Every time i try to play full screen videos it stops working. Although it works immediately after exit full screen.

Linux inferno 6.0.10-zen2 #1-NixOS ZEN SMP PREEMPT_DYNAMIC Tue Jan 1 00:00:00 UTC 1980 x86_64 GNU/Linux

GNOME Shell 43.1

Bedtime mode 11

amdgpu POLARIS12
ionutbortis commented 1 year ago

@PmicroTO

Hi and thank you for using Bedtime Mode :zzz:

This issue has been there from day one and I'm a little bit surprised that no one complained about this so far :sweat_smile:

Unfortunately, the coloring APIs exposed by the Gnome shell have this problem, it's not something we can fix on the Bedtime Mode side, unless we can find some other way of creating the color effects.

If you want to see what I mean, you can install this test extension I created while back for these kind of issues: https://github.com/ionutbortis/gnome-clutter-issues

The extension code is very simple, just creates a Clutter.DesaturateEffect with 100% factor and applies it to the main ui group.

You should experience the same fullscreen video playback issue. I'm not sure of the reasons, maybe the video players app are using some full screen method that somehow is skipped by the Gnome Clutter effects. Maybe a full screen video player app is not anymore a Gnome Shell UI widget. YouTube fullscreen videos watched inside a browser seem to have the color effects applied.

Do you experience the same issues by using the test extension I mentioned above?

If yes, then I could add a new issue on the Gnome Shell's issue tracker and see what do they have to say about this. Thanks!

mabequinho commented 1 year ago

The extension code is very simple, just creates a Clutter.DesaturateEffect with 100% factor and applies it to the main ui group.

Thxn, i tried the extension but still no grayscale at fullscreen, not even youtube videos, actually fullscreen browsing(F11) shows the same behavior .

ionutbortis commented 1 year ago

Thanks for trying out the test extension!

What browser are you using? I'm not able to reproduce the fullscreen browser issue on Chrome and Firefox. On my side the greyscale effect is properly applied when doing fullscreen browsing.

mabequinho commented 1 year ago

Librewolf 107.0.1

ionutbortis commented 1 year ago

Librewolf 107.0.1

Are you using Librewolf with video hardware acceleration?

I tried to reproduce your browser issue with no success on my side, both locally and inside a vm.

I remember that I tried a while back to configure video hardware acceleration in Chrome and Firefox with no success, so that might be the only significant difference.

mabequinho commented 1 year ago

Are you using Librewolf with video hardware acceleration?

I never tried to configure it, but i have vaapi enabled on my system, actually I'm experiencing the same behavior with other applicatons, some examples :

Version: 7.3.7.2 / LibreOffice Community Build ID: 30(Build:2) CPU threads: 8; OS: Linux 6.0; UI render: default; VCL: gtk3 Locale: pt-BR (en_US.UTF-8); UI: en-US Calc: threaded

vainfo output ``` libva info: VA-API version 1.16.0 libva info: Trying to open /run/opengl-driver/lib/dri/radeonsi_drv_video.so libva info: Found init function __vaDriverInit_1_16 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.16 (libva 2.15.0) vainfo: Driver version: Mesa Gallium driver 22.2.3 for AMD Radeon RX 550 / 550 Series (polaris12, LLVM 14.0.6, DRM 3.48, 6.0.10-zen2) vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice VAProfileHEVCMain10 : VAEntrypointVLD VAProfileJPEGBaseline : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc ```
Librewolf's "Graphics" section ``` Graphics Features Compositing WebRender Asynchronous Pan/Zoom wheel input enabled; scrollbar drag enabled; keyboard enabled; autoscroll enabled; smooth pinch-zoom enabled WebGL 1 Driver WSI Info - WebGL 1 Driver Renderer WebGL is currently disabled. WebGL 1 Driver Version - WebGL 1 Driver Extensions - WebGL 1 Extensions - WebGL 2 Driver WSI Info - WebGL 2 Driver Renderer WebGL is currently disabled. WebGL 2 Driver Version - WebGL 2 Driver Extensions - WebGL 2 Extensions - Window Protocol wayland Desktop Environment gnome Target Frame Rate 60 GPU #1 Active Yes Description AMD Radeon RX 550 / 550 Series (polaris12, LLVM 14.0.6, DRM 3.48, 6.0.10-zen2) Vendor ID 0x1002 Device ID 0x699f Driver Vendor mesa/radeonsi Driver Version 22.2.3.0 RAM 0 Diagnostics AzureCanvasBackend skia AzureContentBackend skia AzureFallbackCanvasBackend skia CMSOutputProfile Empty profile data Display0 2560x1080@75Hz scales:1.000000|1.000000 DisplayCount 1 Decision Log HW_COMPOSITING available by default OPENGL_COMPOSITING available by default WEBRENDER available by default WEBRENDER_QUALIFIED available by default WEBRENDER_COMPOSITOR disabled by default: Disabled by default blocklisted by env: Blocklisted by gfxInfo blocked by runtime: Cannot be enabled in release or beta WEBRENDER_PARTIAL available by default WEBRENDER_SHADER_CACHE disabled by default: Disabled by default WEBRENDER_OPTIMIZED_SHADERS available by default WEBRENDER_ANGLE available by default unavailable by env: OS not supported WEBRENDER_DCOMP_PRESENT available by default disabled by user: User disabled via pref unavailable by env: Requires Windows 10 or later unavailable by runtime: Requires ANGLE WEBRENDER_SOFTWARE available by default WEBGPU disabled by default: Disabled by default blocked by runtime: WebGPU cannot be enabled in release or beta X11_EGL available by default DMABUF available by default HARDWARE_VIDEO_DECODING available by default blocklisted by env: Blocklisted by gfxInfo DMABUF_SURFACE_EXPORT blocked by default: Blocklisted by gfxInfo BACKDROP_FILTER available by default ```
mabequinho commented 1 year ago

Could this be related?

image

ionutbortis commented 1 year ago

Could this be related?

image

Hmm, there were some other Bedtime Mode users who experienced weird artifacts or slowness with multi monitor setups.

Do those issues appear if you use only one monitor at the time?

mabequinho commented 1 year ago

Do those issues appear if you use only one monitor at the time?

It's actually a single monitor setup. "Automatic LG Eletronics 29" is the color profile name used by "LG ULTRAWIDE Monitor".

ionutbortis commented 1 year ago

Do those issues appear if you use only one monitor at the time?

It's actually a single monitor setup. "Automatic LG Eletronics 29" is the color profile name used by "LG ULTRAWIDE Monitor".

So you have a tower desktop unit, not a laptop + an external monitor?

mabequinho commented 1 year ago

So you have a tower desktop unit, not a laptop + an external monitor?

Yes, dedicated GPU Radeon RX 550 running amdgpu driver.

ionutbortis commented 1 year ago

Btw, this is my vainfo output, I see that you have an older version of VA-API, I have 1.7.0, but your Mesa Gallium driver is newer:

libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Mesa Gallium driver 21.2.6 for AMD Radeon(TM) Vega 8 Graphics (RAVEN, DRM 3.42.0, 5.15.0-56-generic, LLVM 12.0.0)

Anyways, there's definitely something weird going on your setup. I will post an issue on Gnome Shell and will link it here :raised_eyebrow:

ionutbortis commented 1 year ago

@PmicroTO

Btw, are you experiencing any issues if using the built-in Night Light feature?

mabequinho commented 1 year ago

During nighttime I always use Nigh Light + BedtimeMode and it only loses the grayscale if fullscreen.

ionutbortis commented 1 year ago

Can you provide here the output of this command:

gnome-extensions list

As I'm writing the issue for the Gnome Shell, I observed that I can reproduce the issue only if there aren't any other Gnome Shell visible elements on the screen. For example, I'm using the Hide Top Bar extension, and if I disable it, I cannot reproduce the issue with the maximized video player window, because the display of the top bar greys out everything.

The issue still appears when the video player is in full screen mode, so no other Gnome Shell visible elements.

I'm wondering if it's the same also on your side.

mabequinho commented 1 year ago

I observed that I can reproduce the issue only if there aren't any other Gnome Shell visible elements on the screen. For example, I'm using the Hide Top Bar extension, and if I disable it, I cannot reproduce the issue with the maximized video player window, because the display of the top bar greys out everything.

I can confirm, but using Dash-to-panel's autohide.

dash-to-panel@jderose9.github.com
espresso@coadmunkee.github.com
gnomebedtime@ionutbortis.gmail.com
pomodoro@arun.codito.in
auto-move-windows@gnome-shell-extensions.gcampax.github.com
drive-menu@gnome-shell-extensions.gcampax.github.com
launch-new-instance@gnome-shell-extensions.gcampax.github.com
native-window-placement@gnome-shell-extensions.gcampax.github.com
places-menu@gnome-shell-extensions.gcampax.github.com
screenshot-window-sizer@gnome-shell-extensions.gcampax.github.com
user-theme@gnome-shell-extensions.gcampax.github.com
window-list@gnome-shell-extensions.gcampax.github.com
windowsNavigator@gnome-shell-extensions.gcampax.github.com
workspace-indicator@gnome-shell-extensions.gcampax.github.com
apps-menu@gnome-shell-extensions.gcampax.github.com
mabequinho commented 1 year ago
> gnome-extensions list --enabled
dash-to-panel@jderose9.github.com
espresso@coadmunkee.github.com
gnomebedtime@ionutbortis.gmail.com
pomodoro@arun.codito.in
places-menu@gnome-shell-extensions.gcampax.github.com
workspace-indicator@gnome-shell-extensions.gcampax.github.com
ionutbortis commented 1 year ago

Thanks!

So it seems that if there isn't any other piece of UI displayed, some apps might escape the applied desaturate effect.

VLC also does this when in full screen, but if you move the mouse, the player's controls widget appears and the video becomes greyscale again.

I submitted this issue on the Gnome Shell issues page: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6225

I will also post here when we get some response from the Gnome team.

ionutbortis commented 1 year ago

@PmicroTO

Please run this in a terminal and see if you experience anymore those fullscreen app issues while having Bedtime Mode turned on:

gdbus call \
    --session \
    --dest org.gnome.Shell \
    --object-path /org/gnome/Shell \
    --method org.gnome.Shell.Eval \
        "Meta.disable_unredirect_for_display(global.display);"

I couldn't reproduce the issues anymore :grimacing:

mabequinho commented 1 year ago

I may have a problem on my side. The command gives me the output (false, ''), which seems to occur when the gdbus call fails.

ionutbortis commented 1 year ago

Yeah, you should've got a (true, '') response.

You could try out this extension that does the same thing: https://extensions.gnome.org/extension/4509/disable-unredirect-fullscreen-windows/

mabequinho commented 1 year ago

nailed it with the following extension, since it's compatible with gnome 43.

https://extensions.gnome.org/extension/1873/disable-unredirect-fullscreen-windows/

ionutbortis commented 1 year ago

Sorry, I forgot to check the compatibility of the first extension that I sent you :sweat_smile:

Just keep in mind that if you play games with the disable-unredirect-fullscreen-windows extension enabled, you might have some performance penalties.

I will try to add this feature also to Bedtime Mode, so users won't need a separate extension. It will probably be a setting and toggled on by default.

roskee commented 10 months ago

Sorry, I forgot to check the compatibility of the first extension that I sent you 😅

Just keep in mind that if you play games with the disable-unredirect-fullscreen-windows extension enabled, you might have some performance penalties.

I will try to add this feature also to Bedtime Mode, so users won't need a separate extension. It will probably be a setting and toggled on by default.

any updates on this?

ionutbortis commented 10 months ago

@roskee Unfortunately I spent all my allocated coding time for this extension in supporting the next Gnome version, 45.

I plan to do some UI refactoring to Adwaita widgets, but first I need to wait for Gnome 45.1 to be released. I won't switch earlier than that. 45.1 is planned around the end of October, this year. So maybe I'll have some time in November or December to refactor the UI and implement the disable-unredirect-fullscreen-windows feature.

Just keep in mind that all the future changes to the extension will be targeted only for the Gnome 45 version and so on. The support for 45 brought a lot of changes to the codebase which are incompatible with older versions of Gnome.

The preferred workaround is to use this additional extension which sets that flag => https://extensions.gnome.org/extension/1873/disable-unredirect-fullscreen-windows/

9thdude commented 3 months ago

Sorry to revive this, but I just discovered this extension and think it's great. Is getting fullscreen support still on the to-do list or is it out of scope?

ionutbortis commented 3 months ago

Sorry to revive this, but I just discovered this extension and think it's great. Is getting fullscreen support still on the to-do list or is it out of scope?

@9thdude Are you still having fullscreen app issues even when using https://extensions.gnome.org/extension/1873/disable-unredirect-fullscreen-windows/ along Bedtime Mode?

9thdude commented 3 months ago

Sorry to revive this, but I just discovered this extension and think it's great. Is getting fullscreen support still on the to-do list or is it out of scope?

@9thdude Are you still having fullscreen app issues even when using https://extensions.gnome.org/extension/1873/disable-unredirect-fullscreen-windows/ along Bedtime Mode?

I have not used it as I am on GNOME 46 and the project appears to be abandoned since GNOME 42.

ionutbortis commented 3 months ago

@9thdude

https://extensions.gnome.org/extension/1873/disable-unredirect-fullscreen-windows/ actually looks maintained, has support for all Gnome versions up to 45. I'm also using it on 45.

You could probably install it also on 46 and just modify the metadata.json file to include version 46 as well.

Or you can download this unredirectvaina.lt.v9.shell-extension.zip and install it with:

gnome-extensions install unredirectvaina.lt.v9.shell-extension.zip

I should probably add that feature also to Bedtime Mode.

Please let me know if your issues are fixed when having that extension enabled.

9thdude commented 3 months ago

@9thdude

https://extensions.gnome.org/extension/1873/disable-unredirect-fullscreen-windows/ actually looks maintained, has support for all Gnome versions up to 45. I'm also using it on 45.

You could probably install it also on 46 and just modify the metadata.json file to include version 46 as well.

Or you can download this unredirectvaina.lt.v9.shell-extension.zip and install it with:

gnome-extensions install unredirectvaina.lt.v9.shell-extension.zip

I should probably add that feature also to Bedtime Mode.

Please let me know if your issues are fixed when having that extension enabled.

I was able to get it to work great using the unredirectvaina extension! Thanks for the help!