render: damage output on view opacity change

This commit is contained in:
Isaac Freund 2021-05-31 01:00:49 +00:00
parent c68b96870f
commit 9ee788b65e
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11

View file

@ -536,7 +536,6 @@ pub fn notifyAppId(self: Self) void {
/// Change the opacity of a view by config.opacity.delta. /// Change the opacity of a view by config.opacity.delta.
/// If the target opacity was reached, return true. /// If the target opacity was reached, return true.
fn incrementOpacity(self: *Self) bool { fn incrementOpacity(self: *Self) bool {
// TODO damage view when implementing damage based rendering
if (self.opacity < self.current.target_opacity) { if (self.opacity < self.current.target_opacity) {
self.opacity += server.config.opacity.delta; self.opacity += server.config.opacity.delta;
if (self.opacity < self.current.target_opacity) return false; if (self.opacity < self.current.target_opacity) return false;
@ -545,6 +544,7 @@ fn incrementOpacity(self: *Self) bool {
if (self.opacity > self.current.target_opacity) return false; if (self.opacity > self.current.target_opacity) return false;
} }
self.opacity = self.current.target_opacity; self.opacity = self.current.target_opacity;
self.output.damage.addWhole();
return true; return true;
} }