Copy paste latest OSD code from mate-settings-daemon
Improve GTK3 support