Recent

Author Topic: Cannot remove TShellListView from form  (Read 1325 times)

Diverod

  • New member
  • *
  • Posts: 7
Cannot remove TShellListView from form
« on: November 11, 2024, 04:31:12 pm »
   I have a form on which I placed a TShellListView but decided to go with TShellTreeView instead. Unfortunately I didn't try to remove the ListView until much later.
   When I try to delete the TShellListView Lazarus displays the Not Responding message and all I can do is Force Quit.
   Being that my knowledge is limited, was wondering if someone might have another way of removing a control from a form other than selecting the Delete option in the drop-down menu?
   This does not effect the function of my app and Lazarus restarts fine. I can remove the visibility but would like to remove it.
------------
Lazarus
Version: 3.6
Date: 2024-10-02
FPC Version: 3.2.2
Revision: Unknown
x86_94-linux-gtk2
------------
Ubuntu 24.04.1 LTS
AMD A12-9720P RADEON R7, 12 COMPUTE CORES 4C+8G × 4
Lenovo ideapad 320-15ABR
GNOME Version: 46
Windowing System: Wayland
Kernel Version: Linux 6.8.0-48-generic
------------
   Also, I can make a test form with just a button and TShellTreeView. I cannot remove it from this either.

Any help is appreciated.

Bart

  • Hero Member
  • *****
  • Posts: 5469
    • Bart en Mariska's Webstek
Re: Cannot remove TShellListView from form
« Reply #1 on: November 11, 2024, 06:24:48 pm »
That should not happen.

In the mean time:
  • close Lazarus
  • open the .lfm in a text editor
  • find the declaration of TShellListView and remove it
  • open associated the unit (*.pas;*.pp) in the text editor and also remove the TShellListView from the form definition (TForm1 = class(TForm) etc..)

If you can reliably reproduce the issue with Lazarus 4.0RC1 (or Lazarus main) then please file a bugreport!


Bart

VisualLab

  • Hero Member
  • *****
  • Posts: 575
Re: Cannot remove TShellListView from form
« Reply #2 on: November 11, 2024, 11:34:18 pm »
There's probably something wrong with the TShellListView destructor. And it could be some internal object that TShellListView creates (and deletes), maybe related to system resources.

Diverod

  • New member
  • *
  • Posts: 7
Re: Cannot remove TShellListView from form
« Reply #3 on: November 12, 2024, 01:33:37 am »
That should not happen.

In the mean time:
  • close Lazarus
  • open the .lfm in a text editor
  • find the declaration of TShellListView and remove it
  • open associated the unit (*.pas;*.pp) in the text editor and also remove the TShellListView from the form definition (TForm1 = class(TForm) etc..)

If you can reliably reproduce the issue with Lazarus 4.0RC1 (or Lazarus main) then please file a bugreport!


Bart

Good instructions, worked great!
Thank you!

wp

  • Hero Member
  • *****
  • Posts: 12474
Re: Cannot remove TShellListView from form
« Reply #4 on: November 12, 2024, 10:02:12 am »
Using Laz/main and FPC3.2.2, I can reproduce the issue on Kubuntu 24.04.1/gkt2 (here also with Laz 3.4) and on Manjaro Plasma 22.05/gtk2 (here also with Laz 3.0).

Simply dropping a TShellListView on an empty form of a new default project is enough to show the issue. Sometimes the listview does not appear at this moment, sometimes it appears a few seconds later. The IDE does not react on deleting the control, becomes inresponsive and later reports a "does not respond error".

There is no issue on Windows and qt5/qt6 (verified on Manjaro Plasma 22.5).

I filed a bug report: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41238
« Last Edit: November 12, 2024, 10:19:51 am by wp »

Bart

  • Hero Member
  • *****
  • Posts: 5469
    • Bart en Mariska's Webstek
Re: Cannot remove TShellListView from form
« Reply #5 on: November 16, 2024, 03:09:49 pm »
Do we know of any Lazarus version where this worked correctly?
We need a version wehre this worked OK, so we can bisect the guilty revisison.
(I don't see any obvious candidates in the history of TSHellListView.)

I could reproduce the issue in a stand-alone program with just a TShellListView and a TButton.
In the button's onclick I free the TShellListView --> application freezes.
(All this on Linux x86_64, GTK2. No crash wth QT.)

If you hide the TShellListView before freeing it, the app remains responsive, but you get a crash on closing the app, and you still have to kill it.

I can't figure out what is so special about TShellListView that this happens, when it does not happen with a TListView.

Bart

VisualLab

  • Hero Member
  • *****
  • Posts: 575
Re: Cannot remove TShellListView from form
« Reply #6 on: November 17, 2024, 01:58:09 am »
I can't figure out what is so special about TShellListView that this happens, when it does not happen with a TListView.

Apparently it references some GNOME, Gtk, or something related resources.

Bart

  • Hero Member
  • *****
  • Posts: 5469
    • Bart en Mariska's Webstek
Re: Cannot remove TShellListView from form
« Reply #7 on: November 17, 2024, 10:36:44 am »
wp found the quilty revision, now just figure out what's wrong with it (proabbly in the WS registration code somewhere).

Bart

Bart

  • Hero Member
  • *****
  • Posts: 5469
    • Bart en Mariska's Webstek
Re: Cannot remove TShellListView from form
« Reply #8 on: November 21, 2024, 06:09:19 pm »
Fixed in Lazarus main in commit 9b59add4 and merged to fixes branch.

Bart

 

TinyPortal © 2005-2018