[Lazarus] Gtk3 high resolution issues on Linux

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Gtk3 high resolution issues on Linux

Free Pascal - Lazarus mailing list
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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Gtk3 high resolution issues on Linux

Free Pascal - Lazarus mailing list
On Mon, Dec 9, 2019 at 4:29 PM Ryan Joseph via lazarus
<[hidden email]> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Gtk3 high resolution issues on Linux

Free Pascal - Lazarus mailing list
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 <[hidden email]> wrote:
>
> How does it behave with GTK2?

Regards,
        Ryan Joseph

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Gtk3 high resolution issues on Linux

Free Pascal - Lazarus mailing list
On Mon, Dec 9, 2019 at 7:48 PM Ryan Joseph via lazarus
<[hidden email]> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Gtk3 high resolution issues on Linux

Free Pascal - Lazarus mailing list


> On Dec 9, 2019, at 1:08 PM, Juha Manninen via lazarus <[hidden email]> 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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Gtk3 high resolution issues on Linux

Free Pascal - Lazarus mailing list


> On Dec 9, 2019, at 1:29 PM, Ryan Joseph <[hidden email]> 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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Gtk3 high resolution issues on Linux

Free Pascal - Lazarus mailing list


> On Dec 11, 2019, at 2:28 PM, Ryan Joseph <[hidden email]> 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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus