File: wmcpu-geometry.diff

package info (click to toggle)
wmcpu 1.4-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 200 kB
  • sloc: ansic: 1,284; makefile: 67
file content (40 lines) | stat: -rw-r--r-- 1,260 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
diff -urN wmcpu-1.4.orig/wmcpu.c wmcpu-1.4/wmcpu.c
--- wmcpu-1.4.orig/wmcpu.c	2007-01-03 15:39:58.000000000 +0530
+++ wmcpu-1.4/wmcpu.c	2007-01-03 15:42:01.000000000 +0530
@@ -43,6 +43,7 @@
 	"   timecop@japan.co.jp\n" \
 	"usage:\n" \
 	"\t-display <display name>\n" \
+        "\t-geometry <geometry>\n" \
 	"\t-h\tthis screen\n" \
 	"\t-v\tprint the version number and exit\n" \
 	"\t-l\tshow load as numbers\n" \
@@ -57,6 +58,7 @@
 static Pixmap mask;
 static unsigned long udelay = 250000;
 static int gfx_loadbar = 1;
+static char* geometry = NULL;
 
 static void wmcpu_routine(void);
 static void redraw_window(void);
@@ -68,6 +70,8 @@
 	while( par < argc ) {
 		if( !strcmp( argv[par], "-display" ) && par+1 < argc )
 			display_name = argv[++par];
+		else if( !strcmp( argv[par], "-geometry" ) && par+1 < argc )
+			geometry = argv[++par];
 		else if( !strcmp( argv[par], "-v" ) ) {
 			fprintf(stderr, "%s\n", WMCPU_VERSION);
 			exit(0);
@@ -348,6 +352,11 @@
 	sizehints.width = width;
 	sizehints.height = height;
 
+	if( geometry ) {
+		XParseGeometry( geometry, &sizehints.x, &sizehints.y,
+				&sizehints.width, &sizehints.height );
+	}
+
 	fg = BlackPixel(display, DefaultScreen(display));
 	bg = WhitePixel(display, DefaultScreen(display));