From 3af078b77a6457b2dc2508f8203bfbbf83bd9f89 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 22 Nov 2021 13:11:37 +0900 Subject: [PATCH] [x11] Send app_window event when window moves This is needed for getting window position info into in_x11 without exposing more globals, and is likely to be useful for other things, especially as it doubles as a resize event when that's eventually supported. --- libs/video/targets/context_x11.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/video/targets/context_x11.c b/libs/video/targets/context_x11.c index 923203f01..d5b6f8dd4 100644 --- a/libs/video/targets/context_x11.c +++ b/libs/video/targets/context_x11.c @@ -66,6 +66,8 @@ #include "QF/va.h" #include "QF/vid.h" +#include "QF/input/event.h" + #include "context_x11.h" #include "dga_check.h" #include "in_x11.h" @@ -164,6 +166,17 @@ configure_notify (XEvent *event) c->serial, c->send_event, c->event, c->window, c->x, c->y, c->width, c->height, c->border_width, c->above, c->override_redirect); + IE_event_t ie_event = { + .type = ie_app_window, + .when = Sys_LongTime (), + .app_window = { + .xpos = c->x, + .ypos = c->y, + .xlen = c->width, + .ylen = c->height, + }, + }; + IE_Send_Event (&ie_event); } qboolean