mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
Add RARCH_DISPLAY_CTL_IS_FOCUSED
This commit is contained in:
parent
7141210d15
commit
5cea9e5400
@ -727,14 +727,6 @@ bool video_driver_read_viewport(uint8_t *buffer)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool video_driver_focus(void)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
const video_driver_t *video = video_driver_ctx_get_ptr(driver);
|
||||
|
||||
return video->focus(driver->video_data);
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
bool video_driver_overlay_interface(const video_overlay_interface_t **iface)
|
||||
{
|
||||
@ -1189,15 +1181,15 @@ void video_driver_set_pixel_format(enum retro_pixel_format fmt)
|
||||
|
||||
bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
const video_driver_t *video = video_driver_ctx_get_ptr(driver);
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case RARCH_DISPLAY_CTL_IS_FOCUSED:
|
||||
return video->focus(driver->video_data);
|
||||
case RARCH_DISPLAY_CTL_HAS_WINDOWED:
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
const video_driver_t *video = video_driver_ctx_get_ptr(driver);
|
||||
|
||||
return video->has_windowed(driver->video_data);
|
||||
}
|
||||
return video->has_windowed(driver->video_data);
|
||||
case RARCH_DISPLAY_CTL_GET_FRAME_COUNT:
|
||||
{
|
||||
uint64_t **ptr = (uint64_t**)data;
|
||||
|
@ -224,6 +224,7 @@ enum rarch_display_ctl_state
|
||||
RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE,
|
||||
RARCH_DISPLAY_CTL_FRAME_FILTER_IS_32BIT,
|
||||
RARCH_DISPLAY_CTL_HAS_WINDOWED,
|
||||
RARCH_DISPLAY_CTL_IS_FOCUSED,
|
||||
RARCH_DISPLAY_CTL_GET_FRAME_COUNT
|
||||
};
|
||||
|
||||
@ -317,8 +318,6 @@ bool video_driver_read_viewport(uint8_t *buffer);
|
||||
bool video_driver_set_shader(enum rarch_shader_type type,
|
||||
const char *path);
|
||||
|
||||
bool video_driver_focus(void);
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
bool video_driver_overlay_interface(const video_overlay_interface_t **iface);
|
||||
#endif
|
||||
|
@ -320,7 +320,7 @@ static void x_input_poll_mouse(x11_input_t *x11)
|
||||
x11->mouse_r = mask & Button3Mask;
|
||||
|
||||
/* Somewhat hacky, but seem to do the job. */
|
||||
if (x11->grab_mouse && video_driver_focus())
|
||||
if (x11->grab_mouse && video_driver_ctl(RARCH_DISPLAY_CTL_IS_FOCUSED, NULL))
|
||||
{
|
||||
int mid_w, mid_h;
|
||||
struct video_viewport vp = {0};
|
||||
@ -363,7 +363,7 @@ static void x_input_poll(void *data)
|
||||
{
|
||||
x11_input_t *x11 = (x11_input_t*)data;
|
||||
|
||||
if (video_driver_focus())
|
||||
if (video_driver_ctl(RARCH_DISPLAY_CTL_IS_FOCUSED, NULL))
|
||||
XQueryKeymap(x11->display, x11->state);
|
||||
else
|
||||
memset(x11->state, 0, sizeof(x11->state));
|
||||
|
Loading…
Reference in New Issue
Block a user