mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 11:43:00 +00:00
Create x11_save_last_used_monitor
This commit is contained in:
parent
c4354ff429
commit
6c6beca430
@ -597,3 +597,21 @@ void x11_event_queue_check(XEvent *event)
|
||||
{
|
||||
XIfEvent(g_x11_dpy, event, x11_wait_notify, NULL);
|
||||
}
|
||||
|
||||
void x11_save_last_used_monitor(Window win)
|
||||
{
|
||||
#ifdef HAVE_XINERAMA
|
||||
XWindowAttributes target;
|
||||
Window child;
|
||||
int x = 0, y = 0;
|
||||
|
||||
XGetWindowAttributes(g_x11_dpy, g_x11_win, &target);
|
||||
XTranslateCoordinates(g_x11_dpy, g_x11_win, DefaultRootWindow(g_x11_dpy),
|
||||
target.x, target.y, &x, &y, &child);
|
||||
|
||||
g_x11_screen = x11_get_xinerama_monitor(g_x11_dpy, x, y,
|
||||
target.width, target.height);
|
||||
|
||||
RARCH_LOG("[X11]: Saved monitor #%u.\n", g_x11_screen);
|
||||
#endif
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ extern Display *g_x11_dpy;
|
||||
extern Colormap g_x11_cmap;
|
||||
extern unsigned g_x11_screen;
|
||||
|
||||
void x11_save_last_used_monitor(Window win);
|
||||
void x11_show_mouse(Display *dpy, Window win, bool state);
|
||||
void x11_windowed_fullscreen(Display *dpy, Window win);
|
||||
void x11_suspend_screensaver(Window win);
|
||||
|
@ -89,23 +89,7 @@ static void ctx_glx_destroy_resources(gfx_ctx_glx_data_t *glx)
|
||||
glx->g_glx_win = 0;
|
||||
|
||||
/* Save last used monitor for later. */
|
||||
#ifdef HAVE_XINERAMA
|
||||
{
|
||||
XWindowAttributes target;
|
||||
Window child;
|
||||
|
||||
int x = 0, y = 0;
|
||||
XGetWindowAttributes(g_x11_dpy, g_x11_win, &target);
|
||||
XTranslateCoordinates(g_x11_dpy, g_x11_win, DefaultRootWindow(g_x11_dpy),
|
||||
target.x, target.y, &x, &y, &child);
|
||||
|
||||
g_x11_screen = x11_get_xinerama_monitor(g_x11_dpy, x, y,
|
||||
target.width, target.height);
|
||||
|
||||
RARCH_LOG("[GLX]: Saved monitor #%u.\n", g_x11_screen);
|
||||
}
|
||||
#endif
|
||||
|
||||
x11_save_last_used_monitor(DefaultRootWindow(g_x11_dpy));
|
||||
x11_window_destroy(false);
|
||||
}
|
||||
|
||||
|
@ -48,21 +48,7 @@ static void gfx_ctx_xegl_destroy(void *data)
|
||||
if (g_x11_win)
|
||||
{
|
||||
/* Save last used monitor for later. */
|
||||
#ifdef HAVE_XINERAMA
|
||||
XWindowAttributes target;
|
||||
Window child;
|
||||
int x = 0, y = 0;
|
||||
|
||||
XGetWindowAttributes(g_x11_dpy, g_x11_win, &target);
|
||||
XTranslateCoordinates(g_x11_dpy, g_x11_win, RootWindow(g_x11_dpy, DefaultScreen(g_x11_dpy)),
|
||||
target.x, target.y, &x, &y, &child);
|
||||
|
||||
g_x11_screen = x11_get_xinerama_monitor(g_x11_dpy, x, y,
|
||||
target.width, target.height);
|
||||
|
||||
RARCH_LOG("[X/EGL]: Saved monitor #%u.\n", g_x11_screen);
|
||||
#endif
|
||||
|
||||
x11_save_last_used_monitor(RootWindow(g_x11_dpy, DefaultScreen(g_x11_dpy)));
|
||||
x11_window_destroy(false);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user