Recent

Author Topic: Problem with gtk3 when compile empty app  (Read 13258 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2018
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with gtk3 when compile empty app
« Reply #30 on: January 21, 2022, 04:43:48 am »
Juha, running my tomboy-ng under trunk lazarus GTK3, I am surprised, very surprised how close it is to working. I get a crash as my main form is show, a focus issue. There is nothing fancy about the main form itself but I do fiddle around with its visibility so possibly my problem. Seems some alignment problems and some updates are slow, probably because of the amount of debugging info being written.

My test app, which is supposed to be a small subset of tomboy-ng is much more unstable, thats what I have been looking at and perhaps, unfairly.

My app to manage the Lazarus Examples, https://gitlab.com/dbannon/laz_examples/-/tree/main/Utility/ExScanner appears just about userable as a GTK3 app !  Again a few sizing issues really, not bad. Sometimes a crash at exit, but I am wondering if thats debugger related.

Now, this is all with trunk, sorry, Main, from a few weeks ago. I should try the same thing on my CT install.

And yes, demanding to be installed as root is enough for me to say No Thanks !

Davo

Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

dbannon

  • Hero Member
  • *****
  • Posts: 2018
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with gtk3 when compile empty app
« Reply #31 on: January 22, 2022, 01:27:18 am »
OK, I have done a few test between a week old Lazarus, a day old Lazarus and Lazarus 2.2.0 and, of course CT.

First of all, you are not going to be pleased to hear this, some things work better in Lazarus 2.2.0 that all the rest, specifically the bitmaps that appear in Speedbuttons, its correct in 2.2.0, rubbish is all the rest.

I do not see any improvements delivered by your merge (but I am testing on Linux so getting rid of the writeln's is obviously a good thing for Windows).

In all cases, Radio Buttons do not work in RadioGroupbox (but do work as expected in a plain GroupBox ??).

In all cases, I cannot alter the height of a Panel programmatically, this code is ignored, works fine in all other widgetsets -

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.     if Panel1.Height > 10 then
  4.         Panel1.Height := 1
  5.     else Panel1.Height := 50;
  6. end;


I had to rewrite the very basic test app used to determine the above, I could not import lazarus project into CT - now, thats rude !

I also had to discard my existing GTK3 test apps, they were based around forms from my real app but have been fiddled endlessly and have problems that do not show up when I run the real app under GTK3. Corruption somewhere. That I am afraid explains my impression that Lazarus GTK3 was a lot worse that it really is.

And the writeln statements would explain Akira1364 better experience with CT on Windows.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4096
  • I like bugs.
Re: Problem with gtk3 when compile empty app
« Reply #32 on: January 24, 2022, 05:01:36 pm »
Sorry for the delay in my reply.

OK, I have done a few test between a week old Lazarus, a day old Lazarus and Lazarus 2.2.0 and, of course CT.
First of all, you are not going to be pleased to hear this, some things work better in Lazarus 2.2.0 that all the rest, specifically the bitmaps that appear in Speedbuttons, its correct in 2.2.0, rubbish is all the rest.
Oh, if LCL-GTK3 is worse in the development branch "main", then we must find which revision caused it.
2.2 was branched some time ago, I am not sure how many commits affect LCL-GTK3.
If you can bisect the guilty revision with your tests, it would be helpful.

Quote
I do not see any improvements delivered by your merge (but I am testing on Linux so getting rid of the writeln's is obviously a good thing for Windows).
Yes, the commit was 02115d373b794b3, "LCL-GTK3: Turn WriteLn into DebugLn. Make sure they compile. Cleanup."
Most changes seem irrelevant. CT also did change Writeln to Debugln which is a good choice.
I included only a subset of their changes. Many of them did not compile which is weird. Like Integer - Boolean comparison and such. How can they compile their code?
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

dbannon

  • Hero Member
  • *****
  • Posts: 2018
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with gtk3 when compile empty app
« Reply #33 on: January 25, 2022, 01:09:17 pm »
OK, will do. As time permits....

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

dbannon

  • Hero Member
  • *****
  • Posts: 2018
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with gtk3 when compile empty app
« Reply #34 on: January 27, 2022, 12:59:16 pm »
Juha, the problem does appear to be in  02115d373b794b3, "LCL-GTK3: Turn WriteLn into DebugLn. Make sure they compile. Cleanup.", specifically in gtk3lclintf.inc

Around line 306 the function TGtk3WidgetSet.RawImage_DescriptionFromBitmap() pops some values into an array that is defined in gtk3bindings/lazcairo1.pas.  However, in the version committed in 02115d3 they appear to be in the wrong order compared to the bindings file. Looks like CT uncommented a few extra formats but they where in the wrong place ? It needs to be -

Code: Pascal  [Select][+][-]
  1. function TGtk3WidgetSet.RawImage_DescriptionFromBitmap(ABitmap: HBITMAP; out ADesc: TRawImageDescription): boolean;
  2. // var
  3. //  GDIObject: PGDIObject absolute ABitmap;
  4. const
  5.   CairoImageFormatToDepth: array[cairo_format_t] of integer =
  6.   (
  7.     {CAIRO_FORMAT_INVALID}   -1,
  8.     {CAIRO_FORMAT_ARGB32}    32,
  9.     {CAIRO_FORMAT_RGB24}     24,
  10.     {CAIRO_FORMAT_A8}         8,
  11.     {CAIRO_FORMAT_A1}         1,
  12.     {CAIRO_FORMAT_RGB16_565} 16,
  13.     {CAIRO_FORMAT_RGB30}     15
  14.   );  
                         

Now, doing that on my system certainly fixes the problem. The test is easy, blank form, add a speed button, assign it a bit map and test. On GTK3 without the fix, image is unrecognizable.

Do you want patch, pull request, bug report ?  Its an easy fix ....

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

dbannon

  • Hero Member
  • *****
  • Posts: 2018
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with gtk3 when compile empty app
« Reply #35 on: January 29, 2022, 11:49:44 am »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

 

TinyPortal © 2005-2018