summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--beryl-core/include/beryl.h18
-rw-r--r--beryl-core/src/display.c22
-rw-r--r--beryl-core/src/event.c6
-rw-r--r--beryl-core/src/paint.c36
-rw-r--r--beryl-core/src/screen.c42
-rw-r--r--beryl-plugins/src/cube.c4
-rw-r--r--beryl-plugins/src/rotate.c8
-rw-r--r--beryl-plugins/src/scale.c6
-rw-r--r--beryl-plugins/src/switcher.c5
-rw-r--r--distro-specific-build-files/beryl-core/debian/changelog2
10 files changed, 102 insertions, 47 deletions
diff --git a/beryl-core/include/beryl.h b/beryl-core/include/beryl.h
index 9f77039..0c59fe2 100644
--- a/beryl-core/include/beryl.h
+++ b/beryl-core/include/beryl.h
@@ -26,7 +26,7 @@
#ifndef _BERYL_H
#define _BERYL_H
-#define BERYL_VERSION 14
+#define BERYL_VERSION 15
#define BERYL_ABI_INFO \
BERYL_VERSION, \
@@ -1033,6 +1033,11 @@ void
translateRotateScreen (const ScreenPaintAttrib *sa);
void
+prepareXCoords (CompScreen *screen,
+ int output,
+ float z);
+
+void
paintTransformedScreen (CompScreen *screen,
const ScreenPaintAttrib *sAttrib,
int output,
@@ -1182,7 +1187,7 @@ disableTexture (CompScreen *screen,
#define COMP_SCREEN_OPTION_SYNC_TO_VBLANK 7
#define COMP_SCREEN_OPTION_SLOWNESS_FIX 8
#define COMP_SCREEN_OPTION_VSIZE 9
-#define COMP_SCREEN_OPTION_NUMBER_OF_DESKTOPS 9
+#define COMP_SCREEN_OPTION_NUMBER_OF_DESKTOPS 10
#define COMP_SCREEN_OPTION_NUM 11
/* keeping this for legacy distros (read suse 10.1)*/
#ifndef GLX_TEXTURE_FORMAT_EXT
@@ -1419,6 +1424,8 @@ typedef struct _CompOutput {
char *name;
REGION region;
REGION workRegion;
+ int width;
+ int height;
} CompOutput;
struct _CompScreen {
@@ -1846,6 +1853,13 @@ outputDeviceForPoint (CompScreen *s,
int y);
void
+getCurrentOutputExtents (CompScreen *s,
+ int *x1,
+ int *y1,
+ int *x2,
+ int *y2);
+
+void
setNumberOfDesktops (CompScreen *s,
unsigned int nDesktop);
diff --git a/beryl-core/src/display.c b/beryl-core/src/display.c
index 047140c..5327ec6 100644
--- a/beryl-core/src/display.c
+++ b/beryl-core/src/display.c
@@ -1485,9 +1485,9 @@ eventLoop (void)
{
XIntersectRegion (s->damage, &s->region, tmpRegion);
- if (tmpRegion->numRects == 1 &&
- tmpRegion->rects->x1 == 0 &&
- tmpRegion->rects->y1 == 0 &&
+ if (tmpRegion->numRects == 1 &&
+ tmpRegion->rects->x1 == 0 &&
+ tmpRegion->rects->y1 == 0 &&
tmpRegion->rects->x2 == s->width &&
tmpRegion->rects->y2 == s->height)
damageScreen (s);
@@ -1501,21 +1501,17 @@ eventLoop (void)
{
if (s->nOutputDev > 1)
{
- glScissor (s->outputDev[i].region.extents.x1,
- s->height -
- s->outputDev[i].region.extents.y2,
- s->outputDev[i].region.extents.x2 -
- s->outputDev[i].region.extents.x1,
- s->outputDev[i].region.extents.y2 -
- s->outputDev[i].region.extents.y1);
- glEnable( GL_SCISSOR_TEST);
+ glViewport (s->outputDev[i].region.extents.x1,
+ s->outputDev[i].region.extents.y1,
+ s->outputDev[i].width,
+ s->outputDev[i].height);
}
if (mask & COMP_SCREEN_DAMAGE_ALL_MASK)
{
(*s->paintScreen) (s,
&defaultScreenPaintAttrib,
- &s->outputDev[i].region, i,
+ &s->outputDev[i].region, i,
PAINT_SCREEN_REGION_MASK |
PAINT_SCREEN_FULL_MASK);
@@ -1533,7 +1529,7 @@ eventLoop (void)
if ((*s->paintScreen) (s,
&defaultScreenPaintAttrib,
- outputRegion, i,
+ outputRegion, i,
PAINT_SCREEN_REGION_MASK))
{
BoxPtr pBox;
diff --git a/beryl-core/src/event.c b/beryl-core/src/event.c
index 7d50ea9..fef985e 100644
--- a/beryl-core/src/event.c
+++ b/beryl-core/src/event.c
@@ -1738,7 +1738,11 @@ handleEvent (CompDisplay * d, XEvent * event)
value.i = event->xclient.data.l[0] / s->width;
- (*s->setScreenOption) (s, "size", &value);
+ (*s->setScreenOption) (s, "hsize", &value);
+
+ value.i = event->xclient.data.l[1] / s->height;
+
+ (*s->setScreenOption) (s, "vsize", &value);
}
}
else if (event->xclient.message_type == d->moveResizeWindowAtom)
diff --git a/beryl-core/src/paint.c b/beryl-core/src/paint.c
index de1d4a2..a63f34a 100644
--- a/beryl-core/src/paint.c
+++ b/beryl-core/src/paint.c
@@ -61,6 +61,20 @@ translateRotateScreen (const ScreenPaintAttrib * sa)
}
void
+prepareXCoords (CompScreen *screen,
+ int output,
+ float z)
+{
+ glTranslatef (-0.5f, -0.5f, z);
+ glScalef (1.0f / screen->outputDev[output].width,
+ -1.0f / screen->outputDev[output].height,
+ 1.0f);
+ glTranslatef (-screen->outputDev[output].region.extents.x1,
+ -screen->outputDev[output].height,
+ 0.0f);
+}
+
+void
paintTransformedScreen (CompScreen * screen,
const ScreenPaintAttrib * sAttrib,
int output,
@@ -70,7 +84,7 @@ paintTransformedScreen (CompScreen * screen,
int windowMask;
int backgroundMask;
- if (mask & PAINT_SCREEN_CLEAR_MASK)
+ if ((mask & PAINT_SCREEN_CLEAR_MASK) && !output)
glClear (GL_COLOR_BUFFER_BIT);
screenLighting (screen, TRUE);
@@ -79,9 +93,7 @@ paintTransformedScreen (CompScreen * screen,
translateRotateScreen (sAttrib);
- glTranslatef (-0.5f, -0.5f, -sAttrib->zTranslate);
- glScalef (1.0f / screen->width, -1.0f / screen->height, 1.0f);
- glTranslatef (0.0f, -screen->height, 0.0f);
+ prepareXCoords (screen, output, -sAttrib->zTranslate);
if (mask & PAINT_SCREEN_TRANSFORMED_MASK)
{
@@ -92,7 +104,8 @@ paintTransformedScreen (CompScreen * screen,
{
backgroundMask |= PAINT_BACKGROUND_WITH_STENCIL_MASK;
- (*screen->paintBackground) (screen, &screen->region,
+ (*screen->paintBackground) (screen,
+ &screen->outputDev[output].region,
backgroundMask);
glEnable (GL_STENCIL_TEST);
@@ -108,7 +121,8 @@ paintTransformedScreen (CompScreen * screen,
continue;
}
- (*screen->paintWindow) (w, &w->paint, &screen->region,
+ (*screen->paintWindow) (w, &w->paint,
+ &screen->outputDev[output].region,
windowMask);
}
@@ -122,7 +136,8 @@ paintTransformedScreen (CompScreen * screen,
else
windowMask = backgroundMask = 0;
- (*screen->paintBackground) (screen, &screen->region, backgroundMask);
+ (*screen->paintBackground) (screen, &screen->outputDev[output].region,
+ backgroundMask);
for (w = screen->windows; w; w = w->next)
{
@@ -135,7 +150,8 @@ paintTransformedScreen (CompScreen * screen,
continue;
}
- (*screen->paintWindow) (w, &w->paint, &screen->region, windowMask);
+ (*screen->paintWindow) (w, &w->paint, &screen->outputDev[output].region,
+ windowMask);
}
glPopMatrix ();
@@ -181,9 +197,7 @@ paintScreen (CompScreen * screen,
glPushMatrix ();
- glTranslatef (-0.5f, -0.5f, -DEFAULT_Z_CAMERA);
- glScalef (1.0f / screen->width, -1.0f / screen->height, 1.0f);
- glTranslatef (0.0f, -screen->height, 0.0f);
+ prepareXCoords (screen, output, -DEFAULT_Z_CAMERA);
if (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK)
{
diff --git a/beryl-core/src/screen.c b/beryl-core/src/screen.c
index a9be6c2..96963b2 100644
--- a/beryl-core/src/screen.c
+++ b/beryl-core/src/screen.c
@@ -55,6 +55,8 @@
#define OPACITY_STEP_DEFAULT 10
#define DEFAULT_REFRESH_RATE 60
+#define SCREEN_SIZE_DEFAULT 4
+#define SCREEN_VSIZE_DEFAULT 1
void
compScreenInitOptions (CompScreen * screen);
@@ -292,12 +294,12 @@ setScreenOption (CompScreen * screen, char *name, CompOptionValue * value)
}
break;
case COMP_SCREEN_OPTION_NUMBER_OF_DESKTOPS:
- if (compSetIntOption (o, value))
- {
- setNumberOfDesktops (screen, o->value.i);
- return TRUE;
- }
- break;
+ if (compSetIntOption (o, value))
+ {
+ setNumberOfDesktops (screen, o->value.i);
+ return TRUE;
+ }
+ break;
case COMP_SCREEN_OPTION_OPACITY_STEP:
if (compSetIntOption (o, value))
{
@@ -568,6 +570,9 @@ updateOutputDevices (CompScreen *s)
output[i].region.extents.y2 = screenInfo[i].y_org +
screenInfo[i].height;
+ output[i].width = screenInfo[i].width;
+ output[i].height = screenInfo[i].height;
+
output[i].workRegion.rects = &output[i].workRegion.extents;
output[i].workRegion.numRects = 1;
output[i].workRegion.extents.x1 = output[i].region.extents.x1;
@@ -594,6 +599,9 @@ updateOutputDevices (CompScreen *s)
output->region.extents.x2 = s->attrib.width;
output->region.extents.y2 = s->attrib.height;
+ output->width = s->attrib.width;
+ output->height = s->attrib.height;
+
nOutput = 1;
}
@@ -1093,7 +1101,7 @@ addScreen (CompDisplay * display,
s->x = 0;
s->y = 0;
- s->hsize = SCREEN_HSIZE_DEFAULT;
+ s->hsize = SCREEN_SIZE_DEFAULT;
s->vsize = SCREEN_VSIZE_DEFAULT;
s->nDesktop = 1;
@@ -3419,6 +3427,26 @@ outputDeviceForPoint (CompScreen *s,
}
void
+getCurrentOutputExtents (CompScreen *s,
+ int *x1,
+ int *y1,
+ int *x2,
+ int *y2)
+{
+ if (x1)
+ *x1 = s->outputDev[s->currentOutputDev].region.extents.x1;
+
+ if (y1)
+ *y1 = s->outputDev[s->currentOutputDev].region.extents.y1;
+
+ if (x2)
+ *x2 = s->outputDev[s->currentOutputDev].region.extents.x2;
+
+ if (y2)
+ *y2 = s->outputDev[s->currentOutputDev].region.extents.y2;
+}
+
+void
setNumberOfDesktops (CompScreen *s,
unsigned int nDesktop)
{
diff --git a/beryl-plugins/src/cube.c b/beryl-plugins/src/cube.c
index 6a6f4c0..ebcef31 100644
--- a/beryl-plugins/src/cube.c
+++ b/beryl-plugins/src/cube.c
@@ -1621,7 +1621,7 @@ cubePaintTransformedScreen (CompScreen * s,
if (cs->sky.name)
{
- if (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK)
+ if ((mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK) && !output)
glClear (GL_STENCIL_BUFFER_BIT);
screenLighting (s, FALSE);
@@ -1644,7 +1644,7 @@ cubePaintTransformedScreen (CompScreen * s,
glCallList (cs->skyListId);
glPopMatrix ();
}
- else
+ else if (!output)
{
if (mask & PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK)
glClear (GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
diff --git a/beryl-plugins/src/rotate.c b/beryl-plugins/src/rotate.c
index 62d3afa..46b50e9 100644
--- a/beryl-plugins/src/rotate.c
+++ b/beryl-plugins/src/rotate.c
@@ -1028,7 +1028,7 @@ rotateInitiate (CompDisplay * d,
{
ROTATE_SCREEN (s);
- if (s->hsize < 4)
+ if (s->hsize < 2)
return FALSE;
if (rs->rotateHandle && rs->grabWindow)
@@ -1139,7 +1139,7 @@ rotate (CompDisplay * d,
ROTATE_SCREEN (s);
- if (s->hsize < 4)
+ if (s->hsize < 2)
return FALSE;
if (otherScreenGrabExist (s, "rotate", "move", "switcher", "cube", 0))
@@ -1266,7 +1266,7 @@ rotateWithWindow (CompDisplay * d,
ROTATE_SCREEN (s);
- if (s->hsize < 4)
+ if (s->hsize < 2)
return FALSE;
direction = getIntOptionNamed (option, nOption, "direction", 0);
@@ -1725,7 +1725,7 @@ rotateEdgeFlip (CompScreen * s,
ROTATE_DISPLAY (s->display);
- if (s->hsize < 4)
+ if (s->hsize < 2)
return;
if (otherScreenGrabExist (s, "rotate", "move", 0))
diff --git a/beryl-plugins/src/scale.c b/beryl-plugins/src/scale.c
index b56d2c2..c094ce7 100644
--- a/beryl-plugins/src/scale.c
+++ b/beryl-plugins/src/scale.c
@@ -654,6 +654,9 @@ isScaleWin (CompWindow * w)
if (w->state & CompWindowStateShadedMask)
return FALSE;
+ if (!w->mapNum || w->attrib.map_state != IsViewable)
+ return FALSE;
+
if (!(ss->wMask & w->type))
return FALSE;
@@ -2845,9 +2848,6 @@ scaleInit (CompPlugin * p)
if (displayPrivateIndex < 0)
return FALSE;
- if (!w->mapNum || w->attrib.map_state != IsViewable)
- return FALSE;
-
return TRUE;
}
diff --git a/beryl-plugins/src/switcher.c b/beryl-plugins/src/switcher.c
index 831ca8b..a6cc896 100644
--- a/beryl-plugins/src/switcher.c
+++ b/beryl-plugins/src/switcher.c
@@ -1549,9 +1549,8 @@ switchPaintScreen (CompScreen * s,
switcher->destroyed = saveDestroyed;
glPushMatrix ();
- glTranslatef (-0.5f, -0.5f, -DEFAULT_Z_CAMERA);
- glScalef (1.0f / s->width, -1.0f / s->height, 1.0f);
- glTranslatef (0.0f, -s->height, 0.0f);
+
+ prepareXCoords (s, output, -DEFAULT_Z_CAMERA);
if (!switcher->destroyed &&
switcher->attrib.map_state == IsViewable && switcher->damaged)
diff --git a/distro-specific-build-files/beryl-core/debian/changelog b/distro-specific-build-files/beryl-core/debian/changelog
index 4c0b5ec..d7989e0 100644
--- a/distro-specific-build-files/beryl-core/debian/changelog
+++ b/distro-specific-build-files/beryl-core/debian/changelog
@@ -1,4 +1,4 @@
-beryl-core (0.1.1-0ubuntu1) edgy; urgency=low
+beryl-core (0.1.1-0ubuntu1-svn932-svn932-svn932) edgy; urgency=low
* Bump to 0.1.1