Recent

Author Topic: [SOLVED] TOpenDialog - 100% CPU - Fan Revs Up  (Read 14253 times)

del

  • Full Member
  • ***
  • Posts: 231
Re: [SOLVED] TOpenDialog - 100% CPU - Fan Revs Up
« Reply #30 on: October 31, 2021, 09:12:12 pm »
Update: I thought I'd try to explicitly specify GTK2 as the widget type
Quote
LCLWidgetType:=gtk2
and the original problem (TOpenDialog - 100% CPU - Fan Revs Up) came back. So it looks like it's a problem in GTK2 somewhere. Which I have no real interest in using. So I'm gonna use GTK3 (libgtk-3.so.0 => /usr/lib/libgtk-3.so.0) for a while (the fonts are bigger than with QT5 - may be a system setting) and see how that goes.
« Last Edit: October 31, 2021, 11:47:46 pm by del »

dbannon

  • Hero Member
  • *****
  • Posts: 1816
    • tomboy-ng, a rewrite of the classic Tomboy
Re: [SOLVED] TOpenDialog - 100% CPU - Fan Revs Up
« Reply #31 on: November 01, 2021, 12:10:14 am »
Great, I will be very interested to see how you go using GTK3.  You were, almost certainly using GTK2 originally, its the Lazarus default on Linux.

If you revert back to qt5, there is a utility, qt5ct, that you can install using your distros package manager that will let you alter a number of display parameters for qt5 apps. Things like colors, fonts, sizes, styles etc.  Pretty useful if you like fiddling to get exactly what you want.

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

del

  • Full Member
  • ***
  • Posts: 231
Re: [SOLVED] TOpenDialog - 100% CPU - Fan Revs Up
« Reply #32 on: November 01, 2021, 02:58:11 am »
Thanks Davo. I've used QT in the past with Python and C++ and I like it. It seemed to work great. There was one weird thing: the TProgressBar seemed backwards. I have a vertical one in my app that's supposed to fill up like a thermometer. It was upside down, like gravity was up. So as it showed "progress" the bar descended from its origin at the top. But I can deal with stuff like that.

I was curious about the C++ / wxWidgets app (very similar functions) that I built last week to test / compare. It behaved normally as I described in a previous post:
Quote
ldd $(which CppOps) | grep gtk
   libwx_gtk3u_xrc-3.1.so.5 => /notroot/WXWIDGETS/build/lib/libwx_gtk3u_xrc-3.1.so.5 (0x00007fd3a9570000)
   libwx_gtk3u_html-3.1.so.5 => /notroot/WXWIDGETS/build/lib/libwx_gtk3u_html-3.1.so.5 (0x00007fd3a9496000)
   libwx_gtk3u_qa-3.1.so.5 => /notroot/WXWIDGETS/build/lib/libwx_gtk3u_qa-3.1.so.5 (0x00007fd3a9466000)
   libwx_gtk3u_core-3.1.so.5 => /notroot/WXWIDGETS/build/lib/libwx_gtk3u_core-3.1.so.5 (0x00007fd3a8c05000)
   libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x00007fd3a2d4e000)
It looks like its default was GTK3. Thanks everyone for all the help - I've learned a lot  :)

dbannon

  • Hero Member
  • *****
  • Posts: 1816
    • tomboy-ng, a rewrite of the classic Tomboy
Re: [SOLVED] TOpenDialog - 100% CPU - Fan Revs Up
« Reply #33 on: November 01, 2021, 05:38:48 am »
There was one weird thing: the TProgressBar seemed backwards. I have a vertical one in my app that's supposed to fill up like a thermometer. It was upside down, like gravity was up. So as it showed "progress" the bar descended from its origin at the top.

I probably live on the opposite side of the world than you, so we are used to things being upside down.


Seriously, if you can replicate that issue in a very small app, I'd log it as a bug, zeljko, who looks after Qt5 is very helpful.

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

del

  • Full Member
  • ***
  • Posts: 231
Re: [SOLVED] TOpenDialog - 100% CPU - Fan Revs Up
« Reply #34 on: November 05, 2021, 05:27:24 am »
Great, I will be very interested to see how you go using GTK3.
I'm glad you asked. Not so good. GTK3 fixes the original problem. But I can't use TSaveDialog because it segfaults on create

Quote
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00007F95BAF38BC4

That's with release build run from the command line. If I run it from Lazarus in the debug mode I get this:
Quote
Project CustomOps raised exception class 'External: SIGSEGV'.

 In file 'gtk3/gtk3wsdialogs.pp' at line 1279:
CreateOpenDialogHistory(OpenDialog, PGtkWidget(FileSelWidget));
I get the impression that the bindings for GTK3 have been stagnant for several years. Here is the library on my machine
Quote
libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x00007fb1ec884000)
libgdk-3.so.0 => /usr/lib/libgdk-3.so.0 (0x00007fb1ec790000)
Maybe the bindings are mature and GTK3 is stable and this is just an easy bug. Or it may be the first worm in a can of worms. So for now I'm switching to QT5. :)

dbannon

  • Hero Member
  • *****
  • Posts: 1816
    • tomboy-ng, a rewrite of the classic Tomboy
Re: [SOLVED] TOpenDialog - 100% CPU - Fan Revs Up
« Reply #35 on: November 05, 2021, 05:55:11 am »
...... So for now I'm switching to QT5. :)

Good move.

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

MarkMLl

  • Hero Member
  • *****
  • Posts: 3689
Re: [SOLVED] TOpenDialog - 100% CPU - Fan Revs Up
« Reply #36 on: November 05, 2021, 09:56:00 am »
Maybe the bindings are mature and GTK3 is stable and this is just an easy bug. Or it may be the first worm in a can of worms. So for now I'm switching to QT5. :)

I didn't want to comment on this aspect lest it looked like a complaint.

By and large, distreaux are trying to move away from gtk2 onto gtk3.

Lazarus/LCL is still slightly... immature as far as gtk3 is concerned. I don't know why, but in the past the Gnome (etc.) developers have been criticised for gratuitously breaking the compatibility of their APIs and if this is still an issue it is tempting to assume that it makes life extremely difficult for large-scale projects such as the LCL components.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018