summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-18 15:05:06 +0000
committerattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-18 15:05:06 +0000
commitad666c747c2e5cb98fba2a1256aad74a815e02b8 (patch)
tree9987279c4dff2801ea43a52cedd04fdf9e1846cb /libvo
parent74ecd509c814f9b3d41708adb79c3e450c05c691 (diff)
downloadmpv-ad666c747c2e5cb98fba2a1256aad74a815e02b8.tar.bz2
mpv-ad666c747c2e5cb98fba2a1256aad74a815e02b8.tar.xz
xinerama fix part 1 - count your paranthesis
xvidix should now work too git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8992 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_xvidix.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/libvo/vo_xvidix.c b/libvo/vo_xvidix.c
index 286e0a193d..7e7dea5e72 100644
--- a/libvo/vo_xvidix.c
+++ b/libvo/vo_xvidix.c
@@ -76,6 +76,10 @@ static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
extern void set_video_eq( int cap );
+#ifdef HAVE_XINERAMA
+extern int xinerama_screen;
+#endif
+
static void set_window(int force_update)
{
Window mRoot;
@@ -127,10 +131,26 @@ static void set_window(int force_update)
screens = XineramaQueryScreens(mDisplay, &num_screens);
/* find the screen we are on */
- while ((screens[i].x_org <= drwcX) || (screens[i].y_org <= drwcY) ||
+ while (i<num_screens &&
+ ((screens[i].x_org < drwcX) || (screens[i].y_org < drwcY) ||
(screens[i].x_org + screens[i].width >= drwcX) ||
- (screens[i].y_org + screens[i].height >= drwcY))
- i++;
+ (screens[i].y_org + screens[i].height >= drwcY)))
+ {
+ i++;
+ }
+
+ if(i<num_screens)
+ {
+ /* save the screen we are on */
+ xinerama_screen = i;
+ } else {
+ /* oops.. couldnt find the screen we are on
+ * because the upper left corner left the
+ * visual range. assume we are still on the
+ * same screen
+ */
+ i = xinerama_screen;
+ }
/* set drwcX and drwcY to the right values */
drwcX = drwcX - screens[i].x_org;