Display errors on Linux

Deploying to Linux? Get penguinated here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
DDS
Posts: 9
Joined: Mon Sep 18, 2017 9:57 am

Display errors on Linux

Post by DDS » Wed Oct 31, 2018 11:41 am

Greetings,

Last year, i asked for help on a conversion of an old Metacard application to Livecode, mostly aimed at the communication between Livecode and C part of an application.
It worked better than i expected : got all functionalities working fine, but i have problems trying to display it on a remote X terminal.

Development machine is a CentOS6.3 with Livecode (Indy) 6.7.11 (latest i can install).
The computer on which the applications run (as stand-alone) is also a CentOS6.3.

The display tried are :
Xming 6.9 on a Windows 7 machine : works OK (mostly)
X terminal with a CentOS 5.4 : works OK (mostly)
localhost display : works OK (mostly)
X terminal with a 2.4.3 linux kernel : When executing my apps (or even an basic app with just a button but without any script), i get the following errors (several times) before the app crash (segmentation fault) :

Xlib: extension "XVideo" missing on display "tx4:0.0".
Xlib: extension "RANDR" missing on display "tx4:0.0".
(<unknown>:30572): Gdk-CRITICAL **: gdk_colormap_new: assertion `GDK_IS_VISUAL (visual)' failed
(<unknown>:30572): Gtk-CRITICAL **: gtk_widget_set_colormap: assertion `GDK_IS_COLORMAP (colormap)' failed
(<unknown>:30572): Gdk-WARNING **: gdk_gc_set_rgb_fg_color() and gdk_gc_set_rgb_bg_color() can only be used on GC's with a colormap. A GC will have a colormap if it is created for a drawable with a colormap, or if a colormap has been set explicitly with gdk_gc_set_colormap.
(<unknown>:30572): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

The terminal is in 8bit pseudo colour, i thought it could cause the problem, but Livecode seems to be able to deal with that on its own (unless i missed something and there's stuff to do ?)

Considering this is a conversion from Metacard (which displays fine on the same kind of terminal), nothing in my apps should be incompatible.
Are my apps simply built with a system too recent for the X terminal or is there something i'm missing ? (dealing with the pseudo colour for example)


Bonus questions :
1) One of my four apps tends to stay on top/visible (when switching desktop for example) even on mostly OK displays. I'm guessing it's something in the Livecode that causes this behaviour, but i don't know where to begin my search.
2) Is there a way to make the taskbar icon flash ? (an app get new data but is not visible, so the icon flashes to warn the user)

Thank you for your time

bogs
Posts: 2282
Joined: Sat Feb 25, 2017 10:45 pm

Re: Display errors on Linux

Post by bogs » Wed Oct 31, 2018 2:09 pm

Glad to hear you were able to get it going (mostly ok) :wink:
The display tried are :
Xming 6.9 on a Windows 7 machine : works OK (mostly)
X terminal with a CentOS 5.4 : works OK (mostly)
localhost display : works OK (mostly)
X terminal with a 2.4.3 linux kernel : When executing my apps (or even an basic app with just a button but without any script), i get the following errors (several times) before the app crash (segmentation fault) :

Xlib: extension "XVideo" missing on display "tx4:0.0".
Xlib: extension "RANDR" missing on display "tx4:0.0".
(<unknown>:30572): Gdk-CRITICAL **: gdk_colormap_new: assertion `GDK_IS_VISUAL (visual)' failed
(<unknown>:30572): Gtk-CRITICAL **: gtk_widget_set_colormap: assertion `GDK_IS_COLORMAP (colormap)' failed
(<unknown>:30572): Gdk-WARNING **: gdk_gc_set_rgb_fg_color() and gdk_gc_set_rgb_bg_color() can only be used on GC's with a colormap. A GC will have a colormap if it is created for a drawable with a colormap, or if a colormap has been set explicitly with gdk_gc_set_colormap.
(<unknown>:30572): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

The terminal is in 8bit pseudo colour, i thought it could cause the problem, but Livecode seems to be able to deal with that on its own (unless i missed something and there's stuff to do ?)
I ran up against a similar issue trying to run Lc apps on Crouton and some newer 'nix distros where I was trying to run older engines. This is most of the information I found from Lc, followed by what I did to get it running on Crouton, the pertinent parts to your problem in bold / underline, with some notes I made following dashes in italic.
Lc_Requirements wrote: The linux engine requires the following:
32-bit installation, or a 64-bit linux distribution that has a *32-bit compatibility layer
2.4.x or later kernel
X11R5 capable Xserver running locally on a 24-bit display
glibc 2.3.2 or later
gtk/gdk/glib (optional – required for native theme support) - Possible responsibility for text box issues...
pango/xft (optional – required for pdf printing, anti-aliased text and unicode font support) - same as above...
lcms (optional – required for color profile support in JPEGs and PNGs)
gksu (optional – required for elevate process support)

Note: The optional requirements (except for gksu and lcms) are also required by Firefox and Chrome, so if your linux distribution runs one of those, it will run the engine. - run the engine yes, the next line shows some of the limitations ...
Note: If the optional requirements are not present then the engine will still run but the specified features will be disabled.
Note: LiveCode and standalones it builds may work on remote Xservers and in other bit-depths, however this mode of operation is not currently supported.
The engine (both IDE and standalone) will require : gtk, gdk, glib, pango and xft on Linux - Even though it is listed optional above, it said required later on.

I'll also mention that while the above was interesting, what eventually got (almost) all the issues sorted on Crouton (and most newer 'nix installs) when using older Lc engines for me was installing libgtk2.0-0:i386,
Considering this is a conversion from Metacard (which displays fine on the same kind of terminal), nothing in my apps should be incompatible.
And your right, the original Mc didn't require it as far as I can tell, it only requires 32bit compatibility.

These are the steps i took on chromebook os cloudready. If you are using a regular distro of linux, skip to 3a.

Code: Select all

1. chromebook os Developer mode
2. used crouton to install ubuntu trusty, xfce
3. Lc test program - BubbleTimer
3a. terminal ./BubbleTimer = shared library error for libX11.so.6
4. verified multiarch was set up properly
5. added i386 and i686 architectures (32bit platforms)
6. sudo apt-get update / then upgrade
7. sudo apt-get install libgtk2.0-0:i386 
Some other things you can do from the terminal to see what else might be missing -
. type readelf -a ./ProgramName - if [Requesting program interpreter: /lib/ld-linux.so.2] is there then install libc6-i386.
. make sure you have the 32 bit architecture on the box/xserver your running, dpkg --print-architecture will tell you the 32 or 64 bit (or other) architecture your on, dpkg --print-foreign-architectures will tell you what else you have setup.
. Lc 6.7.x requires the 32bit libstd6c++. This can be added with -
"sudo apt install lib32stdc++6", you may need to add ":i386" to the end of it.

Thats about all I can think of at the moment.

BONUS ROUND !
Bonus questions :
1) One of my four apps tends to stay on top/visible (when switching desktop for example) even on mostly OK displays. I'm guessing it's something in the Livecode that causes this behaviour, but i don't know where to begin my search.

Maybe iconify or iconic? No guarantee there though.
2) Is there a way to make the taskbar icon flash ? (an app get new data but is not visible, so the icon flashes to warn the user)
Maybe armed? Again, not sure, I only see things like this for Windows or mobile :(
Image

DDS
Posts: 9
Joined: Mon Sep 18, 2017 9:57 am

Re: Display errors on Linux

Post by DDS » Fri Nov 02, 2018 2:21 pm

You give me hope, bogs !

I did more digging on the X terminal : it's a minimal Mandrake 7.2 which indeed does not have gtk/gdk installed.
So my next step is to check if the app can be displayed on a full Mandrake 7.2 (via virtual machine) and if it works, see how/if the X terminal can be upgraded.

I'll report if i make any progress.

bogs
Posts: 2282
Joined: Sat Feb 25, 2017 10:45 pm

Re: Display errors on Linux

Post by bogs » Fri Nov 02, 2018 2:36 pm

DDS wrote:
Fri Nov 02, 2018 2:21 pm
You give me hope, bogs !
"hope" is my middle name! I'm constantly saying things like -
I "hope" I don't screw this up beyond repair...
and
I "hope" no one ever sees this line of code...
:P

Boy, Mandrake, I haven't seen or used that one in a long while. I may have to go take another look at it, thanks for the memories and good luck getting it running :D

Edit - DOH! I forgot that Mandrake changed to Mandriva, and the last release was 7 years ago
Image
Image

DDS
Posts: 9
Joined: Mon Sep 18, 2017 9:57 am

Re: Display errors on Linux

Post by DDS » Tue Nov 06, 2018 4:41 pm

So, after a few days of trials and errors, i managed to get a Mandrake 7.2 working on a VM.
And it does not work, which is expected considering the gtk that comes with Mandrake 7.2 is 1.2.8 and not the 2.0.0 needed. I could try to upgrade it, but that would mean updating the whole system quite a bit and i probably won't be able to upgrade the X terminal.

I also tried using xDMCP (so the mandrake terminal displays the CentOS desktop and i can run the app from there) but that also fails with the same errors.

I have one (very ugly) possibility left but i'm pretty sure it won't work :
Could it be possible to embark the .so from gtk2 as externals (on the CentOS) and and have them used but the engine instead of it searching the /usr/lib folder (on the mandrake) ? Or are externals only used by the scripts ?


One more bonus question :
I know there's several options possible when launching Livecode apps (-ui seems to disable the user interface for example). I found that -d seems to change the display, but are those options written somewhere ? I checked the user's guide, but haven't found anything. (maybe there's a "minimal display" option or something)

bogs
Posts: 2282
Joined: Sat Feb 25, 2017 10:45 pm

Re: Display errors on Linux

Post by bogs » Thu Nov 08, 2018 2:18 pm

I didn't want you to think you were being ignored, I just don't (at the moment) have any answers to the questions :|

*If* I come up with any, I will post them though.
One more bonus question :
I know there's several options possible when launching Livecode apps (-ui seems to disable the user interface for example). I found that -d seems to change the display, but are those options written somewhere ? I checked the user's guide, but haven't found anything. (maybe there's a "minimal display" option or something)
While I am sure there *is* a source of information about the switches you can use to launch Lc built applications, I've never personally found it myself :?

I sure wish someone would post a link to it though, or possibly consider putting whatever they might personally know about it somewhere on the forum :mrgreen:
Image

DDS
Posts: 9
Joined: Mon Sep 18, 2017 9:57 am

Re: Display errors on Linux

Post by DDS » Fri Nov 09, 2018 3:39 pm

No problem, i was busy on other things (namely : making the other displays work better)

But i do have news : we managed to reproduce the errors when displaying the apps on a Centos 6.3 (which otherwise works fine) when the depth of the display is limited to 8-bit, which is the current conf of the Mandrake display. (i *think* centos fails too when configured as 16-bits.)
Fortunately, the customer is open to using more recent displays which work (the CentOS 5.4) so all should end well.

About the bonus questions :
the 2) is solved, not with livecode, but with a call to the C code.
about 3) : only option i can remember is -ui and -d <display>. There's also a -u, but i don't know what it does (same as -ui ?)
About 1) : I don't think iconify is why the app stay on top. Plus it's weird : i got 4 apps that i can switch between
A, B and C play together nicely but :
- When i go from D to A/B : the screen displays A/B then D briefly before settling on A/B (i don't mind to much)
- When i go from D to C : the screen displays A/B then go back to D. I have to reclick on the C button on the taskbar to switch to C reliably. (i should not need to reclick)
This brings me to the following : is there a handler called when a stack completely lose focus ? I can't find a list of the event that can affect a control (or a list of properties for each type of control)

Fourth question :
When an application starts, what are the handler called and in which order ? From what i can see, it is :
- preOpenStack
- preOpenCard (first card)
- openStack
- openCard (first card)
But is there something between the pre* and the open* ?

bogs
Posts: 2282
Joined: Sat Feb 25, 2017 10:45 pm

Re: Display errors on Linux

Post by bogs » Fri Nov 09, 2018 4:19 pm

DDS wrote:
Fri Nov 09, 2018 3:39 pm
Fourth question :
When an application starts, what are the handler called and in which order ? From what i can see, it is :
- preOpenStack
- preOpenCard (first card)
- openStack
- openCard (first card)
But is there something between the pre* and the open* ?
UGH, I was just reading about this :evil: The real question is *where* :evil: :evil: :evil:

Klaus I think was the explainer, it was on an archived mailing list someone just recently linked to...Hmmm....

Edit - HA~! go looking for one thing, and find a different thingy you were looking for previously :P
Richard Gaskin Apr 29, 2013; 11:08am Re: Faceless LiveCode App for CLI on Mac OS X and Windows 7, Nabble mailing list wrote: Yes. Add -ui, and avoid flags the engine currently expects, and you'll
be fine.

The latter is the harder part of this, since the engine still reserves a
great many flags it no longer uses - these are listed here in this
request to remove the ones that are no longer relevant (perhaps this
will be one of the first pull requests submitted, since I can't imagine
it'll take long to fix):
<http://quality.runrev.com/show_bug.cgi?id=1644>

[-f[iles] (disable access to files and processes)
[-g[eometry] ={+-}<xoffset>{+-}<yoffset>]
[-i[nput] fd] read commands from fd (0 is stdin) or named pipe
[-m[map]] (don't memory map files)
[-n[opixmaps]] (draw direct to screen)
[-p[ointerfocus]] (use active focus)
[-s[haredoff]] (don't use shared memory server extension)
[+s[haredon]] (use shared memory server extension)
[-u] (don't create graphical user interface)
[-v[isualid] n] (use visual id n as listed from xdpyinfo)
[-w[indowid] n] (watch window id n for commands)
[stackname(s) | argument(s)]

Image

Post Reply

Return to “Linux”