Skip to content

Bugfix: fix crash during frequent screen plugging and unplugging

zhenyan huang requested to merge hzy/kwin:fixhotplugging into master

Problem description

The wayland client crashes when the extension screen is pulled and plugged in quickly and frequently. Especially when a large number of wayland clients are launched, the reproduction probability is significantly improved.

Reason

The reason for the client crash is that in the wayland protocol code generated by qtwaylandscanner used by kwin, the timeout time between the removal of the global object (in here aka wl_output) and the destruction is 5s, but a large number of applications will request the bind server global object at the same time. Quickly plugging and unplugging the screen at this point may cause the 5s to be insufficient.

Change

Obey the wayland offical protocol recommendation, just defer deleting global object, thus keep client's request vaild for a while.

Reference

This bug also occur in all wayladn compositors, e.g., mutter.

Merge request reports