Lousy rendering on Raspberry Pi - Solved (sort of). lazarus / 31-LCL ---------------------------------------------------------------------- chrnobel · 2018-11-13 21:52 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. ---------------------------------------------------------------------- jamie · 2018-11-13 23:37 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. ---------------------------------------------------------------------- mica · 2018-11-13 23:59 Theme settings from gtk2? ---------------------------------------------------------------------- chrnobel · 2018-11-14 10:05 Quote from: mica on November 14, 2018, 12:59:19 amTheme 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 · 2018-11-15 08:51 Quote from: chrnobel on November 14, 2018, 11:05:43 amI 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 · 2018-11-15 09:02 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) ---------------------------------------------------------------------- chrnobel · 2018-11-15 11:51 Quote from: Thaddy on November 15, 2018, 10:02:25 amCan 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 · 2018-11-15 13:47 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. ---------------------------------------------------------------------- mica · 2018-11-15 21:54 you can try "GNOME Color Chooser" to change the theme settings, or "gtk-theme-switch" (if this is in the repos for raspian) ---------------------------------------------------------------------- chrnobel · 2018-11-16 14:12 Quote from: Thaddy on November 15, 2018, 02:47:50 pmI 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 , 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. QuoteTo 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 · 2018-11-16 14:16 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) ---------------------------------------------------------------------- chrnobel · 2018-11-18 22:01 Quote from: Thaddy on November 16, 2018, 03:16:01 pmIndeed, that's a bug. Any idea of what to do then? ---------------------------------------------------------------------- chrnobel · 2018-12-03 16:48 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 · 2018-12-04 12:32 Quote from: chrnobel on December 03, 2018, 05:48:40 pmOkay, 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? ---------------------------------------------------------------------- avra · 2018-12-04 13:17 Quote from: hansotten on December 04, 2018, 01:32:57 pmTried this, fails, dont you need a session/windows manager to get this working? Maybe you will find TinyCore Linux interesting: https://www.zdnet.com/article/hands-on-with-picore-7-0-tiny-core- linux-for-the-raspberry-pi/ http://forum.tinycorelinux.net/index.php/board,57.0.html ---------------------------------------------------------------------- Thaddy · 2018-12-04 13:39 I am running Lazarus trunk / fpc trunk and do not have the issue afaict. Note I write server apps, NOT much Laz visual apps. If trunk/trunk has the same issue? I can not replicate this under a bog standard but up-to-date Raspbian. ---------------------------------------------------------------------- chrnobel · 2018-12-04 16:39 Quote from: chrnobel on December 03, 2018, 05:48:40 pmNow I can start my application from the command line, and the rendering is actually as expected. Although I still do have some issues. The graphical rendering is now correct, but I have a problem with fonts, as it seems like my fontsetting is ignored, probably because there is no GTK theme, and therefore it always use default fonts. So my next challenge is to install only the GTK theming, but not a gdm and all the other overhead. ---------------------------------------------------------------------- chrnobel · 2018-12-04 16:43 Quote from: hansotten on December 04, 2018, 01:32:57 pmX 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? I just use startx: startx /home/pi/application ---------------------------------------------------------------------- hansotten · 2018-12-04 18:52 Yes, that works! Thanks!