[kstyle] Use QX11Info::isCompositingManagerRunning()
ClosedPublic

Authored by zzag on Jan 29 2020, 1:51 AM.

Details

Summary

Every time Breeze needs to check whether given widget has an alpha
channel, it makes a synchronous X call to figure out whether a
compositing window manager is running on a particular screen. This
is inefficient!

Luckily for us, Qt XCB QPA monitors compositing manager selections
and caches the ownership status of each one. That cached ownership
data can be accessed via QX11Info::isCompositingManagerRunning().

Diff Detail

Repository
R31 Breeze
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Jan 29 2020, 1:51 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 29 2020, 1:51 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
zzag requested review of this revision.Jan 29 2020, 1:51 AM
zzag added a comment.Jan 29 2020, 1:59 AM

monitors compositing manager selections

Only if XFIXES is present; otherwise it will fallback to xcb_get_selection_owner as Breeze does now.

zzag updated this revision to Diff 74598.Jan 29 2020, 5:35 PM

Fix coding style.

hpereiradacosta accepted this revision.Jan 29 2020, 5:42 PM

Makes sense, thanks !

In principle, the removal of Helper::connection, although is a change unrelated to the commit purpose. Maybe put it in a different commit ?
(the story behind if I remember right is that QX11Info::connection have not always been available in the past. hence the method)

This revision is now accepted and ready to land.Jan 29 2020, 5:42 PM
zzag added a comment.Jan 29 2020, 5:48 PM

In principle, the removal of Helper::connection, although is a change unrelated to the commit purpose. Maybe put it in a different commit ?

Will do. (I removed it as a preparation step for QWindow::startSystemMove())

zzag updated this revision to Diff 74606.Jan 29 2020, 6:42 PM

update

This revision was automatically updated to reflect the committed changes.