frang75 / nappgui_src

SDK for building cross-platform desktop apps in ANSI-C
https://www.nappgui.com
MIT License
506 stars 50 forks source link

GTK3 Window dimensions with Wayland #23

Open frang75 opened 2 years ago

frang75 commented 2 years ago

The final size of NAppGUI Window in GTK is made in: https://github.com/frang75/nappgui_src/blob/main/src/osgui/gtk3/oswindow.c line 772, calling to gtk_widget_set_size_request(window->control.widget, (gint)width, (gint)height);

The width and height values have been calculated by NAppGUI compositor.

With Wayland backend, the window is sized slightly smaller than the width and height values. Specifically, 50 pixels less in width and 89 pixels less in height. With x11 backend the window is sized correctly.

Study the case to determine if anything can be done within the NAppGUI code to make this work correctly in Wayland. Obviously, using width + 50, height + 89 if we detect the Wayland backend seems to solve the problem.

At the moment, NAppGUI forces to use X11 as GDK_BACKEND in hopes of solving this problem.

hello_gtk3

dice_gtk3

drawhello_gtk3

urlimg_gtk3

guihello_gtk3

Tim-Paik commented 2 years ago

If it is indeed exactly 50 and 89 pixels, I would prefer this to be an upstream issue, maybe open an issue to gtk3?