OSX make iOS and macOS share more drawing code (PR #25860)

15 views
Skip to first unread message

Stefan Csomor

unread,
Oct 5, 2025, 12:17:50 PM (17 hours ago) Oct 5
to wx-...@googlegroups.com, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/25860

Commit Summary

  • e073d8d fix for wxRegionGeneric behavior
  • e21d727 fixing icon sizes on iOS
  • 0c6e9d7 have an availability macro for iOS code as well
  • 3d38cfe make macOS and iOS share more image drawing code
  • 007a2c6 add native artprovider for macOS and iOS
  • dc7ab21 have system color closer to macOS

File Changes

(8 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25860@github.com>

VZ

unread,
Oct 5, 2025, 1:07:37 PM (17 hours ago) Oct 5
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.


In src/generic/regiong.cpp:

> @@ -375,7 +375,9 @@ bool wxRegionGeneric::DoOffset(wxCoord x, wxCoord y)
 
 bool wxRegionGeneric::IsEmpty() const
 {
-    wxASSERT(m_refData);
+    if ( m_refData == nullptr )

Do we really want to do this? I think invalid and empty regions are not the same thing, just as transparent and invalid pens/brushes, for example.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25860/review/3302467292@github.com>

Stefan Csomor

unread,
Oct 5, 2025, 2:52:16 PM (15 hours ago) Oct 5
to wx-...@googlegroups.com, Subscribed

@csomor commented on this pull request.


In src/generic/regiong.cpp:

> @@ -375,7 +375,9 @@ bool wxRegionGeneric::DoOffset(wxCoord x, wxCoord y)
 
 bool wxRegionGeneric::IsEmpty() const
 {
-    wxASSERT(m_refData);
+    if ( m_refData == nullptr )

Sorry, I wrote this twice as I've somehow managed to loose a set of commits, the reason behind it is the documented behavior:

https://docs.wxwidgets.org/3.3/classwx_region.html#a1edc6768118cf02749b46774a0ca37f9

a freshly created wxRegion is invalid but also empty

and apparently other platforms behave like this, already, I just ran into an assertion when setting the background color on a wxFrame on iOS, which doesn't have a native region class.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25860/review/3302500617@github.com>

VZ

unread,
Oct 5, 2025, 4:08:49 PM (14 hours ago) Oct 5
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.


In src/generic/regiong.cpp:

> @@ -375,7 +375,9 @@ bool wxRegionGeneric::DoOffset(wxCoord x, wxCoord y)
 
 bool wxRegionGeneric::IsEmpty() const
 {
-    wxASSERT(m_refData);
+    if ( m_refData == nullptr )

Ha, I had even added this comment to the docs myself back in dd4eefc (Document and test behaviour of wxRegion methods when it is invalid., 2011-10-18) but, of course, completely forgot about it. And, as the commit says, there is even a unit test ("wxRegion::Validity") checking for this, so this would have been discovered if we ran unit tests under iOS...

Anyhow, sorry, for not checking this first.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25860/review/3302523698@github.com>

Stefan Csomor

unread,
Oct 5, 2025, 4:12:21 PM (14 hours ago) Oct 5
to wx-...@googlegroups.com, Subscribed

@csomor commented on this pull request.


In src/generic/regiong.cpp:

> @@ -375,7 +375,9 @@ bool wxRegionGeneric::DoOffset(wxCoord x, wxCoord y)
 
 bool wxRegionGeneric::IsEmpty() const
 {
-    wxASSERT(m_refData);
+    if ( m_refData == nullptr )

no problem, I really appreciate you looking at things closely


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25860/review/3302524867@github.com>

Reply all
Reply to author
Forward
0 new messages