No more wrapper function for x11_check_window

This commit is contained in:
twinaphex 2015-11-19 10:35:15 +01:00
parent b50152902a
commit dd3e7f9ddc
4 changed files with 18 additions and 40 deletions

View File

@ -377,10 +377,22 @@ bool x11_get_metrics(void *data,
void x_input_poll_wheel(void *data, XButtonEvent *event, bool latch);
void x11_check_window(bool *quit)
void x11_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
{
XEvent event;
driver_t *driver = driver_get_ptr();
driver_t *driver = driver_get_ptr();
unsigned new_width = *width;
unsigned new_height = *height;
x11_get_video_size(data, &new_width, &new_height);
if (new_width != *width || new_height != *height)
{
*resize = true;
*width = new_width;
*height = new_height;
}
while (XPending(g_x11_dpy))
{

View File

@ -68,7 +68,8 @@ void x11_handle_key_event(XEvent *event, XIC ic, bool filter);
bool x11_get_metrics(void *data,
enum display_metric_types type, float *value);
void x11_check_window(bool *quit);
void x11_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, unsigned frame_count);
void x11_get_video_size(void *data, unsigned *width, unsigned *height);

View File

@ -206,23 +206,6 @@ static void gfx_ctx_glx_swap_interval(void *data, unsigned interval)
}
}
static void gfx_ctx_glx_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
{
unsigned new_width = *width, new_height = *height;
x11_get_video_size(data, &new_width, &new_height);
if (new_width != *width || new_height != *height)
{
*resize = true;
*width = new_width;
*height = new_height;
}
x11_check_window(quit);
}
static void gfx_ctx_glx_swap_buffers(void *data)
{
driver_t *driver = driver_get_ptr();
@ -690,7 +673,7 @@ const gfx_ctx_driver_t gfx_ctx_glx = {
x11_get_metrics,
NULL,
gfx_ctx_glx_update_window_title,
gfx_ctx_glx_check_window,
x11_check_window,
gfx_ctx_glx_set_resize,
x11_has_focus,
gfx_ctx_glx_suppress_screensaver,

View File

@ -125,24 +125,6 @@ static void gfx_ctx_xegl_swap_interval(void *data, unsigned interval)
}
}
static void gfx_ctx_xegl_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
{
unsigned new_width = *width;
unsigned new_height = *height;
x11_get_video_size(data, &new_width, &new_height);
if (new_width != *width || new_height != *height)
{
*resize = true;
*width = new_width;
*height = new_height;
}
x11_check_window(quit);
}
static void gfx_ctx_xegl_swap_buffers(void *data)
{
(void)data;
@ -727,7 +709,7 @@ const gfx_ctx_driver_t gfx_ctx_x_egl =
x11_get_metrics,
NULL,
gfx_ctx_xegl_update_window_title,
gfx_ctx_xegl_check_window,
x11_check_window,
gfx_ctx_xegl_set_resize,
gfx_ctx_xegl_has_focus,
gfx_ctx_xegl_suppress_screensaver,