Recent

Author Topic: Lousy rendering on Raspberry Pi - Solved (sort of).  (Read 6161 times)

chrnobel

  • Sr. Member
  • ****
  • Posts: 283
Lousy rendering on Raspberry Pi - Solved (sort of).
« on: November 13, 2018, 10:52:35 pm »
I am trying to make a project for Raspberry Pi, and there are no problems in compiling, but the appearance is ugly.

If I compile my project on Linux Mint 1.8 XFCE (Intel 64bit), Laz 1.8.42, GTK2, eg. buttons look like the the attachment mint18_3.jpg

Doing the same on RPi, Laz 1.8.4, GTK2 it looks like the rpi.jpg.

And actually it makes no difference if I compile the IDE on the RPi to GTK3 or QT5.

So why does the LCL behave like that on the RPi - other GTK programs on the RPi behaves normally.


« Last Edit: December 03, 2018, 05:49:57 pm by chrnobel »

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Lousy rendering on Raspberry Pi.
« Reply #1 on: November 14, 2018, 12:37:45 am »
Ok, I am going to shoot from the hip, FONTS?

Could it be the IDE on the Pi is applying the same fonts settings to your app ?

Maybe you can see the type of fonts being used.
The only true wisdom is knowing you know nothing

mica

  • Full Member
  • ***
  • Posts: 196
Re: Lousy rendering on Raspberry Pi.
« Reply #2 on: November 14, 2018, 12:59:19 am »
Theme settings from gtk2?

chrnobel

  • Sr. Member
  • ****
  • Posts: 283
Re: Lousy rendering on Raspberry Pi.
« Reply #3 on: November 14, 2018, 11:05:43 am »
Theme settings from gtk2?
You made me look in the right direction.

Raspbian uses per default LXDE, which appears to have a very primitive rendering.

I replaced LXDE with XFCE, using this instruction:

https://raspberrypi.stackexchange.com/questions/10053/changing-to-xfce-from-lxde

Et voila, now it works.

chrnobel

  • Sr. Member
  • ****
  • Posts: 283
Re: Lousy rendering on Raspberry Pi.
« Reply #4 on: November 15, 2018, 09:51:37 am »
I replaced LXDE with XFCE, using this instruction:
BUT - it still annoys me, that it is not possible to get it to work under LDXE, as other programs (not made with Lazarus) works ok.

And it makes it more difficult to use out-of-the-box, as the GUI has to be replaced, instead of using the default.

Thaddy

  • Hero Member
  • *****
  • Posts: 14202
  • Probably until I exterminate Putin.
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #5 on: November 15, 2018, 10:02:25 am »
Can you PLEASE show us (some more) screenshots about what the actual problem is?
I have no clue and neither do I recognize the problem. (written on Raspbian and a Pi3 , 32 bit color depth and a 1920X1080p 24 inch HDMI connected monitor)
Specialize a type, not a var.

chrnobel

  • Sr. Member
  • ****
  • Posts: 283
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #6 on: November 15, 2018, 12:51:01 pm »
Can you PLEASE show us (some more) screenshots about what the actual problem is?
I have no clue and neither do I recognize the problem. (written on Raspbian and a Pi3 , 32 bit color depth and a 1920X1080p 24 inch HDMI connected monitor)
If you look at the two images, you will see that the buttons have rounded corners, and gradient border when using XFCE, while the button is flat, no round corners, and there is no gradient border, but only a white border when using LXDE.

So as I see it, the appearance under LXDE is "flat".

Which GUI are you using?

Thaddy

  • Hero Member
  • *****
  • Posts: 14202
  • Probably until I exterminate Putin.
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #7 on: November 15, 2018, 02:47:50 pm »
I am using the standard. I can see the difference: flat is intentional. As per design specs. I refer you to the raspberrypi.org forums (and blogs!).
In this case Lazarus adheres and other programs don't, but I may be wrong until I see sufficient evidence.
To be sure you understand this: Lazarus doesn't render that, the default rendering engine from the distribution does that. Lazarus uses the rendering engine of the OS (debian derived Raspbian).
Note that is NOT lxde, but a modified version of it.
« Last Edit: November 15, 2018, 02:56:34 pm by Thaddy »
Specialize a type, not a var.

mica

  • Full Member
  • ***
  • Posts: 196
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #8 on: November 15, 2018, 10:54:37 pm »
you can try "GNOME Color Chooser" to change the theme settings,
or "gtk-theme-switch" (if this is in the repos for raspian)

chrnobel

  • Sr. Member
  • ****
  • Posts: 283
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #9 on: November 16, 2018, 03:12:21 pm »
I am using the standard. I can see the difference: flat is intentional. As per design specs. I refer you to the raspberrypi.org forums (and blogs!).
In this case Lazarus adheres and other programs don't, but I may be wrong until I see sufficient evidence.
I simply don't get it.

I have tried to make a very simple c program, using GTK2, and that behaves as intended (#include <gtk/gtk.h>, and compiling with GTK2+), meaning the button has rounded corners, and color gradient (see the left side of the image below).

However compiling the Lazarus application with Widget type set to GTK2, the result is still flat, as shown on the right side of the image.

So to me it seem the other way around, that Lazarus simply does not adhere.

Quote
To be sure you understand this: Lazarus doesn't render that, the default rendering engine from the distribution does that. Lazarus uses the rendering engine of the OS (debian derived Raspbian).
Note that is NOT lxde, but a modified version of it.
Yes, but Pixel is stil a fork of LXDE, and is installed by default as LXDE, same naming.

Thaddy

  • Hero Member
  • *****
  • Posts: 14202
  • Probably until I exterminate Putin.
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #10 on: November 16, 2018, 03:16:01 pm »
Indeed, that's a bug. A picture is more than a 1000 words.
Furthermore I can confirm it is a Lazarus bug, since executables in any other languages work as intended.
(I just wrote a simple Mono program, so it may be a bit bold)
« Last Edit: November 16, 2018, 03:20:08 pm by Thaddy »
Specialize a type, not a var.

chrnobel

  • Sr. Member
  • ****
  • Posts: 283
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #11 on: November 18, 2018, 11:01:33 pm »
Indeed, that's a bug.
Any idea of what to do then?

chrnobel

  • Sr. Member
  • ****
  • Posts: 283
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #12 on: December 03, 2018, 05:48:40 pm »
Okay, I found another pass.

As I want my result to be used for embedded purposes, I do actually not need a display manager, only X.

So I now using a Raspbian Lite, and have only installed X and libgtk like this:

sudo apt-get install --no-install-recommends xserver-xorg
sudo apt-get install --no-install-recommends xinit
sudo apt-get install libgtk2.0-0

Currently nothing else.

Now I can start my application from the command line, and the rendering is actually as expected.


hansotten

  • Jr. Member
  • **
  • Posts: 88
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #13 on: December 04, 2018, 01:32:57 pm »
Okay, I found another pass.

As I want my result to be used for embedded purposes, I do actually not need a display manager, only X.

So I now using a Raspbian Lite, and have only installed X and libgtk like this:

sudo apt-get install --no-install-recommends xserver-xorg
sudo apt-get install --no-install-recommends xinit
sudo apt-get install libgtk2.0-0

Currently nothing else.

Now I can start my application from the command line, and the rendering is actually as expected.

Tried this, have set widget to GTK2 in Lazarus in Stretch full on raspbian, compiled a very simple app, moved the executable to Lite, started the app with 'xinit app',
X server fail because you need a session/windows manager to get this working? Or did I miss something obvious due to my limited Linux Xorg knowledge?

With other words: how did you get this working?
« Last Edit: December 04, 2018, 03:06:55 pm by hansotten »

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Lousy rendering on Raspberry Pi - Solved (and then again not).
« Reply #14 on: December 04, 2018, 02:17:27 pm »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018