Skip to content

Commit e45ad4b

Browse files
committed
Switch from G_APPLICATION_FLAGS_NONE to G_APPLICATION_DEFAULT_FLAGS (with polyfill for old glib)
1 parent 4b0d621 commit e45ad4b

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

examples/demo/gtk-layer-demo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ main (int argc, char **argv)
419419
g_cclosure_marshal_VOID__INT,
420420
G_TYPE_NONE, 1, G_TYPE_INT);
421421

422-
GtkApplication * app = gtk_application_new ("com.github.wmww.gtk4-layer-shell.demo", G_APPLICATION_FLAGS_NONE);
422+
GtkApplication * app = gtk_application_new ("com.github.wmww.gtk4-layer-shell.demo", G_APPLICATION_DEFAULT_FLAGS);
423423
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
424424
int status = g_application_run (G_APPLICATION (app), argc, argv);
425425
g_object_unref (app);

examples/simple-example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ activate (GtkApplication* app, void *_data)
4848
int
4949
main (int argc, char **argv)
5050
{
51-
GtkApplication * app = gtk_application_new ("com.github.wmww.gtk4-layer-shell.example", G_APPLICATION_FLAGS_NONE);
51+
GtkApplication * app = gtk_application_new ("com.github.wmww.gtk4-layer-shell.example", G_APPLICATION_DEFAULT_FLAGS);
5252
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
5353
int status = g_application_run (G_APPLICATION (app), argc, argv);
5454
g_object_unref (app);

examples/simple-example.vala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using GtkLayerShell;
44
int main(string[] argv) {
55
var app = new Gtk.Application (
66
"com.github.wmww.gtk4-layer-shell.vala-example",
7-
GLib.ApplicationFlags.FLAGS_NONE);
7+
GLib.ApplicationFlags.DEFAULT_FLAGS);
88

99
app.activate.connect (() => {
1010
var window = new Gtk.ApplicationWindow (app);

meson.build

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ add_project_arguments(
1515
],
1616
language: 'c')
1717

18+
glib = dependency('glib-2.0', required: true) # Just needed for version check
19+
if glib.version().version_compare('<2.74')
20+
add_project_arguments('-DG_APPLICATION_DEFAULT_FLAGS=G_APPLICATION_FLAGS_NONE', language: 'c')
21+
endif
22+
1823
gtk = dependency('gtk4')
1924
wayland_client = dependency('wayland-client', version: '>=1.10.0')
2025

0 commit comments

Comments
 (0)