Looking glass and kde effects

I have been using looking-glass for a while now. I just realized that kde’s visual effects (transparency, edge glow) stop working when I run the look-glass client and resume when I close the client. Is there a reason for this? Bug? Necessary? It’s not a huge issue, but I was curious about it.

Dr. C

LG sets the XAtom NETWM_BYPASS_COMPOSITOR which disables desktop composition. Without this the render pipeline is buffered and guest mouse cursor updaes lag behind a frame or two. This is because LG has to composit the mouse cursor instead of relying on hardware cursor support. So in short, not a bug, a feature :slight_smile:

If you really want to disable this, comment out or remove lines 1202 to 1217 in main.c in the client, however you likely will find the application performance suffers.

1202       Atom NETWM_BYPASS_COMPOSITOR = XInternAtom(
1203         wminfo.info.x11.display,
1204         "NETWM_BYPASS_COMPOSITOR",
1205         False);
1206 
1207       unsigned long value = 1;
1208       XChangeProperty(
1209         wminfo.info.x11.display,
1210         wminfo.info.x11.window,
1211         NETWM_BYPASS_COMPOSITOR,
1212         XA_CARDINAL,
1213         32,
1214         PropModeReplace,
1215         (unsigned char *)&value,
1216         1
1217       );
3 Likes

How does this affect the full composition setting in the Nvidia driver? Does the driver still do composition or does the driver then skip composition?

It’s up to the window manager and the driver to decide, it’s implementation specific.

Thanks so much for the explanation! :slight_smile: I am guessing that this matters for gaming. I mainly use LG for adobe lightroom and access to a windows only EMR system. I wonder if I would notice. Would it ever make sense to have a command line option to disable the disabling of the compositor?

No, it’s not just for gaming, its for the cursor. If you leave compositiing enabled there is very noticible input lag for the cursor. 1-2 frames usually, which at 60FPS equates to 33.3ms. This doesn’t seem like much until you use it.

Thanks, that does seem like it would be noticeable.

Disabling the compositor causes tearing and disables hot corners on KDE.

In my case the mouse delay is not noticeable (maybe because I disabled pointer precision on Windows) if I keep the compositor enabled.

Wouldn’t it make sense to add a flag to optionally keep the compositor enabled?

In addition to preventing the aforementioned KDE issues, some other scenarios that come to my mind (even if there is a mouse delay) are: using an additional mouse or gamepad through an USB dongle directly connected to the VM

Seems this thread confirms that using GPU pass-through + looking glass still means the host’s compositor effects the GPU pass-through window - correct?
So in trying to get the lowest latency we should disable the compositor. I will see if that can be done on the fly (without exiting the host’s X session).

The LG client sends a hint to disable the compositor. In well behaved environments the compositor is auto-disabled as a result of the hint (I’m running AwesomeWM with picom as compositor and the LG window is excluded from the compositor without me configuring anything). Awhile back I was running Plasma/KDE and had to explicitly exclude LG from compositing.

2 Likes

Yes, I did some testing to this effect last night, seems Compton ignores the disable hint. Also note that at the time of this writing, LG bleeding edge (yesterday) had a fix go in to make the EGL actually honour the double buffer option, defaulting to off and rendering to the front buffer (aka, single buffer). Initial testing that this fix along with disabling the compositor keeps us on par or 1 frame ahead of the native output.

2 Likes

gnif you are amazing. these little tweaks and quality of life changes are much more than i expected with looking glass. to be honest i expected you to stop doing a lot of work with the public version once you got it stable and usable for corporate contracts.

haha, no corporate contracts have come along for LG :stuck_out_tongue:

Even still though, I would insist that everything written for LG would go back into the FOSS version, I do not intend to ever have a “pro” or “commercial” version.

2 Likes

Ignores the hint meaning you still toggle off Compton manually when using LG? I’m using xcompmgr, is there a “most recommended compositor” by LG folks?
Thanks.

Are you sure? I’m running Picom (the “new” Compton) on Arch/Awesome. My Picom is configured with default transparency and the LG window is not transparent. I have no specific excludes that will hit the LG window. I believe Picom is honoring the *_BYPASS_COMPOSITOR hint which shows up on the window properties.

Absolutely certain, turn on the nvidia info display in nvidia-settings then run LG with -g opengl, you will note that while compton is running nvidia reports the GPU is running in BLIT mode, not FLIP… this is because of the indirect rendering.