X11 Ports / FLTK + Web browser Dillo / Help needed

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

Hi, I've built a X11 web browser Dillo https://github.com/rodarima/dillo.

The problem is the same I've got with lincity: string are malformed.

So I wonder if
- It's because some fonts are missing?
- It's related to the X11 server or libX11 (from Sparemint)?
- Do we need libiconv to make those X11 app working?
- Did someone already had this behavior before with X11?

I don't really have a lot of experience with X11.

It needs FLTK https://www.fltk.org/, a cross-platform C++ GUI toolkit for X11.

The binaries and lib can be grabbed here

- FLTK

In order to build FLTK I used the version 1.3.9 and this command

Code: Select all

mkdir build; cd build;
export CMAKE_PREFIX_PATH="/opt/cross-mint/m68k-atari-mint/lib";export CMAKE_INCLUDE_PATH=/opt/cross-mint/m68k-atari-mint/include/;export CMAKE_LIBRARY_PATH=/opt/cross-mint/m68k-atari-mint/lib/;
cmake \
-DFLTK_BUILD_EXAMPLES=ON -DFLTK_BUILD_TEST=OFF -DOPTION_USE_GL=OFF -DUSE_X11=ON -DCMAKE_SYSTEM_NAME=UNIX \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_FLAGS=" -m68020-60 -fomit-frame-pointer -fno-strict-aliasing -O2 " \
-DCMAKE_CXX_FLAGS=" -m68020-60 -fomit-frame-pointer -fno-strict-aliasing -O2" \
-DCMAKE_CXX_COMPILER=m68k-atari-mint-g++ \
-DCMAKE_C_COMPILER=m68k-atari-mint-gcc \
-DCMAKE_AR=/opt/cross-mint/bin/m68k-atari-mint-ar \
-DCMAKE_RANLIB=/opt/cross-mint/bin/m68k-atari-mint-ranlib \
-DCMAKE_PREFIX_PATH=/opt/cross-mint/m68k-atari-mint/lib \
../ 

find . -name "link.txt" -exec sed -i '' "s#../lib/libfltk.a#../lib/libfltk.a -lX11#g" {} +

make
NB: In order to cross compile with FLTK you'll need to replace /usr/include by your include path

In FL/math.h

Code: Select all

#ifdef fl_math_h_cyclic_include 
#  include "/opt/cross-mint/m68k-atari-mint/include/math.h"
#endif
In FL/filename.h

Code: Select all

#ifdef fl_dirent_h_cyclic_include
#  include "/opt/cross-mint/m68k-atari-mint/include/dirent.h"
#endif
DILLO

Code: Select all

./autogen
Then after applied the patch attached I used the command

Code: Select all

PKG_CONFIG_LIBDIR=/opt/cross-mint/m68k-atari-mint/lib/pkgconfig ./configure PKG_CONFIG=pkg-config --host=m68k-atari-mint --target=m68k-atari-mint --build=x86_64-apple-darwin22.3.0 --disable-shared --enable-static --without-pic --with-gnu-ld CC=m68k-atari-mint-gcc AR=m68k-atari-mint-ar LD=m68k-atari-mint-ld AS=m68k-atari-mint-as STRIP=m68k-atari-mint-strip NM=m68k-atari-mint-nm CFLAGS="-m68020-60 -fomit-frame-pointer -fno-strict-aliasing -O2 -I/opt/cross-mint/m68k-atari-mint/include/FL" LT_SYS_LIBRARY_PATH=/opt/cross-mint/m68k-atari-mint/lib/ CXX="m68k-atari-mint-g++" CXXFLAGS="-m68020-60 -fomit-frame-pointer -fno-strict-aliasing -O2 -I/opt/cross-mint/m68k-atari-mint/include/FL"

find . -name "Makefile" -exec sed -i '' "s#AR = ar#AR = m68k-atari-mint-ar#g" {} +

make
Many thanks

EDIT: Some FLTK Apps listing 1 2
Fixing this would unlock many apps I guess
You do not have the required permissions to view the files attached to this post.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3002
Joined: Sun Aug 03, 2014 5:54 pm

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by ThorstenOtto »

I think you cannot use the X11 libraries from sparemint, because they were compiled by gcc 2.95.3. Maybe try using that one instead: https://tho-otto.de/download/rpm/rpmdet ... noarch.rpm

Its been some time since i looked after it, but i remember that i also had problems with the fonts. Maybe looking at https://github.com/th-otto/GEM-XServer can help, this should have already a few fixes (but it is still far from being perfect).
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

ThorstenOtto wrote: Sat Dec 16, 2023 12:03 pm I think you cannot use the X11 libraries from sparemint, because they were compiled by gcc 2.95.3. Maybe try using that one instead: https://tho-otto.de/download/rpm/rpmdet ... noarch.rpm

Its been some time since i looked after it, but i remember that i also had problems with the fonts. Maybe looking at https://github.com/th-otto/GEM-XServer can help, this should have already a few fixes (but it is still far from being perfect).
Thank you very much Thorsten.
I rebuilt with the libraries extracted from the rpm package that you told me but it's the same: bad characters interpretation.

Instead of breaking my head on X11-gem I'm thinking about NanoX: 2 ways to implement it:
The harder way: writing an AES driver.
The easy way: It seems that NanoX have a SDL driver.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3002
Joined: Sun Aug 03, 2014 5:54 pm

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by ThorstenOtto »

NanoX would replace the server, but you still need X11 libraries to compile applications.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

ThorstenOtto wrote: Sat Dec 16, 2023 3:03 pm NanoX would replace the server, but you still need X11 libraries to compile applications.
Yes, building the latest Xlib should be ok?
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3002
Joined: Sun Aug 03, 2014 5:54 pm

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by ThorstenOtto »

Good luck, i had hard times to cross-compile it ;)
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

ThorstenOtto wrote: Sat Dec 16, 2023 3:07 pm Good luck, i had hard times to cross-compile it ;)
Haha.

May be this one https://github.com/ghaerr/nxlib?

Whatever I've to try. May be it will not be possible to make it...
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

Do someone now the equivalence for TIOCCONS in mintlib?

I've

Code: Select all

/Users/mmedour/Downloads/microwindows-sdl1/src/demos/nanox/nxterm.c: In function 'main':
/Users/mmedour/Downloads/microwindows-sdl1/src/demos/nanox/nxterm.c:1858:16: error: 'TIOCCONS' undeclared (first use in this function)
 1858 |   ioctl(pipeh, TIOCCONS, 0);
Btw the server build without any difficulty using sdl1.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3002
Joined: Sun Aug 03, 2014 5:54 pm

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by ThorstenOtto »

medmed wrote: Sat Dec 16, 2023 4:12 pm Do someone now the equivalence for TIOCCONS in mintlib?
I think there is no equivalent, since the kernel does not support pseudo-terminals. For what is it used?
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

It's used in nxterm example, I just put anything in order to complete the build.

Code: Select all

    /* prepare to catch console output */
    if (console) {
		/* for any OS chr$(7) might cause endless loops if caught from console*/
		visualbell = 1;
		console = 0;       /* data will come to normal pipe handle */
		#ifdef __MINT__
		ioctl(pipeh, SIGABRT, 0);
		#else
		ioctl(pipeh, TIOCCONS, 0);
		#endif
    }
EDIT:
So try #1 nok
Window is stuck. I've to figure out why...
You do not have the required permissions to view the files attached to this post.
Last edited by medmed on Sat Dec 16, 2023 5:14 pm, edited 2 times in total.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3002
Joined: Sun Aug 03, 2014 5:54 pm

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by ThorstenOtto »

medmed wrote: Sat Dec 16, 2023 5:10 pm ioctl(pipeh, SIGABRT, 0)
Bad idea. That would invoke some random ioctl(). Just try to put it `#ifdef TIOCCONS` and see if you can get away with just doing nothing.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

Yes it's done, but as it concerns only Xterm like it should not impact the server or the other apps.

Fyi

I've took this archive because SDL1 was deprecated in latest versions.

There's a src/Condig/config.sdl to copy in src/congig, then Arch.rules should be adapted, then make

I've attached my actual non working diff just in case.
You do not have the required permissions to view the files attached to this post.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

May be it's related to

Code: Select all

	     if (strcmp(namelist[i]->d_name, ".") != 0) {
			#ifdef __MINT__
			struct stat mint_stat;
			char mint_path[1024] = {0};
			sprintf(mint_path,"%s",path);
			sprintf(mint_path,"/%s",namelist[i]->d_name);
			stat(namelist[i]->d_name, &mint_stat);
			if (S_ISDIR(mint_stat.st_mode))	{
			#else
	       if (namelist[i]->d_type == DT_DIR) {
			#endif
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

The problem is that it hangs on the select function

Code: Select all

e = select(setsize+1, &rfds, NULL, NULL, to);
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

Got some success!
You do not have the required permissions to view the files attached to this post.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3002
Joined: Sun Aug 03, 2014 5:54 pm

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by ThorstenOtto »

Nice one. But using SDL as backend is surely not the best option.
The problem is that it hangs on the select function
Does any of the file descriptors refer to a file on the hostfs of aranym? There was a bug in aranym that might cause this. It has already been fixed in both mint & aranym.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

ThorstenOtto wrote: Sun Dec 17, 2023 5:22 am Nice one. But using SDL as backend is surely not the best option.
The problem is that it hangs on the select function
Does any of the file descriptors refer to a file on the hostfs of aranym? There was a bug in aranym that might cause this. It has already been fixed in both mint & aranym.
Yes. With the rgb fix it's look better. Yes SDL is only "the make it work first" tool.

To make it works I use option LINK_APP_INTO_SERVER = Y: server is linked with client, so it's not really a permanent solution. I bypass the select behavior by using the define -DHAVE_SELECT=0. I've also tried commented the select function and then it hangs in accept(un_sock, (struct sockaddr *) &sckt, &size).

I've tried both, hostfs and ext2(vision distro) with Aranym-JIT.

I guess I've to rebuilt the mintlib with some printf in it to figure out where it hangs.
You do not have the required permissions to view the files attached to this post.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
User avatar
shoggoth
Nature
Nature
Posts: 1405
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by shoggoth »

That's a pretty cool thing.
Ain't no space like PeP-space.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

Ok so I've rebuilt mintlib with some debug

select receive a time pointer but it consider it as NULL.

Then it hangs in :

Code: Select all

        ...
        printf("retval: \n");
	retval = __poll (pfds, nfds, msec_timeout);
        ...
Now I have to understand why timeout is null and why poll don't return.

EDIT = The time struct pointer = NULL seems normal here, so next: why poll funct hangs.
You do not have the required permissions to view the files attached to this post.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

Ok, so reading the first lines of poll.c and it seems that there's a problem of logic:

- select() with timeout_ptr == NULL should return immediately - Nop it should wait.
- if timeout_ptr == NULL select() send a negative timeout value to poll()
- then poll() wait indefinitely because - Sorry, don't know, I've to inverstigate more

Code: Select all

       ....
	if (__timeout < 0) {
		timeout = ~0;
	}
	....
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3002
Joined: Sun Aug 03, 2014 5:54 pm

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by ThorstenOtto »

RTFM ;)

for select:

Code: Select all

              If both fields of the timeval structure are zero, then select() returns immediately.  (This is useful for polling.)

              If timeout is specified as NULL, select() blocks indefinitely waiting for a file descriptor to become ready.
for poll:

Code: Select all

If the value of timeout is 0, poll() shall return immediately. If the value of timeout is -1, poll() shall block  until  a  re-
       quested event occurs or until the call is interrupted.
So imho the implementation in mintlib is correct.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

ThorstenOtto wrote: Sun Dec 17, 2023 6:46 pm RTFM ;)

for select:

Code: Select all

              If both fields of the timeval structure are zero, then select() returns immediately.  (This is useful for polling.)

              If timeout is specified as NULL, select() blocks indefinitely waiting for a file descriptor to become ready.
for poll:

Code: Select all

If the value of timeout is 0, poll() shall return immediately. If the value of timeout is -1, poll() shall block  until  a  re-
       quested event occurs or until the call is interrupted.
So imho the implementation in mintlib is correct.
Thanks, yes it's correct.

Possibilities I see:
Fpoll should reply but it don't
Timeout should not be null but it is

So I guess the server create his socket in /tmp/.nano-x then wait for read ready.
Last edited by medmed on Sun Dec 17, 2023 8:23 pm, edited 2 times in total.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

Duplicate sorry
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
rodarima
Atarian
Atarian
Posts: 1
Joined: Sun Dec 17, 2023 8:04 pm

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by rodarima »

Congrats!, first time I see Dillo running on Atari. Feel free to open an issue or MR/patch in https://github.com/rodarima/dillo.

If you manage to fix the rendering and can send a picture I'll like to add it to the docs :D
medmed
Atari Super Hero
Atari Super Hero
Posts: 634
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: X11 Ports / FLTK + Web browser Dillo / Help needed

Post by medmed »

shoggoth wrote: Sun Dec 17, 2023 4:11 pm That's a pretty cool thing.
Yes I think so too.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
Post Reply

Return to “C / PASCAL etc.”