Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-05

Form resize to standard size in IDE.

22 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hi,

Another oddity in the IDE designer.

I have a form which contains some group boxes, radio buttons and a buttonpanel. Bordertstyle is bsDialog. No special properties regarding autosize or whatsoever have been set.

When I switch (using F12) between source and form, it *always* resizes to some seemingly standard size and I need to fix the size.

The form just contains the following:
Height = 279
Top = 218
Width = 443
BorderStyle = bsDialog
Caption = 'Resize Selected elements'
ClientHeight = 279
ClientWidth = 443
Position = poOwnerFormCenter
LCLVersion = '1.9.0.0'

I have attached it for reference.

I suspect the scaling and high-dpi is at work here: I have a dual-monitor system, with xinerama. To test that hypothesis, I tried to set scaled to false, but it doesn't help.

Also:
When the form designer is active, and I press save, the form is marked 'dirty' (i.e. not saved!)

Anything I can do to help to diagnose the issue ?

Michael.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: frm.zip
Type: application/zip
Size: 1390 bytes
Desc:
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170507/883eff1d/attachment.zip>

Reply by email

zeljko
to Michael Van Canneyt
Michael Van Canneyt wrote 36 lines
Hi, Another oddity in the IDE designer. I have a form which contains some group boxes, radio buttons and a buttonpanel. Bordertstyle is bsDialog. No special properties regarding autosize or whatsoever have been set. When I switch (using F12) between source and form, it *always* resizes to some seemingly standard size and I need to fix the size. The form just contains the following: Height = 279 Top = 218 Width = 443 BorderStyle = bsDialog Caption = 'Resize Selected elements' ClientHeight = 279 ClientWidth = 443 Position = poOwnerFormCenter LCLVersion = '1.9.0.0' I have attached it for reference. I suspect the scaling and high-dpi is at work here: I have a dual-monitor system, with xinerama. To test that hypothesis, I tried to set scaled to false, but it doesn't help. Also: When the form designer is active, and I press save, the form is marked 'dirty' (i.e. not saved!) Anything I can do to help to diagnose the issue ?

If you suspect on HiDPI then you should disable scaling at application level (lazaruside) via Application.Scaled := False (or similar prop name) . In that case TCustomForm.Scaled should not be taken into account in any case.
Second thing: I assume that you're using Gtk2 ide. What is windowmanager ? Does it run compositing ?

zeljko

Reply by email

Michael Van Canneyt
to zeljko
zeljko wrote 41 lines
On 05/07/2017 12:02 PM, Michael Van Canneyt via Lazarus wrote: > > Hi, > > Another oddity in the IDE designer. > > I have a form which contains some group boxes, radio buttons and a > buttonpanel. > Bordertstyle is bsDialog. No special properties regarding autosize or > whatsoever have been set. > > When I switch (using F12) between source and form, it *always* resizes to > some seemingly standard size and I need to fix the size. > > The form just contains the following: > Height = 279 > Top = 218 > Width = 443 > BorderStyle = bsDialog > Caption = 'Resize Selected elements' > ClientHeight = 279 > ClientWidth = 443 > Position = poOwnerFormCenter > LCLVersion = '1.9.0.0' > > I have attached it for reference. > > I suspect the scaling and high-dpi is at work here: I have a > dual-monitor system, with xinerama. > To test that hypothesis, I tried to set scaled to false, but it doesn't > help. > > Also: When the form designer is active, and I press save, the form is > marked 'dirty' > (i.e. not saved!) > > Anything I can do to help to diagnose the issue ? If you suspect on HiDPI then you should disable scaling at application level (lazaruside) via Application.Scaled := False (or similar prop name) . In that case TCustomForm.Scaled should not be taken into account in any case.

Is there a command-line option for the IDE to disable this ? It seems silly to me that I would have to modify the IDE sources every time I do a SVN update?

Second thing: I assume that you're using Gtk2 ide. What is windowmanager ? Does it run compositing ?

I don't know. I use a standard Linux Mint using Cinnamon desktop.

Michael.

Reply by email

zeljko
to Michael Van Canneyt
Michael Van Canneyt wrote 51 lines
On Sun, 7 May 2017, zeljko wrote: > On 05/07/2017 12:02 PM, Michael Van Canneyt via Lazarus wrote: >> >> Hi, >> >> Another oddity in the IDE designer. >> >> I have a form which contains some group boxes, radio buttons and a >> buttonpanel. >> Bordertstyle is bsDialog. No special properties regarding autosize or >> whatsoever have been set. >> >> When I switch (using F12) between source and form, it *always* >> resizes to >> some seemingly standard size and I need to fix the size. >> >> The form just contains the following: >> Height = 279 >> Top = 218 >> Width = 443 >> BorderStyle = bsDialog >> Caption = 'Resize Selected elements' >> ClientHeight = 279 >> ClientWidth = 443 >> Position = poOwnerFormCenter >> LCLVersion = '1.9.0.0' >> >> I have attached it for reference. >> >> I suspect the scaling and high-dpi is at work here: I have a >> dual-monitor system, with xinerama. >> To test that hypothesis, I tried to set scaled to false, but it doesn't >> help. >> >> Also: When the form designer is active, and I press save, the form is >> marked 'dirty' >> (i.e. not saved!) >> >> Anything I can do to help to diagnose the issue ? > > If you suspect on HiDPI then you should disable scaling at application > level (lazaruside) via Application.Scaled := False (or similar prop > name) . In that case TCustomForm.Scaled should not be taken into > account in any case. Is there a command-line option for the IDE to disable this ? It seems silly to me that I would have to modify the IDE sources every time I do a SVN update?

AFAIK not.

Show quoted text 5 lines
> Second thing: I assume that you're using Gtk2 ide. What is > windowmanager ? Does it run compositing ? I don't know. I use a standard Linux Mint using Cinnamon desktop.

Then compositing is on, and that's probably cause of problems.

zeljko

Reply by email

Michael Van Canneyt
to zeljko
zeljko wrote 19 lines
>> >> If you suspect on HiDPI then you should disable scaling at application >> level (lazaruside) via Application.Scaled := False (or similar prop >> name) . In that case TCustomForm.Scaled should not be taken into >> account in any case. > > Is there a command-line option for the IDE to disable this ? It seems > silly to me that I would have to modify the IDE sources every time I do > a SVN update? AFAIK not. > >> Second thing: I assume that you're using Gtk2 ide. What is >> windowmanager ? Does it run compositing ? > > I don't know. I use a standard Linux Mint using Cinnamon desktop. Then compositing is on, and that's probably cause of problems.

Can you explain why this would cause problems ?

Because I see many more straneg things happening.

At runtime my StatusBar disappears for some mysterious reason. I need to resize the form and then it appears again. And it doesn't matter whether I allow scaling or not.

Michael.

Reply by email

zeljko
to Michael Van Canneyt
Michael Van Canneyt wrote 25 lines
On Sun, 7 May 2017, zeljko wrote: >>> >>> If you suspect on HiDPI then you should disable scaling at application >>> level (lazaruside) via Application.Scaled := False (or similar prop >>> name) . In that case TCustomForm.Scaled should not be taken into >>> account in any case. >> >> Is there a command-line option for the IDE to disable this ? It seems >> silly to me that I would have to modify the IDE sources every time I do >> a SVN update? > > AFAIK not. > >> >>> Second thing: I assume that you're using Gtk2 ide. What is >>> windowmanager ? Does it run compositing ? >> >> I don't know. I use a standard Linux Mint using Cinnamon desktop. > > Then compositing is on, and that's probably cause of problems. Can you explain why this would cause problems ?

Don't know, tried to fix that inside gtk2 many times, besides that on some wm's + compositing sizes are ok, on some not. Really don't know. Using qtlcl for work and don't have such problems. See gtk2wsforms.pp and stuff about form events ...

zeljko

Reply by email

Fabio Luis Girardi
to zeljko

I (and others co-workers) have experienced the same behavior on Linux mint cinnamon 17.3 when Lazarus is built using gtk2 (using Lazarus 1.4, 1.6, fixes and trunk). This strange behavior disappeared when Lazarus is built with QT.

The cinnamon looking glass can provide some debug information about this. I'll try reproduce this tomorrow, to collect the cinnamon debug info.

Em 7 de mai de 2017 14:40, "zeljko via Lazarus" <

Show quoted text 49 lines
escreveu: On 05/07/2017 06:24 PM, Michael Van Canneyt wrote: > > > On Sun, 7 May 2017, zeljko wrote: > > >>>> If you suspect on HiDPI then you should disable scaling at application >>>> level (lazaruside) via Application.Scaled := False (or similar prop >>>> name) . In that case TCustomForm.Scaled should not be taken into >>>> account in any case. >>>> >>> >>> Is there a command-line option for the IDE to disable this ? It seems >>> silly to me that I would have to modify the IDE sources every time I do >>> a SVN update? >>> >> >> AFAIK not. >> >> >>> Second thing: I assume that you're using Gtk2 ide. What is >>>> windowmanager ? Does it run compositing ? >>>> >>> >>> I don't know. I use a standard Linux Mint using Cinnamon desktop. >>> >> >> Then compositing is on, and that's probably cause of problems. >> > > Can you explain why this would cause problems ? > Don't know, tried to fix that inside gtk2 many times, besides that on some wm's + compositing sizes are ok, on some not. Really don't know. Using qtlcl for work and don't have such problems. See gtk2wsforms.pp and stuff about form events ... zeljko -- _______________________________________________ Lazarus mailing list http://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170507/88478bf1/attachment.html>

Reply by email

Juha Manninen
to Fabio Luis Girardi
Fabio Luis Girardi wrote
I (and others co-workers) have experienced the same behavior on Linux mint cinnamon 17.3 when Lazarus is built using gtk2 (using Lazarus 1.4, 1.6, fixes and trunk).

I have seen similar reports but no common cause was found. Now it starts to look like a Cinnamon related issue. Somebody should debug it there.

Juha

Reply by email

Kostas Michalopoulos
to Juha Manninen

Maybe it is also related to the problem i mentioned a few days ago? It does sound kind of similar to what i demo in the video here:

https://webmshare.com/q78rb

On Mon, May 8, 2017 at 12:45 AM, Juha Manninen via Lazarus <

Show quoted text 20 lines
wrote: On Sun, May 7, 2017 at 9:35 PM, Fabio Luis Girardi via Lazarus wrote: > I (and others co-workers) have experienced the same behavior on Linux mint > cinnamon 17.3 when Lazarus is built using gtk2 (using Lazarus 1.4, 1.6, > fixes and trunk). I have seen similar reports but no common cause was found. Now it starts to look like a Cinnamon related issue. Somebody should debug it there. Juha -- _______________________________________________ Lazarus mailing list http://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170508/c0b0deb2/attachment.html>

Reply by email

Michael Van Canneyt
to Kostas Michalopoulos
Kostas Michalopoulos wrote
Maybe it is also related to the problem i mentioned a few days ago? It does sound kind of similar to what i demo in the video here: https://webmshare.com/q78rb

It certainly looks like it.

Michael.

Show quoted text 25 lines
On Mon, May 8, 2017 at 12:45 AM, Juha Manninen via Lazarus < > wrote: > On Sun, May 7, 2017 at 9:35 PM, Fabio Luis Girardi via Lazarus > wrote: >> I (and others co-workers) have experienced the same behavior on Linux > mint >> cinnamon 17.3 when Lazarus is built using gtk2 (using Lazarus 1.4, 1.6, >> fixes and trunk). > > I have seen similar reports but no common cause was found. > Now it starts to look like a Cinnamon related issue. Somebody should > debug it there. > > Juha > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus-ide.org/listinfo/lazarus >

Reply by email

Fabio Luis Girardi

Em 8 de mai de 2017 04:43, "Michael Van Canneyt via Lazarus" <

escreveu:

On Mon, 8 May 2017, Kostas Michalopoulos via Lazarus wrote:

Maybe it is also related to the problem i mentioned a few days ago? It does

sound kind of similar to what i demo in the video here: https://webmshare.com/q78rb

It certainly looks like it.

Maybe, but on Mint cinnamon, one time that the form is resized to default size, it's not resized anymore.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170508/2e3f9bb7/attachment.html>

Reply by email

Michael Van Canneyt
to Fabio Luis Girardi
Fabio Luis Girardi wrote 18 lines
Em 8 de mai de 2017 04:43, "Michael Van Canneyt via Lazarus" < > escreveu: On Mon, 8 May 2017, Kostas Michalopoulos via Lazarus wrote: Maybe it is also related to the problem i mentioned a few days ago? It does > sound kind of similar to what i demo in the video here: > > https://webmshare.com/q78rb > It certainly looks like it. Maybe, but on Mint cinnamon, one time that the form is resized to default size, it's not resized anymore.

I have been experimenting, and the 'default' size depends on what controls are present in the form and what their sizes are.
So that definitely smells of the lazarus LCL layouting algorithms...

Michael.

Reply by email

zeljko
to Michael Van Canneyt
Michael Van Canneyt wrote 27 lines
On Mon, 8 May 2017, Fabio Luis Girardi via Lazarus wrote: > Em 8 de mai de 2017 04:43, "Michael Van Canneyt via Lazarus" < > > escreveu: > > > > On Mon, 8 May 2017, Kostas Michalopoulos via Lazarus wrote: > > Maybe it is also related to the problem i mentioned a few days ago? It > does >> sound kind of similar to what i demo in the video here: >> >> https://webmshare.com/q78rb >> > > It certainly looks like it. > > > Maybe, but on Mint cinnamon, one time that the form is resized to default > size, it's not resized anymore. I have been experimenting, and the 'default' size depends on what controls are present in the form and what their sizes are. So that definitely smells of the lazarus LCL layouting algorithms...

Probably gtk2 sends some garbled size messages. I cannot reproduce such thing with qtlcl (tried under windowmaker too, as it is mentioned in link)

zeljko

Reply by email

Michael Van Canneyt
to zeljko
zeljko wrote 31 lines
On 08.05.2017 12:08, Michael Van Canneyt via Lazarus wrote: > > > On Mon, 8 May 2017, Fabio Luis Girardi via Lazarus wrote: > >> Em 8 de mai de 2017 04:43, "Michael Van Canneyt via Lazarus" < >> > escreveu: >> >> >> >> On Mon, 8 May 2017, Kostas Michalopoulos via Lazarus wrote: >> >> Maybe it is also related to the problem i mentioned a few days ago? It >> does >>> sound kind of similar to what i demo in the video here: >>> >>> https://webmshare.com/q78rb >>> >> >> It certainly looks like it. >> >> >> Maybe, but on Mint cinnamon, one time that the form is resized to default >> size, it's not resized anymore. > > I have been experimenting, and the 'default' size depends on what controls > are present in the form and what their sizes are. So that definitely > smells of the lazarus LCL layouting algorithms... Probably gtk2 sends some garbled size messages. I cannot reproduce such thing with qtlcl (tried under windowmaker too, as it is mentioned in link)

How can I investigate this ?
Where can/should I put some writelns to see what is happening ?

I don't mind helping out, but I need some pointers where to start.

Michael.

Reply by email

zeljko
to Michael Van Canneyt
Michael Van Canneyt wrote 5 lines
How can I investigate this ? Where can/should I put some writelns to see what is happening ? I don't mind helping out, but I need some pointers where to start.

Gtk2WSForms.pp , line 168 see my comment about it. Seem that it's your problem (my comment is about Mint16 WM + compositing). Can you see if your wm name fits into
if (Copy(Gtk2WidgetSet.GetWindowManager,1,6) = 'mutter') then ... Just put writeln('WM=',Gtk2WidgetSet.GetWindowManager) above that statement.

zeljko

Reply by email

Michael Van Canneyt
to zeljko
zeljko wrote 13 lines
On 08.05.2017 15:51, Michael Van Canneyt wrote: > > How can I investigate this ? Where can/should I put some writelns to see > what is happening ? > > I don't mind helping out, but I need some pointers where to start. Gtk2WSForms.pp , line 168 see my comment about it. Seem that it's your problem (my comment is about Mint16 WM + compositing). Can you see if your wm name fits into if (Copy(Gtk2WidgetSet.GetWindowManager,1,6) = 'mutter') then ... Just put writeln('WM=',Gtk2WidgetSet.GetWindowManager) above that statement.

I did that. I added a print of the GDK geometry.

gdk geometry : 10,33,320,240
Warning: GDK_CONFIGURE: Designed form is misconfigured because of bad compositing manager (see issue #25473). Warning: GDK_CONFIGURE: Fixing problem by setting current LCL values l=655,t=220,r=1152,b=461 WM=mutter (muffin)
gdk geometry : 10,33,320,240

At the following point I clicked the TLAbel button on the component palette, and the form was again resized to something 'too small':

WM=mutter (muffin)
gdk geometry : 10,33,497,241
AddComponent TLabel Parent=ReportPropertiesForm:TReportPropertiesForm 38,140,0,0 Parent is 'ReportPropertiesForm:TReportPropertiesForm' TObjectInspectorDlg.FillPersistentComboBox: Updating ComboBox with components WM=mutter (muffin)
gdk geometry : 10,33,320,241
WM=mutter (muffin)
gdk geometry : 10,33,320,240

The X,Y are of course completely bogus.

After this, I disabled compositing in Mint, and the situation is slightly better. Now the window doesn't resize so much any more, but it still resizes.

So the "if Gtk2WidgetSet.compositeManagerRunning then" can be removed in fact.

Anything else I can do ? (except dumping linux mint, obviously...)

Michael.

Reply by email

Ondrej Pokorny
to Michael Van Canneyt
Michael Van Canneyt wrote
Anything else I can do ? (except dumping linux mint, obviously...)

Maybe this is an option for you until it gets properly fixed: you could build the IDE for Qt. (You can still develop your own applications for Gtk2 even if the IDE is built for Qt.)

Ondrej

Reply by email

Michael Van Canneyt
to Ondrej Pokorny
Ondrej Pokorny wrote 6 lines
On 16.05.2017 20:44, Michael Van Canneyt via Lazarus wrote: > Anything else I can do ? (except dumping linux mint, obviously...) Maybe this is an option for you until it gets properly fixed: you could build the IDE for Qt. (You can still develop your own applications for Gtk2 even if the IDE is built for Qt.)

I think that is a bad tactical move. It's better to keep nagging if you want things to get fixed sooner than later ;)

What I don't get is:

Why don't other programs in linux mint seem to have problems with this ? Surely, if the situation is that bad, then things would have been fixed a long time ago, no ?

Michael.

Reply by email

Ondrej Pokorny
to Michael Van Canneyt
Michael Van Canneyt wrote
Surely, if the situation is that bad, then things would have been fixed a long time ago, no ?

IIRC people complained about Gtk2 resizing their windows under some window managers for several years. If I am not mistaken nobody really tried to fix it.

Ondrej

Reply by email

zeljko
to Michael Van Canneyt: I think that is a bad tactical move. It's better to keep nagging if you want things to…
Michael Van Canneyt wrote 5 lines
What I don't get is: Why don't other programs in linux mint seem to have problems with this ? Surely, if the situation is that bad, then things would have been fixed a long time ago, no ?

Just because other gtk2 programs on linux are mostly C (or whatever, but they aren't lcl based), and such programs use gtk2 "as is", without tricks to get gtk2 delphi (lcl) compatibile in case of events and order of events.

zeljko

Reply by email

zeljko
to Ondrej Pokorny: IIRC people complained about Gtk2 resizing their windows under some window managers for…
Ondrej Pokorny wrote 7 lines
On 16.05.2017 21:08, Michael Van Canneyt via Lazarus wrote: > Surely, if the situation is that bad, then things would have been fixed a > long time ago, no ? IIRC people complained about Gtk2 resizing their windows under some window managers for several years. If I am not mistaken nobody really tried to fix it.

Problem is not in fixing. When you fix eg this one which is Michael talking about, next year you'll have new one - as soon as new version of wm thinks that something can work in another way :)

zeljko

Reply by email

Graeme Geldenhuys
to Ondrej Pokorny: Maybe this is an option for you until it gets properly fixed: you could build the IDE for…
Ondrej Pokorny wrote
> Anything else I can do ? (except dumping linux mint, obviously...) Maybe this is an option for you until it gets properly fixed:

I agree with Michael... Dumping your OS of choice is not a solution. I would rather nag until the bug is fixed. ;-)

@Michael:
You could always try JWM (Joe's Window Manager). Thus you keep your OS of choice, just don't use Gnome as desktop environment, but rather a good old-school style Window Manager instead. JWM is extremely light weight (only uses 8MB of RAM), is really simple to even compile from the command line (though most distros should have it in there package managers). Configuration is via a simple XML file. It has a built-it taskbar, virtual desktops, "start menu" anywhere when you click on the desktop background etc.

I've used JWM for years, even under Ubuntu Linux (now using FreeBSD), and it has never failed or disappointed me.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email