fractional-scale: avoid redundant and duplicate scale events

fixes #9126
This commit is contained in:
Vaxry 2025-01-22 10:41:04 +00:00
parent c8a0443adc
commit d335c8f101
3 changed files with 21 additions and 21 deletions

View file

@ -13,25 +13,23 @@ class CFractionalScaleAddon {
CFractionalScaleAddon(SP<CWpFractionalScaleV1> resource_, SP<CWLSurfaceResource> surf_);
void setScale(const float& scale);
void onSurfaceDestroy();
bool good();
SP<CWLSurfaceResource> surf();
bool operator==(const wl_resource* other) const {
return other == resource->resource();
return other == m_resource->resource();
}
bool operator==(const CFractionalScaleAddon* other) const {
return other->resource == resource;
return other->m_resource == m_resource;
}
private:
SP<CWpFractionalScaleV1> resource;
float scale = 1.F;
WP<CWLSurfaceResource> surface;
bool surfaceGone = false;
SP<CWpFractionalScaleV1> m_resource;
float m_scale = -1.F; // unset
WP<CWLSurfaceResource> m_surface;
friend class CFractionalScaleProtocol;
};