From 52c5f0545bcfd67e723f5ebbcdd0f3eabe216a51 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 22 Nov 2021 13:06:08 +0900 Subject: [PATCH] [input] Add broadcast event for application window changes This is the first step in the long-sought goal of allowing the window size to change, but is required for passing on getting window position and size information (though size is in viddef, it makes sense to pass both together). --- include/QF/input/event.h | 8 ++++++++ ruamoko/qwaq/builtins/input.c | 1 + 2 files changed, 9 insertions(+) diff --git a/include/QF/input/event.h b/include/QF/input/event.h index 4b526fa61..de80c2b16 100644 --- a/include/QF/input/event.h +++ b/include/QF/input/event.h @@ -33,6 +33,11 @@ #include "QF/qtypes.h" +typedef struct { + int xpos, ypos; + int xlen, ylen; +} IE_app_window_event_t; + typedef enum { ies_shift = 1, ies_capslock = 2, @@ -84,6 +89,7 @@ typedef enum { ie_none, ie_gain_focus, ie_lose_focus, + ie_app_window, ie_add_device, ie_remove_device, ie_mouse, @@ -97,12 +103,14 @@ typedef enum { #define IE_broadcast_events (0 \ | (1 << ie_add_device) \ | (1 << ie_remove_device) \ + | (1 << ie_app_window) \ ) typedef struct IE_event_s { IE_event_type type; uint64_t when; union { + IE_app_window_event_t app_window; IE_mouse_event_t mouse; IE_key_event_t key; IE_axis_event_t axis; diff --git a/ruamoko/qwaq/builtins/input.c b/ruamoko/qwaq/builtins/input.c index 43b6c78b0..0e7305047 100644 --- a/ruamoko/qwaq/builtins/input.c +++ b/ruamoko/qwaq/builtins/input.c @@ -543,6 +543,7 @@ qwaq_input_event_handler (const IE_event_t *ie_event, void *_res) case ie_none: case ie_gain_focus: case ie_lose_focus: + case ie_app_window: return 0; case ie_add_device: event.what = qe_dev_add;