JBR-3896 Abysmally slow input and UI performance since upgrade to IU-213.4928.7 from previous 2021.3 EAP version

The slowness was the result of XWM.getInsetsFromExtents() repeated
attempts to acquire frame extents from a property that under Sway is
simply unavailable. Each attempt added at least 20ms to every re-draw.

Prior to (repeatedly) checking for NET_FRAME_EXTENTS property of a
window, check that the property is supported by the window manager.

(cherry picked from commit b40cc1c791)
This commit is contained in:
Maxim Kartashev
2021-10-28 16:02:59 +03:00
committed by jbrbot
parent 603509c6c4
commit 4ff6434286

View File

@@ -1479,8 +1479,12 @@ final class XWM
if (window == XConstants.None) {
return null;
}
XNETProtocol net_protocol = getWM().getNETProtocol();
if (net_protocol != null && net_protocol.active()) {
final XNETProtocol net_protocol = getWM().getNETProtocol();
final boolean frameExtentsSupported =
net_protocol != null
&& net_protocol.active()
&& net_protocol.checkProtocol(net_protocol.XA_NET_SUPPORTED, XA_NET_FRAME_EXTENTS);
if (frameExtentsSupported) {
Insets insets = null;
final int MAX_RETRY_COUNT = 3;
for (int i = 0; i < MAX_RETRY_COUNT; i++) {