summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-01-15 22:53:53 +0100
committerwm4 <wm4@nowhere>2016-01-15 22:54:08 +0100
commit20991a95b8cbbae42ee4226282841d028355808b (patch)
treed4bdeb3e44456804906e23e4e0ce9820b5ab08c2
parent31adc87bde5d7d671b9b52cd912875d037501a1c (diff)
downloadmpv-20991a95b8cbbae42ee4226282841d028355808b.tar.bz2
mpv-20991a95b8cbbae42ee4226282841d028355808b.tar.xz
osd: make osd-width/height properties watchable
-rw-r--r--player/command.c2
-rw-r--r--sub/osd.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/player/command.c b/player/command.c
index 453ab47b92..46c608389a 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3733,7 +3733,7 @@ static const char *const *const mp_event_property_change[] = {
E(MP_EVENT_CACHE_UPDATE, "cache", "cache-free", "cache-used", "cache-idle",
"demuxer-cache-duration", "demuxer-cache-idle", "paused-for-cache",
"demuxer-cache-time"),
- E(MP_EVENT_WIN_RESIZE, "window-scale"),
+ E(MP_EVENT_WIN_RESIZE, "window-scale", "osd-width", "osd-height", "osd-par"),
E(MP_EVENT_WIN_STATE, "window-minimized", "display-names", "display-fps", "fullscreen"),
};
#undef E
diff --git a/sub/osd.c b/sub/osd.c
index 63d6136b9f..fd821923e5 100644
--- a/sub/osd.c
+++ b/sub/osd.c
@@ -32,6 +32,8 @@
#include "options/options.h"
#include "common/global.h"
#include "common/msg.h"
+#include "player/client.h"
+#include "player/command.h"
#include "osd.h"
#include "osd_state.h"
#include "dec_sub.h"
@@ -238,9 +240,12 @@ static void render_object(struct osd_state *osd, struct osd_object *obj,
*out_imgs = (struct sub_bitmaps) {0};
- if (!osd_res_equals(res, obj->vo_res))
+ if (!osd_res_equals(res, obj->vo_res)) {
+ obj->vo_res = res;
obj->force_redraw = true;
- obj->vo_res = res;
+ mp_client_broadcast_event(mp_client_api_get_core(osd->global->client_api),
+ MP_EVENT_WIN_RESIZE, NULL);
+ }
if (obj->type == OSDTYPE_SUB || obj->type == OSDTYPE_SUB2) {
if (obj->sub) {