wmww / gtk4-layer-shell

A library to create panels and other desktop components for Wayland using the Layer Shell protocol and GTK4
MIT License
128 stars 4 forks source link

Some deprecation warnings during compile #7

Closed Consolatis closed 1 year ago

Consolatis commented 1 year ago

Just had a quick try and everything seems to work fine so far. Didn't get into the nitty-gritty details like context menu workspace size constraining and similar yet.

This is just a compile time warning but I thought it might be worth to point out:

[12/26] Compiling C object examples/gtk4-layer-demo.p/demo_gtk-layer-demo.c.o
../examples/demo/gtk-layer-demo.c: In function ‘main’:
../examples/demo/gtk-layer-demo.c:422:5: warning: ‘G_APPLICATION_FLAGS_NONE’ is deprecated: Use 'G_APPLICATION_DEFAULT_FLAGS' instead [-Wdeprecated-declarations]
  422 |     GtkApplication * app = gtk_application_new ("com.github.wmww.gtk4-layer-shell.demo", G_APPLICATION_FLAGS_NONE);
      |     ^~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/gio/giotypes.h:30,
                 from /usr/include/glib-2.0/gio/gio.h:28,
                 from /usr/include/gtk-4.0/gtk/css/gtkcsssection.h:25,
                 from /usr/include/gtk-4.0/gtk/css/gtkcss.h:37,
                 from /usr/include/gtk-4.0/gtk/gtk.h:30,
                 from ../include/gtk4-layer-shell.h:4,
                 from ../examples/demo/gtk-layer-demo.h:4,
                 from ../examples/demo/gtk-layer-demo.c:1:
/usr/include/glib-2.0/gio/gioenums.h:1536:3: note: declared here
 1536 |   G_APPLICATION_FLAGS_NONE GLIB_DEPRECATED_ENUMERATOR_IN_2_74_FOR(G_APPLICATION_DEFAULT_FLAGS),
      |   ^~~~~~~~~~~~~~~~~~~~~~~~
[22/26] Compiling C object examples/simple-example-c.p/simple-example.c.o
../examples/simple-example.c: In function ‘main’:
../examples/simple-example.c:51:5: warning: ‘G_APPLICATION_FLAGS_NONE’ is deprecated: Use 'G_APPLICATION_DEFAULT_FLAGS' instead [-Wdeprecated-declarations]
   51 |     GtkApplication * app = gtk_application_new ("com.github.wmww.gtk4-layer-shell.example", G_APPLICATION_FLAGS_NONE);
      |     ^~~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/gio/giotypes.h:30,
                 from /usr/include/glib-2.0/gio/gio.h:28,
                 from /usr/include/gtk-4.0/gtk/css/gtkcsssection.h:25,
                 from /usr/include/gtk-4.0/gtk/css/gtkcss.h:37,
                 from /usr/include/gtk-4.0/gtk/gtk.h:30,
                 from ../include/gtk4-layer-shell.h:4,
                 from ../examples/simple-example.c:1:
/usr/include/glib-2.0/gio/gioenums.h:1536:3: note: declared here
 1536 |   G_APPLICATION_FLAGS_NONE GLIB_DEPRECATED_ENUMERATOR_IN_2_74_FOR(G_APPLICATION_DEFAULT_FLAGS),
      |   ^~~~~~~~~~~~~~~~~~~~~~~~

And one more from meson itself:

NOTICE: Future-deprecated features used:
 * 0.56.0: {'dependency.get_pkgconfig_variable'

Another one from wayland-scanner (I suppose):

[2/26] Generating 'src/libgtk4-layer-shell.so.1.0.0.p/wlr-layer-shell-unstable-v1.c'.
Using "code" is deprecated - use private-code or public-code.
See the help page for details.
[3/26] Generating 'src/libgtk4-layer-shell.so.1.0.0.p/xdg-shell.c'.
Using "code" is deprecated - use private-code or public-code.
See the help page for details

Edit:

Didn't get into the nitty-gritty details like context menu workspace size constraining and similar yet.

This seems fixed, at least dropdowns and popover menus now end at the bottom of the screen and allow scrolling to reach the remaining items.

wmww commented 1 year ago

Can't do anything about G_APPLICATION_FLAGS_NONE since Ubuntu 22.04 doesn't support G_APPLICATION_DEFAULT_FLAGS.

Consolatis commented 1 year ago

Can't do anything about G_APPLICATION_FLAGS_NONE since Ubuntu 22.04 doesn't support G_APPLICATION_DEFAULT_FLAGS.

Well, guess then we will have to live with the warnings. Another option could be a #if within the examples which checks for the GTK version and then uses one or the other.