[vlc-commits] caca: report events via the dummy window, simplify
Rémi Denis-Courmont
git at videolan.org
Sun May 20 19:52:06 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 17 23:24:07 2018 +0300| [2876fcfed151bbc8bca1d2865ba46b90f835c090] | committer: Rémi Denis-Courmont
caca: report events via the dummy window, simplify
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2876fcfed151bbc8bca1d2865ba46b90f835c090
---
modules/video_output/caca.c | 27 ++++++++++-----------------
1 file changed, 10 insertions(+), 17 deletions(-)
diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index cc733f83fd..7f161298df 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -75,7 +75,7 @@ noreturn static void *VoutDisplayEventKeyDispatch(void *data)
memcpy(&key, event->p_buffer, sizeof (key));
block_Release(event);
- vout_display_SendEventKey(vd, key);
+ vout_window_ReportKeyPress(vd->cfg->window, key);
vlc_restorecancel(cancel);
}
}
@@ -330,22 +330,13 @@ static void Manage(vout_display_t *vd)
}
case CACA_EVENT_RESIZE:
break;
- case CACA_EVENT_MOUSE_MOTION: {
- vout_display_place_t place;
- Place(vd, &place);
-
- const unsigned x = vd->source.i_x_offset +
- (int64_t)(caca_get_event_mouse_x(&ev) - place.x) *
- vd->source.i_visible_width / place.width;
- const unsigned y = vd->source.i_y_offset +
- (int64_t)(caca_get_event_mouse_y(&ev) - place.y) *
- vd->source.i_visible_height / place.height;
-
+ case CACA_EVENT_MOUSE_MOTION:
caca_set_mouse(sys->dp, 1);
sys->cursor_deadline = mdate() + sys->cursor_timeout;
- vout_display_SendEventMouseMoved(vd, x, y);
+ vout_window_ReportMouseMoved(vd->cfg->window,
+ caca_get_event_mouse_x(&ev),
+ caca_get_event_mouse_y(&ev));
break;
- }
case CACA_EVENT_MOUSE_PRESS:
case CACA_EVENT_MOUSE_RELEASE: {
caca_set_mouse(sys->dp, 1);
@@ -355,16 +346,18 @@ static void Manage(vout_display_t *vd)
for (int i = 0; mouses[i].caca != -1; i++) {
if (mouses[i].caca == caca) {
if (caca_get_event_type(&ev) == CACA_EVENT_MOUSE_PRESS)
- vout_display_SendEventMousePressed(vd, mouses[i].vlc);
+ vout_window_ReportMousePressed(vd->cfg->window,
+ mouses[i].vlc);
else
- vout_display_SendEventMouseReleased(vd, mouses[i].vlc);
+ vout_window_ReportMouseReleased(vd->cfg->window,
+ mouses[i].vlc);
return;
}
}
break;
}
case CACA_EVENT_QUIT:
- vout_display_SendEventClose(vd);
+ vout_window_ReportClose(vd->cfg->window);
break;
default:
break;
More information about the vlc-commits
mailing list