gtk+3: fix compilation on pre-10.7

Closes #33664.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>