You are not logged in.

#1 2020-12-22 20:00:32

vonNeumannStability
Member
Registered: 2020-12-22
Posts: 15

[SOLVED] Annoying beeping sound after executing GTK+3.0 program

Hello everybody,

I am running a simple program in GTK+3.0 that pops up a window on the screen. An annoying beeping sounds comes out whenever I run the program.

After reading this wiki:

PC Speaker

I tried the following solutions:

1.1. Disable speaker globally by both running the

# echo "blacklist pcspkr" | tee /etc/modprobe.d/nobeep.conf

command to blacklist the PC Speaker and after trying this out, I tried to run

# rmmod pcspkr

and I got the message saying that

Module pcspkr is not currently loaded

so the unloading worked, but after rebooting I still can hear the beeping sound.

1.2 I also tried to uncomment

set bell-style none 

but still not working. I cannot run

 setterm -blength 0

because it does not seem to be compatible with my terminal (st terminal).

Then I thought, that since I only get this problem from GTK I should add the file

~/.config/gtk-3.0/settings.ini

and the line stated here GTK Config but I get

Gtk-WARNING **: 20:56:20.098: Failed to parse /home/vonNeumannStability/.config/gtk-3.0/settings.ini: Key file does not start with a group

My question is: how can I disable the beeping noise at running the GTK program I created without having to add something in the code of my program ? Is there a more general solution ? I understand I might be missing any GTK-3.0 config file, but I don't seem to find any either.

Thank you very much for your time.

Last edited by vonNeumannStability (2020-12-22 20:54:18)

Offline

#2 2020-12-22 20:12:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,883

Re: [SOLVED] Annoying beeping sound after executing GTK+3.0 program

The error message from settings.ini seems pretty clear, what are the contents of that file?

Offline

#3 2020-12-22 20:19:09

vonNeumannStability
Member
Registered: 2020-12-22
Posts: 15

Re: [SOLVED] Annoying beeping sound after executing GTK+3.0 program

V1del wrote:

The error message from settings.ini seems pretty clear, what are the contents of that file?

Hi,

I created that file because /gtk-3.0/ was empty. The contents of the file are

gtk-error-bell = 0

Even if I put the whole line

[Settings]
gtk-error-bell = 0

as suggested by the wiki, I see no result and the beeping keeps popping.

Thanks.

Offline

#4 2020-12-22 20:26:28

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,883

Re: [SOLVED] Annoying beeping sound after executing GTK+3.0 program

Well the first variant is wrong and will break and the second one should be parsed correctly.

Maybe it'd help if you disclosed what you are doing exactly, maybe even post a reproducer code. Like are you sure it's the error bell you are hearing here?

Offline

#5 2020-12-22 20:32:47

vonNeumannStability
Member
Registered: 2020-12-22
Posts: 15

Re: [SOLVED] Annoying beeping sound after executing GTK+3.0 program

V1del wrote:

Well the first variant is wrong and will break and the second one should be parsed correctly.

Maybe it'd help if you disclosed what you are doing exactly, maybe even post a reproducer code. Like are you sure it's the error bell you are hearing here?

Hi,

sure. This beep pops up even with a simple "hello world" using GTK from here: https://wiki.archlinux.org/index.php/GTK/Development#C

I use exactly the same code as listed in the URL with the same building process. Basically, anytime I run a GTK program it does a beep. Since you mention the error bell I also get this message while running the code

(process:72163): Gtk-WARNING **: 21:31:58.350: Locale not supported by C library.
        Using the fallback 'C' locale.

But the program seems to run correctly (at least graphically).

EDIT

I have solved the locale problem (which it was maybe sloppy of me to have ignored it). But the beeping still pops, which tells that it does not correspond to the WARNING message previously written.

Last edited by vonNeumannStability (2020-12-22 20:37:56)

Offline

#6 2020-12-22 20:52:50

vonNeumannStability
Member
Registered: 2020-12-22
Posts: 15

Re: [SOLVED] Annoying beeping sound after executing GTK+3.0 program

I found a workaround.

I disabled the system sounds using pavucontrol on the Playback tab. This naturally turned off GTK beeps.

Thanks V1del for your answers.

Offline

#7 2020-12-22 20:56:59

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,883

Re: [SOLVED] Annoying beeping sound after executing GTK+3.0 program

Well yes but that's technically a workaround, what I think you actually want is set gtk-enable-event-sounds = 0  in that settings ini: https://developer.gnome.org/gtk3/stable … ent-sounds

Offline

#8 2020-12-22 21:05:14

vonNeumannStability
Member
Registered: 2020-12-22
Posts: 15

Re: [SOLVED] Annoying beeping sound after executing GTK+3.0 program

V1del wrote:

Well yes but that's technically a workaround, what I think you actually want is set gtk-enable-event-sounds = 0  in that settings ini: https://developer.gnome.org/gtk3/stable … ent-sounds

It was exactly that. I turned the system sounds on again and rewrote the settings.ini file. It looks now like this:

[Settings]
gtk-enable-event-sounds = 0

And the beep disappears.

This is the correct solution. Thanks again.

Offline

Board footer

Powered by FluxBB