Re: [fpc-devel] type PPGdkScreen = PGdkScreen;

2023-05-21 Thread Mattias Gaertner via fpc-devel
On Sat, 20 May 2023 14:09:00 +0300
Juha Manninen via fpc-devel  wrote:

> In gtkstatusiconh.inc there is a type definition
>   PPGdkScreen = PGdkScreen;
> It is most likely a bug. I guess it should be
>   PPGdkScreen = ^PGdkScreen;

Yes, fixed.

Mattias
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] type PPGdkScreen = PGdkScreen;

2023-05-21 Thread Juha Manninen via fpc-devel
... but PPGdkScreen definition should be fixed anyways.

Juha
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] type PPGdkScreen = PGdkScreen;

2023-05-20 Thread Juha Manninen via fpc-devel
On Saturday, May 20, 2023, Juha Manninen  wrote:

> which is used in LCL function TGtk2TrayIconHandle.GetPosition: TPoint;
>   gtk_status_icon_get_geometry(FStatusIcon, @AScreen, @AArea,
> @AOrientation);
> where
>   AScreen: PGdkScreen;
>

OK, actually the @AScreen in LCL code is correct if the PPGdkScreen type is
wrong.
It means I only must use {$T-} for that piece of code.
It also means the bugs in LCL TrayIcon are not caused by this.

Juha
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] type PPGdkScreen = PGdkScreen;

2023-05-20 Thread Juha Manninen via fpc-devel
In gtkstatusiconh.inc there is a type definition
  PPGdkScreen = PGdkScreen;
It is most likely a bug. I guess it should be
  PPGdkScreen = ^PGdkScreen;

It is used for :
  gtk_status_icon_get_geometry : function(status_icon:PGtkStatusIcon;
screen:PPGdkScreen; area:PGdkRectangle;
orientation:PGtkOrientation):gboolean; cdecl;

which is used in LCL function TGtk2TrayIconHandle.GetPosition: TPoint;
  gtk_status_icon_get_geometry(FStatusIcon, @AScreen, @AArea,
@AOrientation);
where
  AScreen: PGdkScreen;

FPC option -Sy revealed the error. Otherwise it would be very difficult to
notice.
Incidentally there has been problems with TrayIcons in LCL-GTK2.
I am changing code in Lazarus sources so that it compiles with -Sy. I
recommend FPC project does the same. Very useful option! Typically it
reveals such hard to find bugs.

Please verify if my analysis is correct.
If there is no bug then the type name PPGdkScreen is misleading and should
be removed.
Otherwise I will fix it in LCL sources so that it works also with the
current FPC 3.2.2.

Regards,
Juha
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel