Sign in Join

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

Mailing lists / lazarus / 2019-12

Gtk3 high resolution issues on Linux

7 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Ryan Joseph

I'm implementing the OpenGL control for Gtk3/Linux and noticed that on high resolution display the widgets are all scaled wrong. Is this a known bug with the Gtk3 widget? I have very limited Lazarus experience so I may be overlooking something simple.

If it is something which is just not implemented correctly does anyone have any ideas of why it's doing this? Since I'm working on the OpenGL control I could try fixing the high-res scaling also.

Regards,
Ryan Joseph

Reply by email

Juha Manninen
to Ryan Joseph
PM Ryan Joseph wrote
I'm implementing the OpenGL control for Gtk3/Linux and noticed that on high resolution display the widgets are all scaled wrong. Is this a known bug with the Gtk3 widget? I have very limited Lazarus experience so I may be overlooking something simple. If it is something which is just not implemented correctly does anyone have any ideas of why it's doing this? Since I'm working on the OpenGL control I could try fixing the high-res scaling also.

How does it behave with GTK2?

Juha

Reply by email

Ryan Joseph
to Juha Manninen

no problems on gtk2. Is this a known issue on gtk3? I'm just starting from a basic application with a form and single button. The window size and the button size is wrong.

On Dec 9, 2019, at 10:05 AM, Juha Manninen via lazarus wrote: How does it behave with GTK2?

Regards,
Ryan Joseph

Reply by email

Juha Manninen
to Ryan Joseph
PM Ryan Joseph wrote
no problems on gtk2. Is this a known issue on gtk3? I'm just starting from a basic application with a form and single button. The window size and the button size is wrong.

LCL-GTK3 is still alpha. I guess it is just not implemented yet. LCL-GTK2 can be studied for inspiration but direct copy-paste may not work and it is a bad idea anyways. The code has left-overs from the original GTK1 history.
LCL-GTK3 is a new clean implementation with some new design principals. Sorry I cannot help you more. The author Zeljko should be able to answer detailed questions.

Juha

Reply by email

Ryan Joseph
to Juha Manninen
Show quoted text 9 lines
On Dec 9, 2019, at 1:08 PM, Juha Manninen via lazarus wrote: LCL-GTK3 is still alpha. I guess it is just not implemented yet. LCL-GTK2 can be studied for inspiration but direct copy-paste may not work and it is a bad idea anyways. The code has left-overs from the original GTK1 history. LCL-GTK3 is a new clean implementation with some new design principals. Sorry I cannot help you more. The author Zeljko should be able to answer detailed questions.

Thanks, it's helpful just to know what I'm not doing something wrong. I'll keep searching around in the debugger until I figure out why this is happening.

Regards,
Ryan Joseph

Reply by email

Ryan Joseph
to Ryan Joseph
On Dec 9, 2019, at 1:29 PM, Ryan Joseph wrote: Thanks, it's helpful just to know what I'm not doing something wrong. I'll keep searching around in the debugger until I figure out why this is happening.

After much time in the debugger I found out that GTK3 needs to multiple the screen by the scale factor (2 for high-res) and this fixes the problem. Yay! but now I see that GTK3 controls sizes are mostly all wrong anyways (not related to high res even). :(

Is this known to Lazarus? I'm testing GTK3 in C now and it doesn't even seem possible to make a button smaller than 34 pixels. I'm going to keep working at it but until this is fixed GTK3 widgets are basically broken unless it is your only targeted widget set across all platforms.

Regards,
Ryan Joseph

Reply by email

Ryan Joseph
to Ryan Joseph
On Dec 11, 2019, at 2:28 PM, Ryan Joseph wrote: Is this known to Lazarus? I'm testing GTK3 in C now and it doesn't even seem possible to make a button smaller than 34 pixels. I'm going to keep working at it but until this is fixed GTK3 widgets are basically broken unless it is your only targeted widget set across all platforms.

I discovered that new CSS needs to be applied for GTK3 so widgets maintain the same size across different widget sets but is this safe? I don't know much about Linux but I'm curious if users change the system theme these settings will be overridden and change the size of all the controls. Maybe it doesn't matter though because unless we change the default CSS a button you request at 75x25 pixels will always be 75x34 and that can't be an acceptable solution.

Regards,
Ryan Joseph

Reply by email