Skip to content

Commit

Permalink
Fixed two bugs.
Browse files Browse the repository at this point in the history
Fixed crashing when opening nm-connection-editor and not connecting to any Wi-Fi network if the current network is a new connection.
  • Loading branch information
DiogenesN authored Oct 1, 2024
1 parent e4520d6 commit 7e82981
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/diowpanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,9 @@ static void wl_pointer_frame(void *data, struct wl_pointer *wl_pointer) {
// if clicked network if the currently active one
// then we disconnect it.
if (strcmp(network_ptr->ssids[selectedNetwork],
currActiveNetwork) == 0) {
/// gerring disconnect command
currActiveNetwork) == 0 && \
!isNetworkSaved) {
/// getting disconnect command
isNetworkSaved = false;
char *disconnectCMD = get_char_value_from_conf(config,
"disconnect_cmd");
Expand Down Expand Up @@ -869,6 +870,7 @@ static void wl_pointer_frame(void *data, struct wl_pointer *wl_pointer) {
// if it has beeen previously saved then we don't need a password
// prompt when connecting.
if (isNetworkSaved) {
fprintf(stderr, "one\n");
// Setting securedNetwork = false disables password dialog
isNetworkSaved = false;
securedNetwork = false;
Expand Down Expand Up @@ -911,6 +913,7 @@ static void wl_pointer_frame(void *data, struct wl_pointer *wl_pointer) {
INT32_MAX, INT32_MAX);
wl_surface_commit(state->wl_surface_popup);
///close_popup(state);
return;
}
}
else { // If currently clicked network is free
Expand Down Expand Up @@ -1063,11 +1066,13 @@ static void wl_pointer_frame(void *data, struct wl_pointer *wl_pointer) {
///printf("opening network manager\n");
nmanagerOpen = true;
char *networkManCMD = get_char_value_from_conf(config, "nm_manager");
run_cmd(networkManCMD);
close_popup(state);
if (networkManCMD != NULL) {
run_cmd(networkManCMD);
free(networkManCMD);
networkManCMD = NULL;
ssidsTimer = false;
popupEntered = false;
nmanagerOpen = false;
}
}
if (state->y_motion >= 670 && state->x_motion >= 570) {
Expand Down

0 comments on commit 7e82981

Please sign in to comment.