summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/group
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-17 14:11:10 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-17 14:11:10 +0000
commite0d49685683aad999072854f648abfb39871bde9 (patch)
tree79ef17cc8cd7af444e53c38859a649376788eaeb /beryl-plugins/src/group
parent922ed7d70b1e372eb56666aba1126844c4f23c6e (diff)
downloadmarex-dev-e0d49685683aad999072854f648abfb39871bde9.tar.gz
marex-dev-e0d49685683aad999072854f648abfb39871bde9.tar.bz2
group plugin:
- get rid of BTF drawing - instead, paint with PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK only if there are visible tab bars git-svn-id: file:///beryl/trunk@2770 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/group')
-rw-r--r--beryl-plugins/src/group/group.h3
-rw-r--r--beryl-plugins/src/group/init.c1
-rw-r--r--beryl-plugins/src/group/paint.c18
-rw-r--r--beryl-plugins/src/group/tab.c22
4 files changed, 33 insertions, 11 deletions
diff --git a/beryl-plugins/src/group/group.h b/beryl-plugins/src/group/group.h
index db37e09..64908d3 100644
--- a/beryl-plugins/src/group/group.h
+++ b/beryl-plugins/src/group/group.h
@@ -388,6 +388,7 @@ typedef struct _GroupDisplay {
GroupSelection *groups;
Bool ignoreMode;
+ Bool tabBarVisible;
float cornerPointsX[NUM_CORNER_POINTS];
float cornerPointsY[NUM_CORNER_POINTS];
@@ -552,7 +553,7 @@ void groupRenderTopTabHighlight(CompScreen *s, GroupSelection *group);
void groupRenderTabBarBackground(CompScreen *s, GroupSelection *group);
void groupRenderWindowTitle(CompScreen *s, GroupSelection *group);
void groupPaintThumb(GroupSelection *group, GroupTabBarSlot *slot, int targetOpacity);
-void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib);
+void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib, Region clipRegion);
void groupPreparePaintScreen(CompScreen * s, int msSinceLastPaint);
Bool groupPaintScreen(CompScreen * s, const ScreenPaintAttrib * sAttrib, Region region, int output, unsigned int mask);
void groupPaintTransformedScreen(CompScreen * s, const ScreenPaintAttrib * sa, Region region, int output, unsigned int mask);
diff --git a/beryl-plugins/src/group/init.c b/beryl-plugins/src/group/init.c
index 7eb9d0d..fd4a759 100644
--- a/beryl-plugins/src/group/init.c
+++ b/beryl-plugins/src/group/init.c
@@ -28,6 +28,7 @@ Bool groupInitDisplay(CompPlugin * p, CompDisplay * d)
//gd->revGroups = NULL;
gd->ignoreMode = FALSE;
+ gd->tabBarVisible = FALSE;
groupDisplayInitOptions(gd);
diff --git a/beryl-plugins/src/group/paint.c b/beryl-plugins/src/group/paint.c
index 986d975..ee66d31 100644
--- a/beryl-plugins/src/group/paint.c
+++ b/beryl-plugins/src/group/paint.c
@@ -94,7 +94,8 @@ void groupPaintThumb(GroupSelection *group, GroupTabBarSlot *slot, int targetOpa
sAttrib.yTranslate = slot->region->extents.y1 - w->attrib.y;
(w->screen->drawWindow) (w, &sAttrib, getInfiniteRegion(),
- PAINT_WINDOW_TRANSFORMED_MASK);
+ PAINT_WINDOW_TRANSFORMED_MASK);
+
addWindowDamage(w);
}
@@ -326,7 +327,7 @@ void groupRenderWindowTitle(CompScreen *s, GroupSelection *group)
* groupPaintTabBar
*
*/
-void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib)
+void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib, Region clipRegion)
{
if (!group->topTab || (group->tabBar->state == PaintOff))
return;
@@ -490,7 +491,7 @@ void groupPaintTabBar(GroupSelection * group, const WindowPaintAttrib *wAttrib)
topTab->vCount = 0;
- addWindowGeometry(topTab, &matrix, 1, &box, getInfiniteRegion());
+ addWindowGeometry(topTab, &matrix, 1, &box, clipRegion);
alpha = alpha * wAttrib->opacity / 0xffff;
@@ -658,11 +659,8 @@ groupPaintScreen(CompScreen * s,
gs->wasTransformed = FALSE;
Bool status;
- // if we draw groups use BTF
- if (gd->groups) {
- mask &= ~PAINT_SCREEN_ORDER_FRONT_TO_BACK_MASK;
- mask |= PAINT_SCREEN_ORDER_BACK_TO_FRONT_MASK;
- }
+ if (gd->tabBarVisible)
+ mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
UNWRAP(gs, s, paintScreen);
status = (*s->paintScreen) (s, sAttrib, region, output, mask);
@@ -992,10 +990,10 @@ groupDrawWindow(CompWindow * w,
if (gw->group && gw->group->tabBar) {
if (IS_TOP_TAB(w, gw->group)) {
if ((gw->group->changeState == PaintOff) || (gw->group->changeState == PaintFadeOut))
- groupPaintTabBar(gw->group, attrib);
+ groupPaintTabBar(gw->group, attrib, region);
} else if (IS_PREV_TOP_TAB(w, gw->group)) {
if (gw->group->changeState == PaintFadeIn)
- groupPaintTabBar(gw->group, attrib);
+ groupPaintTabBar(gw->group, attrib, region);
}
}
diff --git a/beryl-plugins/src/group/tab.c b/beryl-plugins/src/group/tab.c
index d4754da..cec91a7 100644
--- a/beryl-plugins/src/group/tab.c
+++ b/beryl-plugins/src/group/tab.c
@@ -79,6 +79,26 @@ groupTabBarTimeout(void *data)
}
/*
+ * groupCheckForVisibleTabBars
+ *
+ */
+static void
+groupCheckForVisibleTabBars(CompDisplay *d)
+{
+ GroupSelection *group;
+ GROUP_DISPLAY(d);
+
+ gd->tabBarVisible = FALSE;
+
+ for (group = gd->groups; group; group = group->next) {
+ if (group->tabBar && (group->tabBar->state != PaintOff)) {
+ gd->tabBarVisible = TRUE;
+ break;
+ }
+ }
+}
+
+/*
* groupTabSetVisibility
*
*/
@@ -120,6 +140,8 @@ void groupTabSetVisibility(GroupSelection *group, Bool visible, unsigned int mas
if(group->inputPrevention.id)
groupSwitchTopTabInput(group, !visible);
+
+ groupCheckForVisibleTabBars(group->windows[0]->screen->display);
}
/*