C code presumes that notify::skip-taskbar signal is emitted only if the property has changed
Affected version
Gnome Shell 3.35.90 and before
Bug summary
This is the code in shell-app.c that manages notify::skip-taskbar
:
/* we rely on MetaWindow:skip-taskbar only being notified
* when it actually changes; when that assumption breaks,
* we'll have to track the "interesting" windows themselves
*/
if (meta_window_is_skip_taskbar (window))
app->running_state->interesting_windows--;
else
app->running_state->interesting_windows++;
This piece of code presumes that the signal is emitted only if the property has really changed. This means that sending that notification without changing that property will result in an incorrect value of app->running_state->interesting_windows
.
This is a problem in a system designed to interact with JavaScript and other dynamic languages, because the programmer can overwrite the skip_taskbar property to put another value, but since that value would be visible only in the dynamic language, but the notify::skip_taskbar would be sent to both C and dynamic language, Gnome Shell would fail.
Steps to reproduce
From an extension in JavaScript, link to the notify::map
signal and there call to a function which executes over any new window this piece of code:
window.notify('skip-taskbar');
What happened
After doing this to two windows, Gnome Shell closes.
What did you expect to happen
To keep it working fine.