Lower frame rate / refresh rate when using prime-run program in fullscreen

I’m having an issue with programs launching with prime-run, where they will run at much higher frame rates with the dedicated card vs the internal GPU in the CPU (as one would expect), until the window is maximized/set to fullscreen.

I’ve tested this with Retroarch (stable and -git from the AUR), vkcube, and glxgears. When I run the latter two without prime-run, I’ll get a smooth 60 FPS render, whether windowed or maximized. However, if I run prime-run glxgears, the following results show in my terminal:

Terminal output
prime-run glxgears
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
2687 frames in 5.0 seconds = 537.380 FPS
2400 frames in 5.0 seconds = 479.975 FPS
2304 frames in 5.0 seconds = 460.630 FPS
2314 frames in 5.0 seconds = 462.609 FPS
[at this point, I maximize the window]
308 frames in 5.0 seconds = 61.443 FPS
113 frames in 5.0 seconds = 22.502 FPS
162 frames in 5.0 seconds = 32.129 FPS
97 frames in 5.0 seconds = 19.335 FPS
94 frames in 5.0 seconds = 18.746 FPS

I force-reinstalled all video drivers with mhwd -f -i pci video-hybrid-intel-nvidia-prime, but that didn’t help. This also hasn’t always been the case, but I can’t pinpoint exactly what the cause might be.

System Info

Here’s my inxi output:

CPU: quad core Intel Core i7-6700HQ (-MT MCP-)
speed/min/max: 3106/800/3500 MHz Kernel: 5.17.10-1-MANJARO x86_64 Up: 10m
Mem: 2885.1/7813.9 MiB (36.9%) Storage: 1.82 TiB (24.8% used) Procs: 258
Shell: Bash inxi: 3.3.16

And here’s my inxi -G output:

Graphics:
  Device-1: Intel HD Graphics 530 driver: i915 v: kernel
  Device-2: NVIDIA GM107M [GeForce GTX 960M] driver: nvidia v: 515.43.04
  Device-3: Sunplus Innovation Integrated_Webcam_HD type: USB
    driver: uvcvideo
  Display: x11 server: X.Org v: 21.1.3 with: Xwayland v: 22.1.2 driver: X:
    loaded: intel,nvidia gpu: i915 resolution: 1: 1920x1200~60Hz
    2: 1920x1080~60Hz
  OpenGL: renderer: Mesa Intel HD Graphics 530 (SKL GT2) v: 4.6 Mesa 22.1.0