-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Qt: Remove unnecessary image buffer for Mac dock icon #13561
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
Conversation
Discussion about minimum Qt5 version in #13478. utACK ec16f4a. |
Build error:
|
This would be a nice to have cleanup/simplification. I've tested on macOS 10.13.5, building with Qt 5.11.1: However, there are a couple issues: This PR isn't the place to discuss it, but I'm currently Concept NACK on adding per platform Qt minimums. I'll continue that discussion in #13478. As pointed out above, the macOS Travis build is currently failing. I've verified locally using a native depends build:
The issue is that we aren't currently including macExtras with qt in depends, so if we want to do this our qt package will need to be updated. Also, if this change is going to force the macOS Qt minimum to be 5.2, can you drop this Qt VESION check: bitcoin/src/qt/macdockiconhandler.mm Line 53 in a6ed99a
|
@fanquake - Thanks. Was looking into the Qt package when you commented. I'll pick up the conversation at 13478 and update this PR as necessary. |
Concept ACK |
@droark Have you had a chance to follow up here? |
@fanquake - Hi. I started working on some depends stuff and then got distracted. I'll pick it up ASAP. I'll see if I can optimize any more Mac-specific code but that might take a little longer. In the meantime, I've rebased. |
That's acceptable. |
@droark Are you planning on continuing this? Otherwise II'll label as "Up for Grabs". \ The 5.2 requirement is no longer an issue, as master currently requires >5.4 anyways. The plan for 0.18 will likely be a minimum required version above 5.2 regardless. |
@fanquake - Yes, I'm still on it. I was just waiting to see what was decided regarding Qt (i.e., 5.4 minimum). I'll rebase it right now and look into the failures from there. |
The code curently writes the Mac dock icon to a buffer and then sets the final image data from the buffer. This was presumably done to satisfy Qt 4. Now that Qt 5 is mandatory, remove the buffer and write the data directly to the image. Note that this patch will force the bitcoin-qt binary to have a minimum of Qt 5.2 on Macs due to usage of QtMacExtras (https://wiki.qt.io/New_Features_in_Qt_5.2). While this needs to be discussed before accepting the patch, Qt 5.2 is almost five years old. It's arguable that a Mac with Qt 5 but staying below 5.2 is an improbable corner case.
Cross-compiling for platform-specific Qt extras may not be possible. Work around by copying the code from QtMac::toNSImage() and modifying as necessary. A redundant Qt version check was also removed.
Added a new commit that incorporated feedback. I also removed QtMacExtras. As best I can tell, trying to cross-compile Qt "extras" packages isn't a good idea. I did an end-run by just copying the code for QtMac::toNSImage() and modifying as necessary. |
Hmmm. Still getting an error when cross-compiling. In particular, toCGImage() still requires QtMacExtras, and the underlying code seems to tap into a private Qt API that we have no business using. (Besides, it fails as-is.) This PR may need some rethinking. Anybody have any ideas? The cleanest thing to do would be to cross-compile QtMacExtras. I'm just not sure it's doable, or sane if it is doable. If not, this PR will probably have to be withdrawn, or radically reworked. The current method, while inefficient, manages to avoid extraneous Mac-specific libraries. |
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
@DrahtBot - Thanks. I'll look at that PR more closely. At a glance, it should be a cleaner merge, so I'll probably work around that one (assuming my PR can be salvaged, per my posts above). |
@droark Given that #14597 removes the entire |
The code curently writes the Mac dock icon to a buffer and then sets the final image data from the buffer. This was presumably done to satisfy Qt 4. Now that Qt 5 is mandatory, remove the buffer and write the data directly to the image.
Note that this patch will force the bitcoin-qt binary to have a minimum of Qt 5.2 on Macs due to usage of QtMacExtras (https://wiki.qt.io/New_Features_in_Qt_5.2). While this needs to be discussed before accepting the patch, Qt 5.2 is almost five years old. It's arguable that a Mac with Qt 5 but staying below 5.2 is an improbable corner case.