I periodically get screen tearing, fps drops, and lag while watching videos in a browser on my secondary while playing a game on my primary. I’m attributing this to Nvidia drivers being awful, but I have no clue how to fix it.
Then it’s the compositor. Your compositor is acting weird on secondary displays so it needs to be turned off. If there’s no way to fully shut it off, switch to a DE that can allow you to fully shut off compositing.
Also use the Xrender backend instead of OpenGL. OpenGL is meant for Mesa, not Nvidia.
You also need to be sure both monitors are running at the same refresh rate in Nvidia Control Panel. Xorg doesn’t handle mixed refresh rates on multi monitor yet.
This is more down to Xorg in combination with Nvidia being god awful. It’s less bad on AMD and Intel, but Xorg still has issues if the monitors are not the same refresh rate.
The only solution I see right now is to use VFIO to run a Linux VM on your secondary monitor and run a browser within that.
Unfortunately, yes. It’s just how broken Xorg + Nvidia is right now for multi-monitor. I honestly have no clue how Wayland might solve it if it even does on Nvidia with the GBM changes.
That tells a lot actually. Is layers.acceleration.force-enabled true? Firefox doesn’t accelerate the 2D canvas all the time, when in some instances it actually does need it accelerated all the time.
You may also want to turn off hardware decode with media.hardware-video-decoding.enabled set to false.
Also, are you running a Snap or Flatpak? Don’t run a Snap or Flatpak of Firefox or anything that needs OpenGL and libGLX.so on Nvidia.