1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 00:29:02 +00:00

command: only avoid redrawing when old and new osd are both hidden

The `osd-overlay` command didn't trigger a redraw when the overlay was
set to hidden.
This is fine when the overlay was already hidden before that, but
transitioning from not hidden to hidden requires a redraw.
This commit is contained in:
Christoph Heinrich 2023-02-07 19:06:22 +01:00 committed by sfan5
parent 180b4faed0
commit 8f76673608

View File

@ -572,6 +572,11 @@ void osd_set_external(struct osd_state *osd, struct osd_external_ass *ov)
goto done;
}
if (!entry->ov.hidden || !ov->hidden) {
obj->changed = true;
osd->want_redraw_notification = true;
}
entry->ov.format = ov->format;
if (!entry->ov.data)
entry->ov.data = talloc_strdup(entry, "");
@ -585,11 +590,6 @@ void osd_set_external(struct osd_state *osd, struct osd_external_ass *ov)
update_external(osd, obj, entry);
if (!entry->ov.hidden) {
obj->changed = true;
osd->want_redraw_notification = true;
}
if (zorder_changed) {
qsort(obj->externals, obj->num_externals, sizeof(obj->externals[0]),
cmp_zorder);