-
Notifications
You must be signed in to change notification settings - Fork 102
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
packaging: dexc-desktop packaging for Darwin #2333
packaging: dexc-desktop packaging for Darwin #2333
Conversation
# signs the dmg file given to it as an argument. | ||
function sign() { | ||
if [[ -n "${SIGNATURE}" && "${SIGNATURE}" != "-null-" ]]; then | ||
echo "Codesign started" | ||
codesign -s "${SIGNATURE}" "$1" | ||
dmgsignaturecheck="$(codesign --verify --deep --verbose=2 --strict "$1" 2>&1 >/dev/null)" | ||
if [ $? -eq 0 ]; then | ||
echo "The disk image is now codesigned" | ||
else | ||
echo "The signature seems invalid.." | ||
exit 1 | ||
fi | ||
fi | ||
} | ||
|
||
# notarizes the dmg file given to it as an argument. | ||
function notarize() { | ||
if [[ -n "${NOTARIZE}" && "${NOTARIZE}" != "-null-" ]]; then | ||
echo "Notarization started" | ||
xcrun notarytool submit "$1" --keychain-profile "${NOTARIZE}" --wait | ||
echo "Stapling the notarization ticket" | ||
staple="$(xcrun stapler staple "$1")" | ||
if [ $? -eq 0 ]; then | ||
echo "The disk image is now notarized" | ||
else | ||
echo "$staple" | ||
echo "The notarization failed with error $?" | ||
exit 1 | ||
fi | ||
fi | ||
} |
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.
These aren't been used atm since a $99 dev account is required to get an Apple dev signature for code signing. Notarizing the dexc-desktop dmg is debatable but IMO we might not need it.
Can rebase with dexc-desktop merged. No rush though. |
e2a3f17
to
d16d1fb
Compare
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.
d16d1fb
to
627114d
Compare
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 open logs folder selector is not working.
Why don't we just include the create-dmg script in the repo and have pkg-darwin.sh call the create-dmg script? Then we can just grab any updates they make.
Did you guys try converting spaces as per my code comment: dcrdex/client/app/fileurl_darwin.go Lines 21 to 23 in c07ac71
My Mac VM is pretty much broken because it refuses to display graphics in a lot of apps, so can't test easily. |
There was no space in the resulting folder url. |
IMO, we can do with less code independently. Updates can be added if need be. |
Why would it be more code to use their script? It seems like most of this is copy-pasted from there. |
Yes, I had to use a chunk of their code since it solves the issue at hand. I thought we'd prefer a custom build flow but @chappjc can decide which is better. |
Encountered these display issues and added commits to resolve them in this PR. @martonp please confirm if you can reproduce the weird display without these changes and if these changes fix them on your device. |
When I resize the web view window on my Mac with the dev console open, it chops off the top of the page by an amount equal to the console's minimum height. This issue persists even after refreshing the page, but clicking on the resize icon at the top right corner when the dev console is closed resolves it. I haven't observed this problem on Safari or other browsers. However, this behaviour doesn't occur when resizing the window with the dev console detached. It may be considered a non-issue since we don't anticipate users resizing the web view window while the dev console is open. webview-window.mp4 |
I have no opinion on the issue. It's not clear to me what it would look like doing it the way @martonp suggests. Is it this? https://github.com/create-dmg/create-dmg |
Yes, it is. |
I'm fixing up the "Open logs folder" functionality in #2351. |
Nice, tested well on MacOS. |
I agree this can eliminate additional complexity and maintenance overhead, regardless of the amount of code involved. We can have it if the others agree on this @martonp. |
I think you should use grab the create-dmg in full, and make the adjustments in our separate script, add @martonp says. Does that work out? |
26be2ab
to
b13927c
Compare
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 UI is looking good now, however I see some other issues.
On the tray icon, when I click "Open" it is always opening a new window even if one is already open. Also if another App is in the foreground and I click the "Open", it will just create a new window behind the app that is in the foreground.
I actually think on Mac the tray icon is not the way to go. When there is an app running on mac, even if there is not a window open, it will still be displayed on the dock at the bottom of the screen. When you right click the icon at the bottom of the screen, there are usually some options. The "Open logs folder" option can go over there. It feels strange that the app is running but I see no icon on the bottom dock. Every other app is there.
I was surprised by this too, but @buck54321 makes the point that this is like making multiple tabs, which webview does not support. EDIT: Note that this is not Mac-specific behavior.
On all systems, I made my case in chat that the tray icon is pointless except when all windows are closed and it's just waiting for orders to settle or something. On this note, I still don't like that closing the "last window" should terminate the singular dex process running On the Mac specific points, even if we adjust things as per my previous paragraph, it's debatable if the tray icon is desirable or not. Only the main dexc process that has the running Core serves this tray. Only that process would be capable of providing the same menu items but on the dock as you suggest, not the dummy webview processes. I don't use Mac enough to have an informed opinion, but I do think the functionality of the tray icon on all systems is flawed (the "last window" kills the Core process design). |
I understand your concerns. We had some discussion around this on matrix, and as @chappjc has said, creating sub webview window is flawed. Also, creating a new webview window will make another icon appear in the dock and it was unpleasant to look at, so I had to add a .plist item to make it behave like a background app so users can create multiple windows without displaying unnecessary icons in the dock. Our use of a separate dexc process to create a new window allow for multiple webview window on Mac and I don't know if there's a workaround.
I agree. We have the systray, whether or not an order is running I think we should remove this behaviour. Some applications behave this way though, but it's up to us and what's best in this case for users. |
Doing it the "Mac way" using webview is a can of worms. |
fc49ff7
to
d7ff332
Compare
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.
DMG stuff LGTM. I think it may be possible to have the application be hidden instead of closed when the window closes by calling some objective-c code in the cgo section, but I haven't figured out exactly how yet.
I remove the <key>LSUIElement</key><true/>
element and also created the webview in the original process instead of using the subprocess. Then if I right click the icon and select "hide", that is the exact behavior we want when the red button is clicked.
Are you saying when running in the background, they can't open a window by clicking on the app's icon in the dock? |
Hmm. Do you mean that you can't pin an icon to the dock anymore? Sorry for the questions. I'm trying to get a mac right now. Hopefully I'll be more helpful soon. |
But sadly we don't have control over the red btn yet when running webview in the original process. |
Yep. But the systray will be visible and users can open new windows from there.
You can, for easy access.
np. |
If this returned 0 instead of 1, I think we'd be good... |
This will cause dexc-desktop to continue running (without a window), but we won't be able to "resurrect" the window if the user clicks on the dock icon again. It seems the trend is to clone webview and add the desired feature as other forks have so I did yesterday but I think we need total control over webview windows. |
Would there be a way to add an option on the icon menu to create a new window? |
Other apps have this. But I don't know how we can achieve this with webview. |
@ukane-philemon Would you mind rebasing and squashing down with a new commit message? Thanks. |
This is going to cause a lot of confusion. There's got to be some signal we can work with to catch them clicking the launcher icon, no? Or does Mac just completely ignore it because of the systray entry? |
I think @ukane-philemon is properly addressing this from #2372. This PR is primarily dealing with the dmg packaging. |
"scss/at-extend-no-missing-placeholder": null, | ||
"declaration-block-no-redundant-longhand-properties": null, | ||
"value-no-vendor-prefix": null |
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.
Why these changes?
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.
To allow for changes fixing #2333 (comment)
@@ -238,7 +238,10 @@ button.form-button { | |||
@extend .flex-center; | |||
|
|||
position: fixed; | |||
inset: 0; |
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.
Why undoing this? A linter update recently made us do this, and I don't think we should disable that linter.
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.
Not supported on webkit. #2333 (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.
Oh, right. That's kinda messed up that webkit doesn't support inset
. It is supported in every major browser, including Safari since v14.1: https://caniuse.com/mdn-css_properties_inset
What do we know about the webkit version provided by macdrive?
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.
I’m running Safari ver 15.6.1 but know nothing about the WebKit version provided by Macdrive. I think it will use whatever webkit version it finds.
To get Webkit Version on macOS run: defaults read /System/Library/Frameworks/WebKit.framework/Resources/Info.plist CFBundleShortVersionString
I got 15609
which corresponds with Safari ver 15.6.1 according to the comment here
@@ -35,12 +35,12 @@ | |||
{{end}} | |||
<div class="apply-bttn d-hide"><button class="bg2 demi">[[[apply]]]</button></div> | |||
</div> | |||
<div id="exportOrders" class="export-archived-records-bttn mt-3"> | |||
<div id="exportOrders" class="export-archived-records-bttn mt-3 pb-2"> |
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.
Will you please comment on all these frontend changes? I didn't notice them in prior review, and I don't think they are relevant to the DMG package additions.
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 display didn't look right on webkit. See #2333 (comment).
fix macOS multiple dock icons rebase changes build webpack bundle always fix webkit issue with unsupported inset property fix webkit backdrop-filter on login form fix css variable bug fix webkit rendering of market list, wallet select btns, order btns, and notification tabs remove redundant css class fix minor css style padding and bump cache martonp review changes dexc-desktop: catch os.Interrupt signal and shutdown gracefully Signed-off-by: Philemon Ukane <[email protected]>
d7ff332
to
ada396a
Compare
Signed-off-by: Philemon Ukane <[email protected]>
Signed-off-by: Philemon Ukane <[email protected]>
Signed-off-by: Philemon Ukane <[email protected]>
Notably the window is stuck on top like a modal. But I'm guessing #2372 will fix that. |
Stuck? Can I see a video of what you mean? |
This builds on top of #1957.
EDIT:
Decred DEX Client
in the images have been shortened toDecred DEX
.Display:
View in the Applications folder.
DMG installer view.
Dock view.
TODO:
16x16 pixels (1x and 2x), 32x32 pixels (1x and 2x), 64x64 pixels (1x and 2x), 128x128 pixels (1x and 2x), 256x256 pixels (1x and 2x), 512x512 pixels (1x and 2x), 1024x1024 pixels (1x only) which will be converted to a single .icns file for MacOs to display the most appropriate icon anywhere.
@martonp, please I'd appreciate your feedback on this since you also use MacOS.