summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/splash.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-11 00:11:12 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-11 00:11:12 +0000
commitaa60741972d71a7388346c35b4ce7d2154d952ce (patch)
treeee1b57c4e7ec1bec7695e108161083a6fc54f47a /beryl-plugins/src/splash.c
parentb89baa375265bed53737af9b0512cef2a9de9d8d (diff)
downloadmarex-dev-aa60741972d71a7388346c35b4ce7d2154d952ce.tar.gz
marex-dev-aa60741972d71a7388346c35b4ce7d2154d952ce.tar.bz2
xinerama updates
git-svn-id: file:///beryl/trunk@587 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/splash.c')
-rw-r--r--beryl-plugins/src/splash.c71
1 files changed, 40 insertions, 31 deletions
diff --git a/beryl-plugins/src/splash.c b/beryl-plugins/src/splash.c
index b2963af..80016ec 100644
--- a/beryl-plugins/src/splash.c
+++ b/beryl-plugins/src/splash.c
@@ -296,6 +296,11 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
status = (*s->paintScreen) (s, sa, region, output, mask);
WRAP (ss, s, paintScreen, splashPaintScreen);
+ int s_x = screenGetOutputDevX (s, output + 1);
+ int s_y = screenGetOutputDevY (s, output + 1);
+ int s_width = screenGetOutputDevWidth (s, output + 1);
+ int s_height = screenGetOutputDevHeight (s, output + 1);
+
if (!ss->active)
return status;
@@ -322,8 +327,8 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
{
glEnable (GL_TEXTURE_RECTANGLE_ARB);
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, ss->background.handle);
- glCopyTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, 0, 0,
- s->width, s->height);
+ glCopyTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, s_x, s_y, s_x, s_y,
+ s_width, s_height);
GLfloat constant[4];
@@ -371,14 +376,14 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constant);
glBegin (GL_QUADS);
- glTexCoord2f (0, s->height);
- glVertex2f (0, 0);
- glTexCoord2f (0, 0);
- glVertex2f (0, s->height);
- glTexCoord2f (s->width, 0);
- glVertex2f (s->width, s->height);
- glTexCoord2f (s->width, s->height);
- glVertex2f (s->width, 0);
+ glTexCoord2f (s_x, s_y + s_height);
+ glVertex2f (s_x, s_y);
+ glTexCoord2f (s_x, s_y);
+ glVertex2f (s_x, s_y + s_height);
+ glTexCoord2f (s_x + s_width, s_y);
+ glVertex2f (s_x + s_width, s_y + s_height);
+ glTexCoord2f (s_x + s_width, s_y + s_height);
+ glVertex2f (s_x + s_width, s_y);
glEnd ();
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
@@ -394,10 +399,10 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
(sd->opt[SPLASH_DISPLAY_OPTION_DISABLE_UPDATE].value.
b) ? darken : alpha * darken);
glBegin (GL_QUADS);
- glVertex2f (0, 0);
- glVertex2f (0, s->height);
- glVertex2f (s->width, s->height);
- glVertex2f (s->width, 0);
+ glVertex2f (s_x, s_y);
+ glVertex2f (s_x, s_y + s_height);
+ glVertex2f (s_x + s_width, s_y + s_height);
+ glVertex2f (s_x + s_width, s_y);
glEnd ();
}
@@ -407,11 +412,12 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
// save background
if (ss->doUpdate)
{
- ss->doUpdate = FALSE;
+ if (output + 1 == s->nOutputDev)
+ ss->doUpdate = FALSE;
glEnable (GL_TEXTURE_RECTANGLE_ARB);
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, ss->background.handle);
- glCopyTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, 0, 0,
- s->width, s->height);
+ glCopyTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, s_x, s_y, s_x,
+ s_y, s_width, s_height);
glDisable (GL_TEXTURE_RECTANGLE_ARB);
glPopMatrix ();
glDisable (GL_BLEND);
@@ -433,14 +439,15 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
glColor4f (1.0, 1.0, 1.0, alpha);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBegin (GL_QUADS);
- glTexCoord2f (0, s->height);
- glVertex2f (0, 0);
- glTexCoord2f (0, 0);
- glVertex2f (0, s->height);
- glTexCoord2f (s->width, 0);
- glVertex2f (s->width, s->height);
- glTexCoord2f (s->width, s->height);
- glVertex2f (s->width, 0);
+ glBegin (GL_QUADS);
+ glTexCoord2f (s_x, s_y + s_height);
+ glVertex2f (s_x, s_y);
+ glTexCoord2f (s_x, s_y);
+ glVertex2f (s_x, s_y + s_height);
+ glTexCoord2f (s_x + s_width, s_y);
+ glVertex2f (s_x + s_width, s_y + s_height);
+ glTexCoord2f (s_x + s_width, s_y + s_height);
+ glVertex2f (s_x + s_width, s_y);
glEnd ();
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
@@ -472,11 +479,11 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
if (s->nOutputDev > 1)
{
head = screenGetCurrentOutputDev (s);
- x = (screenGetOutputDevAreaWidth (s, head) - ss->backSize[0]) / 2;
- y = (screenGetOutputDevAreaHeight (s, head) - ss->backSize[1]) / 2;
+ x = (screenGetOutputDevWidth (s, head) - ss->backSize[0]) / 2;
+ y = (screenGetOutputDevHeight (s, head) - ss->backSize[1]) / 2;
- x += screenGetOutputDevAreaX (s, head);
- y += screenGetOutputDevAreaY (s, head);
+ x += screenGetOutputDevX (s, head);
+ y += screenGetOutputDevY (s, head);
}
else
{
@@ -521,7 +528,8 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
{
head = screenGetCurrentOutputDev (s);
x = (screenGetOutputDevAreaWidth (s, head) - ss->backSize[0]) / 2;
- y = (screenGetOutputDevAreaHeight (s, head) - ss->backSize[1]) / 2;
+ y = (screenGetOutputDevAreaHeight (s, head) -
+ ss->backSize[1]) / 2;
x += screenGetOutputDevAreaX (s, head);
y += screenGetOutputDevAreaY (s, head);
@@ -545,7 +553,8 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
{
head = screenGetCurrentOutputDev (s);
x = (screenGetOutputDevAreaWidth (s, head) - ss->logoSize[0]) / 2;
- y = (screenGetOutputDevAreaHeight (s, head) - ss->logoSize[1]) / 2;
+ y = (screenGetOutputDevAreaHeight (s, head) -
+ ss->logoSize[1]) / 2;
x += screenGetOutputDevAreaX (s, head);
y += screenGetOutputDevAreaY (s, head);