Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 12 Nov 2018, 21:18
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Imlib problem on Puppy
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [11 Posts]  
Author Message
fredx181


Joined: 11 Dec 2013
Posts: 3524
Location: holland

PostPosted: Tue 10 Jul 2018, 07:26    Post subject:  Imlib problem on Puppy
Subject description: Imlib2 Developer Warning and program quits
 

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:
***** 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

_________________
Dog Linux website
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 845
Location: Connecticut, United States

PostPosted: Tue 10 Jul 2018, 09:58    Post subject:  

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:
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.
Back to top
View user's profile Send private message Visit poster's website 
rcrsn51


Joined: 05 Sep 2006
Posts: 12324
Location: Stratford, Ontario

PostPosted: Tue 10 Jul 2018, 10:30    Post subject:  

Is this just a matter of the Puppies needing a newer version of the imlib2 library?
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 845
Location: Connecticut, United States

PostPosted: Tue 10 Jul 2018, 11:24    Post subject:  

I am trying that by using the PPM in Bionic 18.05+7....so far no luck
Back to top
View user's profile Send private message Visit poster's website 
rockedge


Joined: 11 Apr 2012
Posts: 845
Location: Connecticut, United States

PostPosted: Tue 10 Jul 2018, 14:57    Post subject:  

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/slackonly-i486/xlunch-2.3.2-i586-1_slonly.txz.html

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

and it runs .....getting closer though.
Screenshot-xlunch.png
 Description   
 Filesize   5.35 KB
 Viewed   374 Time(s)

Screenshot-xlunch.png

Back to top
View user's profile Send private message Visit poster's website 
fredx181


Joined: 11 Dec 2013
Posts: 3524
Location: holland

PostPosted: Tue 10 Jul 2018, 15:36    Post subject:  

Ha ! Thanks rockedge, you really did some digging Smile

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

_________________
Dog Linux website
Back to top
View user's profile Send private message 
misko_2083


Joined: 08 Nov 2016
Posts: 55

PostPosted: Tue 10 Jul 2018, 18:40    Post subject:  

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:
CFLAGS ?= -O2 -s -std=c99


libimlib2 is 1.4.6
Code:
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
Quote:
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:
     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:
./xlunch -f "extra/OpenSans-Regular.ttf/10" -i extra/sample_entries.dsv -b 140 --backgroundcolor 2e344026
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 845
Location: Connecticut, United States

PostPosted: Tue 10 Jul 2018, 20:32    Post subject:  

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:
#make test

and xlunch compiled. started with
Code:
 ./xlunch -g extra/wp.jpg


Back to top
View user's profile Send private message Visit poster's website 
fredx181


Joined: 11 Dec 2013
Posts: 3524
Location: holland

PostPosted: Wed 11 Jul 2018, 06:29    Post subject:  

Thanks misko and rockedge ! changing to:
Code:
 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

_________________
Dog Linux website
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2609
Location: UK

PostPosted: Fri 31 Aug 2018, 21:15    Post subject: Fork of Xlunch, for Puppy Linux
Subject description: https://gitlab.com/sc0ttj/xlunch
 

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

My fork will show SVG icons Very Happy

(technically I fixed the 'genentries' script so it will auto-build some PNGs from SVGs and put them in /usr/share/xlunch/svgicons/)

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 3524
Location: holland

PostPosted: Sat 01 Sep 2018, 03:49    Post subject: Re: Fork of Xlunch, for Puppy Linux
Subject description: https://gitlab.com/sc0ttj/xlunch
 

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

My fork will show SVG icons Very Happy

(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.php?p=1003491#1003491

Fred

_________________
Dog Linux website
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [11 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0719s ][ Queries: 12 (0.0155s) ][ GZIP on ]