This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  fc5c0fe1a41eeab563b09be6d02eadcbbb643ac2 (commit)
      from  21a5f41c08e9335df50ed8dfb331e5ca4b5f35b2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/fc5c0fe1a41eeab563b09be6d02eadcbbb643ac2

commit fc5c0fe1a41eeab563b09be6d02eadcbbb643ac2
Author: Amadeusz Sławiński <[email protected]>
Date:   Sun Jun 3 17:48:14 2012 +0200

    Add fill screen scale to wmsetbg
    
    I noticed that I can have different background with wmmsetbg for each
    desktop and wanted to use it, but it was missing option to fill the
    screen with proportionally scaled image, so here it is.

diff --git a/util/wmsetbg.c b/util/wmsetbg.c
index 86d1f91..a75ae95 100644
--- a/util/wmsetbg.c
+++ b/util/wmsetbg.c
@@ -175,9 +175,18 @@ applyImage(RContext * rc, BackgroundTexture * texture, 
RImage * image, char type
        switch (toupper(type)) {
        case 'S':
        case 'M':
+       case 'F':
                if (toupper(type) == 'S') {
                        w = width;
                        h = height;
+               } else if(toupper(type) == 'F') {
+                       if (image->width * height > image->height * width) {
+                               w = (height * image->width) / image->height;
+                               h = height;
+                       } else {
+                               w = width;
+                               h = (width * image->height) / image->width;
+                       }
                } else {
                        if (image->width * height > image->height * width) {
                                w = width;
@@ -465,7 +474,7 @@ BackgroundTexture *parseTexture(RContext * rc, char *text)
 
                texture->pixmap = pixmap;
        } else if (strcasecmp(type, "cpixmap") == 0
-                  || strcasecmp(type, "spixmap") == 0
+                  || strcasecmp(type, "spixmap") == 0 || strcasecmp(type, 
"fpixmap") == 0
                   || strcasecmp(type, "mpixmap") == 0 || strcasecmp(type, 
"tpixmap") == 0) {
                XColor color;
                Pixmap pixmap = None;
@@ -528,6 +537,7 @@ BackgroundTexture *parseTexture(RContext * rc, char *text)
                case 'S':
                case 'M':
                case 'C':
+               case 'F':
                        {
                                Pixmap tpixmap =
                                    XCreatePixmap(dpy, root, scrWidth, 
scrHeight, DefaultDepth(dpy, scr));
@@ -1136,6 +1146,7 @@ void print_help()
        puts(" -e, --center                     center image");
        puts(" -s, --scale                      scale  image (default)");
        puts(" -a, --maxscale                   scale  image and keep aspect 
ratio");
+       puts(" -f, --fillscale                  scale  image to fill screen and 
keep aspect ratio");
        puts(" -u, --update-wmaker              update WindowMaker domain 
database");
        puts(" -D, --update-domain <domain>     update <domain> database");
        puts(" -c, --colors <cpc>               colors per channel to use");
@@ -1227,6 +1238,8 @@ int main(int argc, char **argv)
                        style = "cpixmap";
                } else if (strcmp(argv[i], "-a") == 0 || strcmp(argv[i], 
"--maxscale") == 0) {
                        style = "mpixmap";
+               } else if (strcmp(argv[i], "-f") == 0 || strcmp(argv[i], 
"--fillscale") == 0) {
+                       style = "fpixmap";
                } else if (strcmp(argv[i], "-d") == 0 || strcmp(argv[i], 
"--dither") == 0) {
                        render_mode = RDitheredRendering;
                        obey_user++;

-----------------------------------------------------------------------

Summary of changes:
 util/wmsetbg.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to