Imlib problem on Puppy

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

Imlib problem on Puppy

#1 Post by fredx181 »

Maybe anyone can shine a light on the following ? :
I'm testing a program "xlunch, graphical app launcher", see here: https://github.com/Tomas-M/xlunch
Although it has some bugs unsolved yet, it works for me nicely on Debian(Dog), but not at all on Puppy, when launching it, I get this:

Code: Select all

***** Imlib2 Developer Warning ***** :
	This program is calling the Imlib call:

	imlib_get_visual_depth();

	With the parameter:

	visual

	being NULL. Please fix your program.
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  78 (X_CreateColormap)
  Serial number of failed request:  7
  Current serial number in output stream:  16
And xlunch exits.

I tried on a few Puppies, newest slacko, zesty, dpup-Stretch and all gave me the same error.
Is there perhaps something missing in Puppy that could possibly cause this ?
I had a look at the dependencies, and looks all fine.
Thanks.

Fred

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#2 Post by rockedge »

It looks like in in the code xlunch.c
this block which starts around line 1930
the parameter vinfo.visual isn't being set. causing the "visual" to be null....or something like this.....some display parameter maybe not being read or set???? the bottom line is there is a "visual" parameter not being given a value causing the error.

Code: Select all

void init(int argc, char **argv)
{

    int c, option_index;
    while ((c = getopt_long(argc, argv, "vdr:ng:L:b:B:s:i:p:f:mc:x:y:w:h:oatGHI:T:P:WF:SqROMuXeCl:V:U:A:", long_options, &option_index)) != -1) {
        handle_option(c, optarg);
    }
    //parse_config(fopen("/home/peter/.xlunchrc", "rb"));

    /* connect to X */
    disp = XOpenDisplay(NULL);
    if (!disp)
    {
        fprintf(stderr,"Cannot connect to DISPLAY\n");
        exit(WINERROR);
    }

    XMatchVisualInfo(disp, DefaultScreen(disp), 32, TrueColor, &vinfo);

    attr.colormap = XCreateColormap(disp, DefaultRootWindow(disp), vinfo.visual, AllocNone);
    attr.border_pixel = 0;
    attr.background_pixel = 0;

    /* get default visual , colormap etc. you could ask imlib2 for what it */
    /* thinks is the best, but this example is intended to be simple */
    screen = DefaultScreen(disp);

    /* get/set screen size */
    if (uwidth==0) screen_width=DisplayWidth(disp,screen);
    else screen_width=uwidth;

    if (uheight==0) screen_height=DisplayHeight(disp,screen);
    else screen_height=uheight;

    calculate_percentage(screen_height, &uborder);
    calculate_percentage(screen_width, &uside_border);
}
I think I am getting closer to a fix.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

Is this just a matter of the Puppies needing a newer version of the imlib2 library?

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#4 Post by rockedge »

I am trying that by using the PPM in Bionic 18.05+7....so far no luck

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#5 Post by rockedge »

I think I got it going...... Bionic 18.05+7
I have to test and determine what exactly did it ...
I found from Ubuntu libimlib2_1.4.10-1_i386.deb and libimlib2-dev_1.4.10-1_i386.deb and installed them trying to build xlunch....

didn't get pas that error so I started with this from Slacko https://slackware.pkgs.org/14.2/slackon ... y.txz.html

I extracted it manually with uExtract and put the pieces in their spots.

and it runs .....getting closer though.
Attachments
Screenshot-xlunch.png
(5.35 KiB) Downloaded 424 times

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#6 Post by fredx181 »

Ha ! Thanks rockedge, you really did some digging :)

A newer version of imlib2 didn't help for me, tried that already (forgot to mention in first post)

That slackware package is really an old version of xlunch, but it may lead to clarifying what's the problem maybe...

Fred

User avatar
misko_2083
Posts: 114
Joined: Tue 08 Nov 2016, 13:42

#7 Post by misko_2083 »

rcrsn51 wrote:Is this just a matter of the Puppies needing a newer version of the imlib2 library?
Hmm, builds and runs in debian 8
with an extra flag -std=c99 in the makefile.

Code: Select all

CFLAGS ?= -O2 -s -std=c99
libimlib2 is 1.4.6

Code: Select all

apt-cache policy libimlib2-dev
libimlib2-dev:
  Installed: 1.4.6-2+deb8u2
  Candidate: 1.4.6-2+deb8u2
  Version table:
 *** 1.4.6-2+deb8u2 0
        500 http://http.debian.net/debian/ jessie/main amd64 Packages
        500 http://security.debian.org/ jessie/updates/main amd64 Packages
        100 /var/lib/dpkg/status
libimlib2:
  Installed: 1.4.6-2+deb8u2
  Candidate: 1.4.6-2+deb8u2
  Version table:
 *** 1.4.6-2+deb8u2 0
        500 http://http.debian.net/debian/ jessie/main amd64 Packages
        500 http://security.debian.org/ jessie/updates/main amd64 Packages
        100 /var/lib/dpkg/status
Next explains why "visual" is null: https://linux.die.net/man/3/xmatchvisualinfo
If no visual structures match the template using the specified vinfo_mask, XGetVisualInfo returns a NULL.
Guessing only: It's probably something with the compositor, maybe it has only 24-bit TrueColor X11 visuals?
Since X server doesn't suport 32bit output, this is done by compositing clients, like Compiz, Compton, etc. Or something extra in theX*Config file needs to be set?

Check the output of xdpyinfo and try to match it in the code.
xlunch.c line 1947

Code: Select all

     XMatchVisualInfo(disp, DefaultScreen(disp), 24, TrueColor, &vinfo); 
It will not have transparency (if it works), meaning that the last 2 digits in RGBA (Red Green Blue Alpha) --backgroundcolor 2e344026 would not affect the window transparency.

Code: Select all

./xlunch -f "extra/OpenSans-Regular.ttf/10" -i extra/sample_entries.dsv -b 140 --backgroundcolor 2e344026

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#8 Post by rockedge »

Hey misko_2083 ! Thank you very much for the help. I am able to compile xlunch 3.2.10 on Puppy Linux Bionic 18.05+7.

your info helped me solve it. I used the CFLAGS ?= -O2 -s -std=c99 in the Makefile and ran xdpyinfo which indicated I should change
XMatchVisualInfo(disp, DefaultScreen(disp), 32, TrueColor, &vinfo);
to
XMatchVisualInfo(disp, DefaultScreen(disp), 24, TrueColor, &vinfo);
I then ran

Code: Select all

#make test
and xlunch compiled. started with

Code: Select all

 ./xlunch -g extra/wp.jpg
Image

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#9 Post by fredx181 »

Thanks misko and rockedge ! changing to:

Code: Select all

 XMatchVisualInfo(disp, DefaultScreen(disp), 24, TrueColor, &vinfo);
in xlunch.c and recompile makes it indeed work in Puppy.
Tested now on dPup-Stretch.
It's a pity that xlunch doesn't support .svg icons, Puppy has many, so a lot of icons are not showing in xlunch display.
Still a lot of (crazy) things can be done with xlunch, see more documentation here:
http://www.xlunch.org/

Fred

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

Fork of Xlunch, for Puppy Linux

#10 Post by sc0ttman »

I have added some of the Puppy-specific fixes to an xlunch fork here: http://murga-linux.com/puppy/viewtopic. ... 38#1003438

My fork will show SVG icons :D

(technically I fixed the 'genentries' script so it will auto-build some PNGs from SVGs and put them in /usr/share/xlunch/svgicons/)
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

Re: Fork of Xlunch, for Puppy Linux

#11 Post by fredx181 »

sc0ttman wrote:I have added some of the Puppy-specific fixes to an xlunch fork here: http://murga-linux.com/puppy/viewtopic. ... 38#1003438

My fork will show SVG icons :D

(technically I fixed the 'genentries' script so it will auto-build some PNGs from SVGs and put them in /usr/share/xlunch/svgicons/)
Very good !
I see your genentries mod can work with rsvg-convert (for converting svg to png), the original needs imagemagick AFAIK.
So installing small package "librsvg2-bin" will do (or could be named different on some distros).
As a coincidence I'm busy recently to make .pet and .deb packages for xlunch containing e.g. some more/different scripts, menu entries , I will share soon.

EDIT: pet packages (experimental) here:
http://murga-linux.com/puppy/viewtopic. ... 91#1003491

Fred

Post Reply