Simplify GTK+ 2 version checks with a helper function
Use wx_is_at_least_gtk2(minor) instead of gtk_check_version(2, minor) because it is more clear and also works as expected (i.e. returns true) when using GTK+ 3 instead of creating difficult to notice bugs in the code by failing the version check in this case. See #18004.
This commit is contained in:
@@ -185,7 +185,7 @@ wxTaskBarIcon::Private::~Private()
|
||||
void wxTaskBarIcon::Private::SetIcon()
|
||||
{
|
||||
#if GTK_CHECK_VERSION(2,10,0)
|
||||
if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,10,0) == NULL)
|
||||
if (wx_is_at_least_gtk2(10))
|
||||
{
|
||||
if (m_statusIcon)
|
||||
gtk_status_icon_set_from_pixbuf(m_statusIcon, m_bitmap.GetPixbuf());
|
||||
@@ -235,7 +235,7 @@ void wxTaskBarIcon::Private::SetIcon()
|
||||
if (m_statusIcon)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(2,16,0)
|
||||
if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,16,0) == NULL)
|
||||
if (wx_is_at_least_gtk2(16))
|
||||
gtk_status_icon_set_tooltip_text(m_statusIcon, tip_text);
|
||||
else
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user