Skip to content

Commit

Permalink
git-svn-id: file:///media/LinuxData/Development/SVN/XDecorations@191 …
Browse files Browse the repository at this point in the history
…a077cb93-66c8-45fd-b335-998722470d8a
  • Loading branch information
keithhedger committed Dec 21, 2014
1 parent f97cab9 commit d039a19
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
APPNAME = XDecorations
PROGRAM = xdecorations
SRC = $(PROGRAM).cpp toon_root.cpp draw.cpp globals.cpp startstop.cpp update.cpp routines.cpp
LIBS = -L/usr/lib64 -lXext -lX11 -lm -lXpm -lImlib2
LIBS = -L/usr/lib64 -lXext -lX11 -lm -lXpm -lImlib2 -lrt
PREFIX = /usr
DESTDIR = ${DESTDIR:-""}
LOCALDATADIR = "`/bin/pwd`/pixmaps"
Expand Down
8 changes: 4 additions & 4 deletions draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ void drawWindowSnow(void)
windowid=j;
XGetWindowAttributes(display,windowSnow[j].wid,&attr);
XSetClipMask(display,gc,0);
XSetClipOrigin(display,gc,windowSnow[j].x,windowSnow[j].y-windowSnow[j].maxHeight);
XCopyArea(display,windowSnow[j].pixmap,drawOnThis,gc,0,0,windowSnow[j].width,windowSnow[j].maxHeight,windowSnow[j].x,windowSnow[j].y-windowSnow[j].maxHeight);
XSetClipOrigin(display,gc,windowSnow[j].x,windowSnow[j].y-windowSnow[j].maxHeight-windowYOffset);
XCopyArea(display,windowSnow[j].pixmap,drawOnThis,gc,0,0,windowSnow[j].width,windowSnow[j].maxHeight,windowSnow[j].x,windowSnow[j].y-windowSnow[j].maxHeight-windowYOffset);
}
}

Expand All @@ -222,8 +222,8 @@ void drawWindowSnow(void)
void drawSettled(void)
{
XSetClipMask(display,gc,bottomSnow.mask);
XSetClipOrigin(display,gc,0,displayHeight-bottomSnow.maxHeight);
XCopyArea(display,bottomSnow.pixmap,drawOnThis,gc,0,0,displayWidth,bottomSnow.maxHeight,0,displayHeight-bottomSnow.maxHeight);
XSetClipOrigin(display,gc,0,displayHeight-bottomSnow.maxHeight-bottomYOffset);
XCopyArea(display,bottomSnow.pixmap,drawOnThis,gc,0,0,displayWidth,bottomSnow.maxHeight,0,displayHeight-bottomSnow.maxHeight-bottomYOffset);
}

void drawFalling(void)
Expand Down
2 changes: 2 additions & 0 deletions globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ int settleRate;
int blackColor;
int whiteColor;
bool clearOnMaxHeight;
int windowYOffset;
int bottomYOffset;

//falling
objects floating[MAXFLOAT];
Expand Down
2 changes: 2 additions & 0 deletions globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ extern int settleRate;
extern int blackColor;
extern int whiteColor;
extern bool clearOnMaxHeight;
extern int windowYOffset;
extern int bottomYOffset;

//falling
extern objects floating[MAXFLOAT];
Expand Down
15 changes: 15 additions & 0 deletions xdecorations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ args xdecorations_rc[]=
{"wsettleheight",TYPEINT,&maxWindowHeight},
{"settlerate",TYPEINT,&settleRate},
{"clearonmaxhight",TYPEBOOL,&clearOnMaxHeight},
{"woffsety",TYPEINT,&windowYOffset},
{"boffsety",TYPEINT,&bottomYOffset},

{NULL,0,NULL}
};
Expand Down Expand Up @@ -397,6 +399,12 @@ void doHelp(void)
printf("-clearonmaxheight/-no-clearonmaxheight\n");
printf("\tClear the snow etc when it reaches the maximum height set by bsettleheight/wsettleheight\n");

printf("As some window managers include the decorations in the reported window size and some don't you may need to add an offset to where the snow etc starts to settle, KDE will need this xfce4wm may or may not need this.\nThe bottom offset is to raise the start of settled snow etc from the bottom of the screen if you have a bottom panel.");
printf("-woffsety INTEGER\n");
printf("\tOffset the settled layer on windows by INTEGER\n");
printf("-boffsety INTEGER\n");
printf("\tOffset the settled layer froom the bottom by INTEGER\n");

printf("\n");
exit(0);
}
Expand Down Expand Up @@ -429,6 +437,8 @@ void setDefaults(void)
maxWindowHeight=50;
settleRate=2;
clearOnMaxHeight=true;
windowYOffset=0;
bottomYOffset=0;
}

void reloadConfig(void)
Expand Down Expand Up @@ -658,6 +668,11 @@ int main(int argc,char* argv[])
maxWindowHeight=atol(argv[++argnum]);
if(strcmp(argstr,"-settlerate")==0)//settleRate=2
settleRate=atol(argv[++argnum]);
if(strcmp(argstr,"-woffsety")==0)//window settled y offset=0
windowYOffset=atol(argv[++argnum]);
if(strcmp(argstr,"-boffsety")==0)//bottom settled y offset=0
bottomYOffset=atol(argv[++argnum]);


//print help
if(strcmp(argstr,"-help")==0)
Expand Down
8 changes: 8 additions & 0 deletions xdecorations.rc
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,14 @@ settlerate 2
#Defaults to 1
clearonmaxheight 1

#Offset the start point of settling snow etc from the top of the windows.
#Defaults to 0
woffsety 0

#Offset the start point of settling snow etc from the bottom of the screen.
#Defaults to 0
boffsety 0

#### EXTRAS #####
#These are not used in the config file but are command line switches ONLY.
#Don't load the default config file ( ~/.config/xdecorations.rc ).
Expand Down

0 comments on commit d039a19

Please sign in to comment.