[wayland] Simplify output handling
ClosedPublic

Authored by davidedmundson on Mar 6 2020, 2:49 PM.

Details

Summary

Instead of changing lifespan of kwayland objects we can just call
create() and delete() on it which affects the lifespan of the underlying
resource, but not the kwayland wrapper.

This gets rid of some duplicate syncing.

Test Plan

Ran WAYLAND_DEBUG=1
plugged in and removed a monitor
output showed wl_output and xdg_output being handled correctly

Diff Detail

Repository
R108 KWin
Branch
master
Lint
Lint ErrorsExcuse: asdf
SeverityLocationCodeMessage
Errorutils.h:123CppcheckunknownMacro
Errorutils.h:123CppcheckunknownMacro
Unit
No Unit Test Coverage
Build Status
Buildable 23373
Build 23391: arc lint + arc unit
davidedmundson created this revision.Mar 6 2020, 2:49 PM
Restricted Application added a project: KWin. · View Herald TranscriptMar 6 2020, 2:49 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Mar 6 2020, 2:49 PM
zzag accepted this revision.Mar 10 2020, 5:18 PM
zzag added a subscriber: zzag.

This patch looks alright to me, but I don't feel confident about the part where we assume that deletion of the wl_output global won't corrupt the corresponding XdgOutputInterface object. It might bite us in the future.

abstract_wayland_output.cpp
46–48

Hmm, we probably don't need a lambda here. &AbstractWaylandOutput::updateDpms should be fine.

This revision is now accepted and ready to land.Mar 10 2020, 5:18 PM
This revision was automatically updated to reflect the committed changes.