-
Notifications
You must be signed in to change notification settings - Fork 121
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
Fixed issue #243 and improved Auto Join #256
base: master
Are you sure you want to change the base?
Changes from all commits
53201c6
ef86893
31c0c6a
aad4a90
8c981b3
ec2069e
821695e
9b2a712
b855c86
53fb4f3
48ce0ec
4b9b68e
cb41bb4
c366676
ba47c0e
0376e95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -435,7 +435,11 @@ final class StatusMenu: NSMenu, NSMenuDelegate { | |
} | ||
case .turnWiFiOn: | ||
power_on() | ||
NetworkManager.scanSavedNetworks() | ||
case .turnWiFiOff: | ||
if status == ITL80211_S_RUN { | ||
disassociateSSID(disconnectItem) | ||
} | ||
Comment on lines
+440
to
+442
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When connected, it will disconnect from the current network before turning off the Wi-Fi, thus preventing it from connecting to a network with auto-join disabled when Wi-Fi is turned on (if the previously connected network has auto-join disabled). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the changes made to |
||
power_off() | ||
case .joinNetworks: | ||
let joinPop = WiFiConfigWindow() | ||
|
@@ -608,7 +612,6 @@ final class StatusMenu: NSMenu, NSMenuDelegate { | |
options: .regularExpression, | ||
range: nil) | ||
DispatchQueue.global().async { | ||
CredentialsManager.instance.setAutoJoin(ssid, false) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please correct me if I'm wrong, I did recall this is what Apple's implementation used to do back in the days - manually disconnecting a network will opt-out from auto-join, although this is not what the latest macOS versions are doing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are correct. Apple’s implementation used to work this way: manually disconnecting from a network would remove it from auto-join. However, more recent versions of macOS no longer follow this behavior; Apple made this change to improve user experience by reducing the need to manually reconfigure network preferences. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you prefer to keep this behavior of automatically disabling autojoin when the user disconnects? I think this behavior is not very interesting and many users may not like this behavior. If you prefer to keep this behavior, I think it would be better to add an option in the preferences to activate and deactivate this behavior. |
||
dis_associate_ssid(ssid) | ||
Log.debug("Disconnected from \(ssid)") | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,6 @@ final class NetworkManager { | |
if let savedNetworkAuth = CredentialsManager.instance.get(networkInfo) { | ||
networkInfo.auth = savedNetworkAuth | ||
Log.debug("Connecting to network \(networkInfo.ssid) with saved password") | ||
CredentialsManager.instance.setAutoJoin(networkInfo.ssid, true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m not certain if this is what Apple’s implementation used to do back in the days (feels unlikely and doesn't match with the current implementation). This is the root cause of #243. |
||
getAuthInfoCallback(networkInfo.auth, false) | ||
return | ||
} | ||
|
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.
When the Wi-Fi is turned on, it will attempt to auto-join.