d/patches: remove all patches, applied upstream
Vincent Bernat
2 years ago
0 | Description: Fix a segmentation fault when no display is present. | |
1 | Origin: vendor | |
2 | Bug: http://bugs.debian.org/507554 | |
3 | Forwarded: no | |
4 | Author: <michal.suchanek@ruk.cuni.cz> | |
5 | Reviewed-by: Alessandro Ghedini <ghedo@debian.org> | |
6 | Last-Update: 2012-08-05 | |
7 | Applied-Upstream: *** FIXME *** | |
8 | ||
9 | --- a/src/hsetroot.c | |
10 | +++ b/src/hsetroot.c | |
11 | @@ -254,6 +254,11 @@ | |
12 | Imlib_Color_Modifier modifier = NULL; | |
13 | _display = XOpenDisplay (NULL); | |
14 | ||
15 | + if(!_display){ | |
16 | + fprintf (stderr, "Cannot open X display!\n"); | |
17 | + exit (123); | |
18 | + } | |
19 | + | |
20 | for (screen = 0; screen < ScreenCount (_display); screen++) | |
21 | { | |
22 | display = XOpenDisplay (NULL); |
0 | Description: Add the '-extend' option | |
1 | Origin: vendor | |
2 | Bug: http://bugs.debian.org/507554 | |
3 | Forwarded: no | |
4 | Author: <michal.suchanek@ruk.cuni.cz> | |
5 | Reviewed-by: Alessandro Ghedini <ghedo@debian.org> | |
6 | Last-Update: 2012-08-05 | |
7 | ||
8 | --- a/src/hsetroot.c | |
9 | +++ b/src/hsetroot.c | |
10 | @@ -8,7 +8,7 @@ | |
11 | #include "config.h" | |
12 | ||
13 | typedef enum | |
14 | -{ Full, Fill, Center, Tile } ImageMode; | |
15 | +{ Full, Fill, Center, Tile, Xtend } ImageMode; | |
16 | ||
17 | void | |
18 | usage (char *commandline) | |
19 | @@ -30,6 +30,7 @@ | |
20 | " -center <image> Render an image centered on screen\n" | |
21 | " -tile <image> Render an image tiled\n" | |
22 | " -full <image> Render an image maximum aspect\n" | |
23 | + " -extend <image> Render an image max aspect and fill borders\n" | |
24 | " -fill <image> Render an image strechted\n" | |
25 | "\n" | |
26 | "Manipulations:\n" | |
27 | @@ -199,7 +200,7 @@ | |
28 | imlib_blend_image_onto_image (buffer, 0, 0, 0, imgW, imgH, | |
29 | 0, 0, rootW, rootH); | |
30 | } | |
31 | - else if (mode == Full) | |
32 | + else if ((mode == Full) || (mode == Xtend)) | |
33 | { | |
34 | double aspect = ((double) rootW) / imgW; | |
35 | int top, left; | |
36 | @@ -207,9 +208,29 @@ | |
37 | aspect = (double) rootH / (double) imgH; | |
38 | top = (rootH - (int) (imgH * aspect)) / 2; | |
39 | left = (rootW - (int) (imgW * aspect)) / 2; | |
40 | + | |
41 | imlib_blend_image_onto_image (buffer, 0, 0, 0, imgW, imgH, | |
42 | left, top, (int) (imgW * aspect), | |
43 | (int) (imgH * aspect)); | |
44 | + | |
45 | + if (mode == Xtend) { | |
46 | + int w; | |
47 | + if ( left >0 ) { | |
48 | + int right = left - 1 + (int) (imgW * aspect); | |
49 | + /* check only the right border - left is int divided so the right border is larger */ | |
50 | + for (w = 1; (right + w < rootW); w <<= 1) { | |
51 | + imlib_image_copy_rect (left + 1 - w, 0, w, rootH, left + 1 - w - w, 0); | |
52 | + imlib_image_copy_rect (right, 0, w, rootH, right + w, 0); | |
53 | + } | |
54 | + } | |
55 | + if (top >0 ) { | |
56 | + int bottom = top - 1 + (int) (imgH * aspect); | |
57 | + for (w = 1; (bottom + w < rootH); w <<= 1) { | |
58 | + imlib_image_copy_rect (0, top + 1 - w, rootW, w, 0, top + 1 - w - w); | |
59 | + imlib_image_copy_rect (0, bottom, rootW, w, 0, bottom + w); | |
60 | + } | |
61 | + } | |
62 | + } | |
63 | } | |
64 | else | |
65 | { | |
66 | @@ -422,6 +443,20 @@ | |
67 | 0) | |
68 | { | |
69 | fprintf (stderr, "Bad image (%s)\n", argv[i]); | |
70 | + continue; | |
71 | + } | |
72 | + } | |
73 | + else if (strcmp (argv[i], "-extend") == 0) | |
74 | + { | |
75 | + if ((++i) >= argc) | |
76 | + { | |
77 | + fprintf (stderr, "Missing image\n"); | |
78 | + continue; | |
79 | + } | |
80 | + if (load_image (Xtend, argv[i], width, height, alpha, image) == | |
81 | + 0) | |
82 | + { | |
83 | + fprintf (stderr, "Bad image (%s)\n", argv[i]); | |
84 | continue; | |
85 | } | |
86 | } |
0 | Description: Add the '-cover' option | |
1 | Origin: vendor | |
2 | Bug: http://bugs.debian.org/718829 | |
3 | Forwarded: no | |
4 | Author: Michal Suchanek <hramrach@gmail.com> | |
5 | Reviewed-by: Alessandro Ghedini <ghedo@debian.org> | |
6 | Last-Update: 2013-08-07 | |
7 | ||
8 | --- a/src/hsetroot.c | |
9 | +++ b/src/hsetroot.c | |
10 | @@ -8,7 +8,7 @@ | |
11 | #include "config.h" | |
12 | ||
13 | typedef enum | |
14 | -{ Full, Fill, Center, Tile, Xtend } ImageMode; | |
15 | +{ Full, Fill, Center, Tile, Xtend, Cover } ImageMode; | |
16 | ||
17 | void | |
18 | usage (char *commandline) | |
19 | @@ -28,6 +28,7 @@ | |
20 | "\n" | |
21 | "Image files:\n" | |
22 | " -center <image> Render an image centered on screen\n" | |
23 | + " -cover <image> Render an image centered on screen scaled to fill the screen fully\n" | |
24 | " -tile <image> Render an image tiled\n" | |
25 | " -full <image> Render an image maximum aspect\n" | |
26 | " -extend <image> Render an image max aspect and fill borders\n" | |
27 | @@ -200,11 +201,11 @@ | |
28 | imlib_blend_image_onto_image (buffer, 0, 0, 0, imgW, imgH, | |
29 | 0, 0, rootW, rootH); | |
30 | } | |
31 | - else if ((mode == Full) || (mode == Xtend)) | |
32 | + else if ((mode == Full) || (mode == Xtend) || (mode == Cover)) | |
33 | { | |
34 | double aspect = ((double) rootW) / imgW; | |
35 | int top, left; | |
36 | - if ((int) (imgH * aspect) > rootH) | |
37 | + if (((int) (imgH * aspect) > rootH) != /*xor*/ (mode == Cover)) | |
38 | aspect = (double) rootH / (double) imgH; | |
39 | top = (rootH - (int) (imgH * aspect)) / 2; | |
40 | left = (rootW - (int) (imgW * aspect)) / 2; | |
41 | @@ -485,6 +486,20 @@ | |
42 | 0) | |
43 | { | |
44 | fprintf (stderr, "Bad image (%s)\n", argv[i]); | |
45 | + continue; | |
46 | + } | |
47 | + } | |
48 | + else if (strcmp (argv[i], "-cover") == 0) | |
49 | + { | |
50 | + if ((++i) >= argc) | |
51 | + { | |
52 | + fprintf (stderr, "Missing image\n"); | |
53 | + continue; | |
54 | + } | |
55 | + if (load_image (Cover, argv[i], width, height, alpha, image) == | |
56 | + 0) | |
57 | + { | |
58 | + fprintf (stderr, "Bad image (%s)\n", argv[i]); | |
59 | continue; | |
60 | } | |
61 | } |
0 | Description: Actually link to libX11 | |
1 | Origin: vendor | |
2 | Bug-Debian: http://bugs.debian.org/735758 | |
3 | Author: Alessandro Ghedini <ghedo@debian.org> | |
4 | Last-Update: 2014-01-17 | |
5 | ||
6 | --- a/configure.ac | |
7 | +++ b/configure.ac | |
8 | @@ -50,6 +50,12 @@ | |
9 | IMLIB2_LIBS=`$imlib2config_cmd --libs` | |
10 | AC_SUBST(IMLIB2_LIBS) | |
11 | ||
12 | +X11_CFLAGS=`pkg-config x11 --cflags` | |
13 | +AC_SUBST(X11_CFLAGS) | |
14 | + | |
15 | +X11_LIBS=`pkg-config x11 --libs` | |
16 | +AC_SUBST(X11_LIBS) | |
17 | + | |
18 | # Some extra definitions for config.h | |
19 | AC_DEFINE(DESCRIPTION, "yet another wallpaper application", [single line package description]) | |
20 | ||
21 | --- a/src/Makefile.am | |
22 | +++ b/src/Makefile.am | |
23 | @@ -1,7 +1,7 @@ | |
24 | bin_PROGRAMS = hsetroot | |
25 | ||
26 | -AM_CFLAGS = @CFLAGS@ @IMLIB2_CFLAGS@ -Wall | |
27 | -LIBS = @IMLIB2_LIBS@ | |
28 | +AM_CFLAGS = @CFLAGS@ @IMLIB2_CFLAGS@ @X11_CFLAGS@ -Wall | |
29 | +LIBS = @IMLIB2_LIBS@ @X11_LIBS@ | |
30 | ||
31 | hsetroot_SOURCES = hsetroot.c | |
32 |