-
Notifications
You must be signed in to change notification settings - Fork 187
[win32] Adapt/copy all handles on Image copy #2107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[win32] Adapt/copy all handles on Image copy #2107
Conversation
HeikoKlare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks sound. Just wondering if it is possible and would make sense to move the handle copy logic to the ImageHandle class? I.e., having an ImageHandle::copy operation or the like to extract the rather complex functionaltiy from the constructor?
Test Results 539 files - 6 539 suites - 6 30m 24s ⏱️ - 1m 38s For more details on these failures, see this check. Results for commit 570f321. ± Comparison against base commit 44f0d56. This pull request removes 37 tests.♻️ This comment has been updated with latest results. |
Sure, we could. Only argument from my side against it would be that it is just not used anywhere else. But I would be fine with both. |
That's true. But wouldn't you say it's more a concern of an ImageHandle to implement how it has to be copied rather than the concern of a consumer (in this case the Image constructor requiring a copy of the handle)? I always found that Image constructor rather complex and now that it is refactored to obviously copy multiple handles it seems quite natural to me to have than be encapsulated in the ImageHandle. |
fedejeanne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look fine, I'm just missing some way to test it more "heavily". By playing around with the Runtime Workspace Eclipse Application, I only seem to navigate the case SWT.IMAGE_DISABLE but not the other ones. @akoch-yatta do you have any Snippet or use case that tests the other cases in the switch?
I have no strong opinion regarding whether or not the code should be moved to ImageHandle so it's your call :-)
908104f to
4aad30f
Compare
This commit adapts and copies all handles in the copy constructor in Image. As each image now manages possibly more than one OS handles at the same time in the windows implementation, it is important to apply the operation on all of them.
4aad30f to
570f321
Compare
HeikoKlare
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the case distinction for bitmap/icon would need to be replaced in the ImageHandle copy and in the Image constructor, let's keep it like it is for now.
Failing test is unrelated: #1843
This PR adapts and copies all handles in the copy constructor in Image. As each image now manages possibly more than one OS handles at the same time in the windows implementation, it is important to apply the operation on all of them.