How to avoid "Duplicate call with different values"?

Hello,

Recently spotted on gtk-4.23, the first click on any menu-item causes the following warning: “Duplicate call with different values”. To rule out an issue with my own code, tried it with gnome-calculator and got the same warning like “(gnome-calculator:10165): Gdk-WARNING **: 15:52:05.152: Duplicate call with different values.” at the first menu click.

GTK has no warning message containing those words.

You may want to use export G_LOG_FATAL=warnings to turn every warning into a fatal error, and then run your application under GDB, to catch a backtrace that details where, exactly, that call is coming from.

GTK has no warning message containing those words.

% git grep 'Duplicate call with different values' 4.23.2
4.23.2:gdk/gdkframeclock.c:            g_warning_once ("Duplicate call with different values.");
4.23.2:gdk/gdkframeclock.c:            g_warning_once ("Duplicate call with different values.");

On a HEAD (current 904b21fb) it looks like replaced with “Duplicate call to ..”

% git grep 'Duplicate call to' HEAD
HEAD:gdk/gdkframetimings.c:            g_warning_once ("Duplicate call to gdk_frame_timings_submitted() with different values.");
HEAD:gdk/gdkframetimings.c:            g_warning_once ("Duplicate call to gdk_frame_timings_presented() with different values.");

Ah, that’s why I couldn’t find it. :sweat_smile:

If you can write a small, self-contained reproducer, or you see the same warning with gtk4-demo, please open an issue in the GTK project issue tracker.

If you can write a small, self-contained reproducer …

There’s no need to write some own reproducer, at least there’s already one mentioned above: gnome-calculator.

How to reproduce it on 4.23.2 (spotted on current GnomeOS): call it in terminal (for example gnome-calculator) and click on icon menu (hamburger button).

You should still write it.

The point about a small, self-contained reproducer is to make it easier to figure the issue out.

Writing a reproducer helps with finding the exact circumstances that causes the bug. And debugging and modifying this code to resolve the bug will be easier with a small codebase, rather than an complex application.

You should still write it

You can also opt for an official tool like gtk4-demo which provides a clean, self-contained environment and reference code.

(gtk4-demo:2574): Gdk-WARNING **: 13:14:31.142: Duplicate call with different values.

Yes, if it reproduces with gtk4-demo it’s fine.

Please open an issue on the GTK issue tracker.