summaryrefslogtreecommitdiffstats
path: root/twin/kompmgr
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-12-10 03:03:12 -0600
committerTimothy Pearson <[email protected]>2012-12-10 03:03:12 -0600
commit1cac8a5e1d6b6971193c78de22ba539911dcf406 (patch)
tree058899e4f66c2019c6daeb68642bb0f1fb587ab7 /twin/kompmgr
parentcee306586f6b4ad23f8422eb1bd3041e0ba56274 (diff)
downloadtdebase-1cac8a5e1d6b6971193c78de22ba539911dcf406.tar.gz
tdebase-1cac8a5e1d6b6971193c78de22ba539911dcf406.zip
Fix kompmgr shadow support
Add kompmgr settings reload method to twin DCOP Fix up kompmgr kcontrol module Make default TDM login screen appearance more like the rest of the TDE login system
Diffstat (limited to 'twin/kompmgr')
-rw-r--r--twin/kompmgr/kompmgr.c54
1 files changed, 52 insertions, 2 deletions
diff --git a/twin/kompmgr/kompmgr.c b/twin/kompmgr/kompmgr.c
index 82166766e..f203c32d0 100644
--- a/twin/kompmgr/kompmgr.c
+++ b/twin/kompmgr/kompmgr.c
@@ -277,6 +277,15 @@ get_opacity_percent(Display *dpy, win *w);
static XserverRegion
win_extents (Display *dpy, win *w);
+static void
+presum_gaussian (conv *map);
+
+static conv *
+make_gaussian_map (Display *dpy, double r);
+
+Picture
+solid_picture (Display *dpy, Bool argb, double a, double r, double g, double b);
+
CompMode compMode = CompSimple;
int shadowRadius = 12;
@@ -403,6 +412,27 @@ void delete_pid_file()
#endif
}
+void clear_shadow_cache()
+{
+ win *w;
+
+ for (w = list; w; w = w->next) {
+ if (w->shadow)
+ {
+ XRenderFreePicture (dpy, w->shadow);
+ w->shadow = None;
+ if (w->opacity != OPAQUE && !w->alphaPict)
+ w->alphaPict = solid_picture (dpy, False,
+ (double) w->opacity / OPAQUE, shadowColor.red, shadowColor.green, shadowColor.blue);
+ if( w->extents != None ) {
+ XFixesDestroyRegion( dpy, w->extents );
+ }
+ w->extents = win_extents (dpy, w);
+ w->damaged = 1; /* redraw */
+ }
+ }
+}
+
void handle_siguser (int sig)
{
int uidnum;
@@ -456,6 +486,19 @@ void handle_siguser (int sig)
loadConfig(filename); /* reload the configuration file */
+ /* set background/shadow picture using the new settings */
+ blackPicture = solid_picture (dpy, True, 1, (double)(shadowColor.red)/0xff, (double)(shadowColor.green)/0xff, (double)(shadowColor.blue)/0xff);
+ if (compMode == CompServerShadows)
+ transBlackPicture = solid_picture (dpy, True, 0.3, 0, 0, 0);
+
+ /* regenerate shadows using the new settings */
+ if (compMode == CompClientShadows)
+ {
+ gaussianMap = make_gaussian_map(dpy, shadowRadius);
+ presum_gaussian (gaussianMap);
+ }
+ clear_shadow_cache();
+
free(filename);
filename = NULL;
}
@@ -1419,7 +1462,6 @@ paint_all (Display *dpy, XserverRegion region)
{
w->borderClip = XFixesCreateRegion (dpy, 0, 0);
XFixesCopyRegion (dpy, w->borderClip, region);
- XFixesIntersectRegion(dpy, w->borderClip, w->borderClip, w->borderSize);
}
w->prev_trans = t;
t = w;
@@ -2892,6 +2934,8 @@ options[NUMBEROFOPTIONS] = {
void
setValue(Option option, char *value ){
+ int i;
+
switch(option){ /*please keep that upside-down, because this way adding a new option is easier (all in one view)*/
case FadeDelta:
@@ -2920,7 +2964,7 @@ setValue(Option option, char *value ){
break;
case ShadowRadius:
shadowRadius = atoi(value);
- break;
+ break;
case ShadowColor:
setShadowColor(value);
break;
@@ -2955,12 +2999,18 @@ setValue(Option option, char *value ){
case Compmode:
if( strcasecmp(value, "CompClientShadows") == 0 ){
compMode = CompClientShadows;
+ for (i = 0; i < NUM_WINTYPES; ++i)
+ winTypeShadow[i] = True;
}
else if( strcasecmp(value, "CompServerShadows") == 0 ){
compMode = CompServerShadows;
+ for (i = 0; i < NUM_WINTYPES; ++i)
+ winTypeShadow[i] = True;
}
else{
compMode = CompSimple; /*default*/
+ for (i = 0; i < NUM_WINTYPES; ++i)
+ winTypeShadow[i] = False;
}
break;
case Display_: