eis-client: Always set has_position variable

If meta_eis_viewport_get_position() returned FALSE, the variable
'has_position' would be initialized. This variable represents
exactly the return value of meta_eis_viewport_get_position(),
so just assign it to the variable directly.

Spotted by Coverity.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3237>
This commit is contained in:
Georges Basile Stavracas Neto 2023-09-02 09:57:56 -03:00 committed by Marge Bot
parent 8f0759f0dc
commit 94a39087bc

View File

@ -257,8 +257,7 @@ add_viewport_region (struct eis_device *eis_device,
const char *mapping_id;
struct eis_region *eis_region;
if (meta_eis_viewport_get_position (viewport, &x, &y))
has_position = TRUE;
has_position = meta_eis_viewport_get_position (viewport, &x, &y);
meta_eis_viewport_get_size (viewport, &width, &height);
scale = meta_eis_viewport_get_physical_scale (viewport);