- Fix patch-mpeg2dec_libvo_video_out_x11.c

- Fixes issue: x11/electricsheep works incorrectly on multiple
   monitors setup on nvidia cards with the TwinView option set.

PR:		ports/124761
Submitted by:	Eugene M. Zheganin <emz@norma.perm.ru>
Approved by:	David Yeske <dyeske@gmail.com> (maintainer)
This commit is contained in:
Beech Rintoul 2008-07-01 19:36:36 +00:00
parent ae4958b0ff
commit 53f55af210
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=216102

View File

@ -1,6 +1,29 @@
--- mpeg2dec/libvo/video_out_x11.c.orig Fri Jun 6 02:15:57 2003
+++ mpeg2dec/libvo/video_out_x11.c Sun Jan 25 00:03:30 2004
@@ -235,7 +235,9 @@
--- mpeg2dec/libvo/video_out_x11.c.orig 2006-06-27 01:28:08.000000000 +0600
+++ mpeg2dec/libvo/video_out_x11.c 2008-06-20 18:26:01.000000000 +0600
@@ -531,14 +531,18 @@
if (window_id == -3) {
/* display zoomed on the (virtual) root window */
instance->window = DefaultRootWindow (instance->display);
- instance->displaywidth = DisplayWidth(instance->display, DefaultScreen (instance->display));
- instance->displayheight = DisplayHeight(instance->display, DefaultScreen (instance->display));
+ XWindowAttributes xgwa;
+ XGetWindowAttributes (instance->display, instance->window, &xgwa);
+ instance->displaywidth = xgwa.width;
+ instance->displayheight = xgwa.height;
} else if (window_id == -2) {
/* display non-zoomed on the (virtual) root window */
int w, h;
- w = DisplayWidth(instance->display, DefaultScreen (instance->display));
- h = DisplayHeight(instance->display, DefaultScreen (instance->display));
instance->window = DefaultRootWindow (instance->display);
+ XWindowAttributes xgwa;
+ XGetWindowAttributes (instance->display, instance->window, &xgwa);
+ w = xgwa.width;
+ h = xgwa.height;
instance->corner_x = (w - instance->width)/2;
instance->corner_y = (h - instance->height)/2;
} else if (window_id == -1) {
@@ -593,7 +597,9 @@
/* this would break the solaris port though :-/ */
/* fuck solaris, plug the leak! */
@ -10,7 +33,7 @@
/* XShmAttach fails on remote displays, so we have to catch this event */
@@ -254,6 +256,9 @@
@@ -612,6 +618,9 @@
return NULL;
}
@ -20,7 +43,7 @@
return instance->shminfo.shmaddr;
}
@@ -640,6 +645,9 @@
@@ -1006,6 +1015,9 @@
if (instance == NULL)
return NULL;
@ -30,7 +53,7 @@
instance->vo.setup = x11_setup;
return (vo_instance_t *) instance;
}
@@ -658,6 +666,9 @@
@@ -1024,6 +1036,9 @@
if (instance == NULL)
return NULL;