mirror of https://github.com/mpv-player/mpv
Always calculate the xinerama screen mplayer is on.
Bug reported by thomas.lindroth(<at>)gmail.com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26437 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4be1fe461f
commit
d48f39e68c
|
@ -368,6 +368,9 @@ static void init_atoms(void)
|
||||||
|
|
||||||
void update_xinerama_info(void) {
|
void update_xinerama_info(void) {
|
||||||
int screen = xinerama_screen;
|
int screen = xinerama_screen;
|
||||||
|
// center coordinates of the window
|
||||||
|
int x = vo_dx + vo_dwidth / 2;
|
||||||
|
int y = vo_dy + vo_dheight / 2;
|
||||||
xinerama_x = xinerama_y = 0;
|
xinerama_x = xinerama_y = 0;
|
||||||
#ifdef HAVE_XINERAMA
|
#ifdef HAVE_XINERAMA
|
||||||
if (screen >= -1 && XineramaIsActive(mDisplay))
|
if (screen >= -1 && XineramaIsActive(mDisplay))
|
||||||
|
@ -376,11 +379,6 @@ void update_xinerama_info(void) {
|
||||||
int num_screens;
|
int num_screens;
|
||||||
|
|
||||||
screens = XineramaQueryScreens(mDisplay, &num_screens);
|
screens = XineramaQueryScreens(mDisplay, &num_screens);
|
||||||
if (screen >= num_screens)
|
|
||||||
screen = num_screens - 1;
|
|
||||||
if (screen == -1) {
|
|
||||||
int x = vo_dx + vo_dwidth / 2;
|
|
||||||
int y = vo_dy + vo_dheight / 2;
|
|
||||||
for (screen = num_screens - 1; screen > 0; screen--) {
|
for (screen = num_screens - 1; screen > 0; screen--) {
|
||||||
int left = screens[screen].x_org;
|
int left = screens[screen].x_org;
|
||||||
int right = left + screens[screen].width;
|
int right = left + screens[screen].width;
|
||||||
|
@ -389,7 +387,6 @@ void update_xinerama_info(void) {
|
||||||
if (left <= x && x <= right && top <= y && y <= bottom)
|
if (left <= x && x <= right && top <= y && y <= bottom)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (screen < 0)
|
if (screen < 0)
|
||||||
screen = 0;
|
screen = 0;
|
||||||
vo_screenwidth = screens[screen].width;
|
vo_screenwidth = screens[screen].width;
|
||||||
|
|
Loading…
Reference in New Issue