Skip to content

Commit

Permalink
vulkan/context: trying these events for resizing the window
Browse files Browse the repository at this point in the history
  • Loading branch information
themisterholliday committed Mar 7, 2024
1 parent 4ff3a58 commit e90464f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions video/out/vo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,11 +1340,14 @@ double vo_get_display_fps(struct vo *vo)
// vo_query_and_reset_events() can retrieve the events again.
void vo_event(struct vo *vo, int event)
{
MP_VERBOSE(vo, "### 1343 - vo.c: %d\n", event);
struct vo_internal *in = vo->in;
mp_mutex_lock(&in->lock);
if ((in->queued_events & event & VO_EVENTS_USER) != (event & VO_EVENTS_USER))
MP_VERBOSE(vo, "### 1347 - vo.c: %d\n", event);
wakeup_core(vo);
if (event)
MP_VERBOSE(vo, "### 1350 - vo.c: %d\n", event);
wakeup_locked(vo);
in->queued_events |= event;
in->internal_events |= event;
Expand Down
7 changes: 7 additions & 0 deletions video/out/vo_gpu_next.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,20 +1141,27 @@ static int query_format(struct vo *vo, int format)

static void resize(struct vo *vo)
{
MP_VERBOSE(vo, "### vo_gpu_next.c 1144: %dx%d)\n", vo->dwidth, vo->dheight);

struct priv *p = vo->priv;
struct mp_rect src, dst;
struct mp_osd_res osd;
vo_get_src_dst_rects(vo, &src, &dst, &osd);
if (vo->dwidth && vo->dheight) {
MP_VERBOSE(vo, "### vo_gpu_next.c 1151: %dx%d)\n", vo->dwidth, vo->dheight);
gpu_ctx_resize(p->context, vo->dwidth, vo->dheight);
vo->want_redraw = true;
}

MP_VERBOSE(vo, "### vo_gpu_next.c 1156 - mp_rect_equals(&p->src, &src): %s\n", mp_rect_equals(&p->src, &src) ? "true" : "false");
MP_VERBOSE(vo, "### vo_gpu_next.c 1156 - mp_rect_equals(&p->dst, &dst): %s\n", mp_rect_equals(&p->dst, &dst) ? "true" : "false");
MP_VERBOSE(vo, "### vo_gpu_next.c 1156 - osd_res_equals(p->osd_res, osd): %s\n", osd_res_equals(p->osd_res, osd) ? "true" : "false");
if (mp_rect_equals(&p->src, &src) &&
mp_rect_equals(&p->dst, &dst) &&
osd_res_equals(p->osd_res, osd))
return;

MP_VERBOSE(vo, "### vo_gpu_next.c 1161: %dx%d)\n", vo->dwidth, vo->dheight);
p->osd_sync++;
p->osd_res = osd;
p->src = src;
Expand Down
1 change: 1 addition & 0 deletions video/out/vulkan/context_moltenvk.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ static bool moltenvk_reconfig(struct ra_ctx *ctx)
vo_event(ctx->vo, VO_EVENT_RESIZE);
vo_event(ctx->vo, VO_EVENT_EXPOSE);
vo_event(ctx->vo, VO_EVENT_WIN_STATE);
vo_wakeup(ctx->vo);
MP_MSG(ctx, MSGL_V, "Width: %f, Height: %f ### Called resize\n", s.width, s.height);
return true;
}
Expand Down

0 comments on commit e90464f

Please sign in to comment.