Merge pull request #493 from pop-os/fix-network-reset
fix: allow network resets
This commit is contained in:
commit
3f48f6bb6f
6 changed files with 280 additions and 80 deletions
146
Cargo.lock
generated
146
Cargo.lock
generated
|
|
@ -174,7 +174,7 @@ dependencies = [
|
||||||
"url",
|
"url",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"wayland-protocols",
|
"wayland-protocols 0.31.2",
|
||||||
"zbus 4.2.2",
|
"zbus 4.2.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -715,7 +715,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clipboard_macos"
|
name = "clipboard_macos"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-6#8a816d8f218e290041bb5ef6d3b695c38e0a53b7"
|
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-7#a5be70405574e98c292537fd3b01a1352550b9bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"objc",
|
"objc",
|
||||||
"objc-foundation",
|
"objc-foundation",
|
||||||
|
|
@ -725,7 +725,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clipboard_wayland"
|
name = "clipboard_wayland"
|
||||||
version = "0.2.2"
|
version = "0.2.2"
|
||||||
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-6#8a816d8f218e290041bb5ef6d3b695c38e0a53b7"
|
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-7#a5be70405574e98c292537fd3b01a1352550b9bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"mime 0.1.0",
|
"mime 0.1.0",
|
||||||
|
|
@ -735,7 +735,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clipboard_x11"
|
name = "clipboard_x11"
|
||||||
version = "0.4.2"
|
version = "0.4.2"
|
||||||
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-6#8a816d8f218e290041bb5ef6d3b695c38e0a53b7"
|
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-7#a5be70405574e98c292537fd3b01a1352550b9bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"x11rb",
|
"x11rb",
|
||||||
|
|
@ -1184,11 +1184,11 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-client-toolkit"
|
name = "cosmic-client-toolkit"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-protocols?rev=e4e6f8c#e4e6f8ca4d7c239c02a8cdfd48a74cb0969425eb"
|
source = "git+https://github.com/pop-os/cosmic-protocols?rev=c8d3a1c#c8d3a1c3d40d16235f4720969a54ed570ec7a976"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-protocols",
|
"cosmic-protocols",
|
||||||
"libc",
|
"libc",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.1",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -1205,7 +1205,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-config"
|
name = "cosmic-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomicwrites",
|
"atomicwrites",
|
||||||
"cosmic-config-derive",
|
"cosmic-config-derive",
|
||||||
|
|
@ -1227,7 +1227,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-config-derive"
|
name = "cosmic-config-derive"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.109",
|
"syn 1.0.109",
|
||||||
|
|
@ -1291,21 +1291,22 @@ dependencies = [
|
||||||
"cosmic-config",
|
"cosmic-config",
|
||||||
"ron",
|
"ron",
|
||||||
"serde",
|
"serde",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.18.0",
|
||||||
"tracing",
|
"tracing",
|
||||||
"wayland-protocols-wlr",
|
"wayland-protocols-wlr 0.2.0",
|
||||||
"xdg-shell-wrapper-config",
|
"xdg-shell-wrapper-config",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-protocols"
|
name = "cosmic-protocols"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-protocols?rev=e4e6f8c#e4e6f8ca4d7c239c02a8cdfd48a74cb0969425eb"
|
source = "git+https://github.com/pop-os/cosmic-protocols?rev=c8d3a1c#c8d3a1c3d40d16235f4720969a54ed570ec7a976"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"wayland-protocols",
|
"wayland-protocols 0.32.1",
|
||||||
|
"wayland-protocols-wlr 0.3.1",
|
||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
"wayland-server",
|
"wayland-server",
|
||||||
]
|
]
|
||||||
|
|
@ -1321,7 +1322,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-text"
|
name = "cosmic-text"
|
||||||
version = "0.11.2"
|
version = "0.11.2"
|
||||||
source = "git+https://github.com/pop-os/cosmic-text.git#a3a6262e5d654bf6d110f18e6b7b8a31a764e64f"
|
source = "git+https://github.com/pop-os/cosmic-text.git#8bb45d7aca5b4a109924f3162d670297b6bd4a19"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"fontdb",
|
"fontdb",
|
||||||
|
|
@ -1343,7 +1344,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-theme"
|
name = "cosmic-theme"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"almost",
|
"almost",
|
||||||
"cosmic-config",
|
"cosmic-config",
|
||||||
|
|
@ -1770,12 +1771,12 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dnd"
|
name = "dnd"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-6#8a816d8f218e290041bb5ef6d3b695c38e0a53b7"
|
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-7#a5be70405574e98c292537fd3b01a1352550b9bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"mime 0.1.0",
|
"mime 0.1.0",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.1",
|
||||||
"smithay-clipboard",
|
"smithay-clipboard",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -2764,7 +2765,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced"
|
name = "iced"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_accessibility",
|
"iced_accessibility",
|
||||||
|
|
@ -2782,7 +2783,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_accessibility"
|
name = "iced_accessibility"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accesskit",
|
"accesskit",
|
||||||
"accesskit_unix",
|
"accesskit_unix",
|
||||||
|
|
@ -2791,7 +2792,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_core"
|
name = "iced_core"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"dnd",
|
"dnd",
|
||||||
|
|
@ -2802,7 +2803,7 @@ dependencies = [
|
||||||
"palette",
|
"palette",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"serde",
|
"serde",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.1",
|
||||||
"smol_str",
|
"smol_str",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"web-time",
|
"web-time",
|
||||||
|
|
@ -2813,7 +2814,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_futures"
|
name = "iced_futures"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
|
|
@ -2826,7 +2827,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_graphics"
|
name = "iced_graphics"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2850,7 +2851,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_renderer"
|
name = "iced_renderer"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
"iced_tiny_skia",
|
"iced_tiny_skia",
|
||||||
|
|
@ -2862,13 +2863,13 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_runtime"
|
name = "iced_runtime"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_accessibility",
|
"iced_accessibility",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"iced_futures",
|
"iced_futures",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.1",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"window_clipboard",
|
"window_clipboard",
|
||||||
]
|
]
|
||||||
|
|
@ -2876,7 +2877,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_sctk"
|
name = "iced_sctk"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"enum-repr",
|
"enum-repr",
|
||||||
"float-cmp",
|
"float-cmp",
|
||||||
|
|
@ -2888,11 +2889,11 @@ dependencies = [
|
||||||
"itertools 0.12.1",
|
"itertools 0.12.1",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.1",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tracing",
|
"tracing",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-protocols",
|
"wayland-protocols 0.32.1",
|
||||||
"window_clipboard",
|
"window_clipboard",
|
||||||
"xkbcommon",
|
"xkbcommon",
|
||||||
"xkbcommon-dl",
|
"xkbcommon-dl",
|
||||||
|
|
@ -2902,7 +2903,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_style"
|
name = "iced_style"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|
@ -2912,7 +2913,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_tiny_skia"
|
name = "iced_tiny_skia"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"cosmic-text",
|
"cosmic-text",
|
||||||
|
|
@ -2929,7 +2930,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_wgpu"
|
name = "iced_wgpu"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2944,10 +2945,10 @@ dependencies = [
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"resvg",
|
"resvg",
|
||||||
"rustix 0.38.34",
|
"rustix 0.38.34",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.1",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"wayland-protocols",
|
"wayland-protocols 0.32.1",
|
||||||
"wayland-sys",
|
"wayland-sys",
|
||||||
"wgpu",
|
"wgpu",
|
||||||
]
|
]
|
||||||
|
|
@ -2955,7 +2956,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_widget"
|
name = "iced_widget"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dnd",
|
"dnd",
|
||||||
"iced_renderer",
|
"iced_renderer",
|
||||||
|
|
@ -2963,7 +2964,7 @@ dependencies = [
|
||||||
"iced_style",
|
"iced_style",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"ouroboros",
|
"ouroboros",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.1",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"window_clipboard",
|
"window_clipboard",
|
||||||
|
|
@ -3636,7 +3637,7 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libcosmic"
|
name = "libcosmic"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic#7abcec759101c624329cccb1b63924a748ed04ae"
|
source = "git+https://github.com/pop-os/libcosmic#f820eb7ffe8ad6e5931f481469eeb79d1a68ab50"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apply",
|
"apply",
|
||||||
"ashpd",
|
"ashpd",
|
||||||
|
|
@ -3969,7 +3970,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mime"
|
name = "mime"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-6#8a816d8f218e290041bb5ef6d3b695c38e0a53b7"
|
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-7#a5be70405574e98c292537fd3b01a1352550b9bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"smithay-clipboard",
|
"smithay-clipboard",
|
||||||
]
|
]
|
||||||
|
|
@ -5290,7 +5291,7 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smithay-client-toolkit"
|
name = "smithay-client-toolkit"
|
||||||
version = "0.18.0"
|
version = "0.18.0"
|
||||||
source = "git+https://github.com/smithay/client-toolkit//?rev=3bed072#3bed072b966022f5f929d12f3aff089b1ace980b"
|
source = "git+https://github.com/smithay/client-toolkit?rev=3bed072#3bed072b966022f5f929d12f3aff089b1ace980b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -5307,8 +5308,36 @@ dependencies = [
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"wayland-csd-frame",
|
"wayland-csd-frame",
|
||||||
"wayland-cursor",
|
"wayland-cursor",
|
||||||
"wayland-protocols",
|
"wayland-protocols 0.31.2",
|
||||||
"wayland-protocols-wlr",
|
"wayland-protocols-wlr 0.2.0",
|
||||||
|
"wayland-scanner",
|
||||||
|
"xkbcommon",
|
||||||
|
"xkeysym",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "smithay-client-toolkit"
|
||||||
|
version = "0.19.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "837d3067369e24aeda699a5d9fc5aa14ca14a84dd70aeed7156bfa04a5605b32"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.5.0",
|
||||||
|
"bytemuck",
|
||||||
|
"calloop",
|
||||||
|
"calloop-wayland-source",
|
||||||
|
"cursor-icon",
|
||||||
|
"libc",
|
||||||
|
"log",
|
||||||
|
"memmap2 0.9.4",
|
||||||
|
"pkg-config",
|
||||||
|
"rustix 0.38.34",
|
||||||
|
"thiserror",
|
||||||
|
"wayland-backend",
|
||||||
|
"wayland-client",
|
||||||
|
"wayland-csd-frame",
|
||||||
|
"wayland-cursor",
|
||||||
|
"wayland-protocols 0.32.1",
|
||||||
|
"wayland-protocols-wlr 0.3.1",
|
||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
"xkbcommon",
|
"xkbcommon",
|
||||||
"xkeysym",
|
"xkeysym",
|
||||||
|
|
@ -5317,11 +5346,11 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smithay-clipboard"
|
name = "smithay-clipboard"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
source = "git+https://github.com/pop-os/smithay-clipboard?tag=pop-dnd-4#ab422ddcc95a9a1717df094f9c8fe69e2fdb2a27"
|
source = "git+https://github.com/pop-os/smithay-clipboard?tag=pop-dnd-5#d099e82a4c1e7d3e88dc34b7333de21928b1b22c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit 0.19.1",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -6304,6 +6333,19 @@ dependencies = [
|
||||||
"wayland-server",
|
"wayland-server",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wayland-protocols"
|
||||||
|
version = "0.32.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "83d0f1056570486e26a3773ec633885124d79ae03827de05ba6c85f79904026c"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.5.0",
|
||||||
|
"wayland-backend",
|
||||||
|
"wayland-client",
|
||||||
|
"wayland-scanner",
|
||||||
|
"wayland-server",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-protocols-wlr"
|
name = "wayland-protocols-wlr"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
|
@ -6313,7 +6355,21 @@ dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"wayland-protocols",
|
"wayland-protocols 0.31.2",
|
||||||
|
"wayland-scanner",
|
||||||
|
"wayland-server",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wayland-protocols-wlr"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a7dab47671043d9f5397035975fe1cac639e5bca5cc0b3c32d09f01612e34d24"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.5.0",
|
||||||
|
"wayland-backend",
|
||||||
|
"wayland-client",
|
||||||
|
"wayland-protocols 0.32.1",
|
||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
"wayland-server",
|
"wayland-server",
|
||||||
]
|
]
|
||||||
|
|
@ -6523,7 +6579,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "window_clipboard"
|
name = "window_clipboard"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-6#8a816d8f218e290041bb5ef6d3b695c38e0a53b7"
|
source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-dnd-7#a5be70405574e98c292537fd3b01a1352550b9bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clipboard-win",
|
"clipboard-win",
|
||||||
"clipboard_macos",
|
"clipboard_macos",
|
||||||
|
|
@ -6775,7 +6831,7 @@ version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/xdg-shell-wrapper#b5480042615ecfcf30262d5a40625e8f430b474a"
|
source = "git+https://github.com/pop-os/xdg-shell-wrapper#b5480042615ecfcf30262d5a40625e8f430b474a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"wayland-protocols-wlr",
|
"wayland-protocols-wlr 0.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ resolver = "2"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
anyhow = "1.0.81"
|
anyhow = "1.0.81"
|
||||||
cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "e4e6f8c" }
|
cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-client-toolkit", rev = "c8d3a1c" }
|
||||||
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", default-features = false, features = [
|
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", default-features = false, features = [
|
||||||
"client",
|
"client",
|
||||||
], rev = "e4e6f8c" }
|
], rev = "c8d3a1c" }
|
||||||
cosmic-time = { git = "https://github.com/pop-os/cosmic-time", default-features = false, features = [
|
cosmic-time = { git = "https://github.com/pop-os/cosmic-time", default-features = false, features = [
|
||||||
"libcosmic",
|
"libcosmic",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|
@ -64,8 +64,3 @@ ignored = ["libcosmic"]
|
||||||
# [patch."https://github.com/pop-os/libcosmic"]
|
# [patch."https://github.com/pop-os/libcosmic"]
|
||||||
# cosmic-config = { git = "https://github.com/pop-os/libcosmic//" }
|
# cosmic-config = { git = "https://github.com/pop-os/libcosmic//" }
|
||||||
# libcosmic = { git = "https://github.com/pop-os/libcosmic//" }
|
# libcosmic = { git = "https://github.com/pop-os/libcosmic//" }
|
||||||
|
|
||||||
[patch."https://github.com/Smithay/client-toolkit"]
|
|
||||||
sctk = { git = "https://github.com/smithay/client-toolkit//", package = "smithay-client-toolkit", rev = "3bed072" }
|
|
||||||
|
|
||||||
[patch."crates-io"]
|
|
||||||
|
|
@ -15,6 +15,15 @@ i18n-embed-fl.workspace = true
|
||||||
i18n-embed.workspace = true
|
i18n-embed.workspace = true
|
||||||
itertools = "0.13.0"
|
itertools = "0.13.0"
|
||||||
libcosmic.workspace = true
|
libcosmic.workspace = true
|
||||||
|
libcosmic.features = [
|
||||||
|
"applet",
|
||||||
|
"applet-token",
|
||||||
|
"clipboard",
|
||||||
|
"tokio",
|
||||||
|
"wayland",
|
||||||
|
"desktop",
|
||||||
|
"dbus-config",
|
||||||
|
]
|
||||||
rust-embed.workspace = true
|
rust-embed.workspace = true
|
||||||
tokio = { version = "1.36.0", features = ["full"] }
|
tokio = { version = "1.36.0", features = ["full"] }
|
||||||
tracing-log.workspace = true
|
tracing-log.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -17,3 +17,4 @@ enter-password = Enter the password or encryption key
|
||||||
router-wps-button = You can also connect by pressing the "WPS" button on the router
|
router-wps-button = You can also connect by pressing the "WPS" button on the router
|
||||||
unable-to-connect = Unable to connect to network
|
unable-to-connect = Unable to connect to network
|
||||||
check-wifi-connection = Make sure Wi-Fi is connected to the internet and the password is correct
|
check-wifi-connection = Make sure Wi-Fi is connected to the internet and the password is correct
|
||||||
|
reset = Reset
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use cosmic::app::Command;
|
use cosmic::app::Command;
|
||||||
use cosmic::applet::token::subscription::{
|
use cosmic::applet::token::subscription::{
|
||||||
activation_token_subscription, TokenRequest, TokenUpdate,
|
activation_token_subscription, TokenRequest, TokenUpdate,
|
||||||
|
|
@ -5,6 +7,7 @@ use cosmic::applet::token::subscription::{
|
||||||
use cosmic::applet::{menu_button, menu_control_padding, padded_control};
|
use cosmic::applet::{menu_button, menu_control_padding, padded_control};
|
||||||
use cosmic::cctk::sctk::reexports::calloop;
|
use cosmic::cctk::sctk::reexports::calloop;
|
||||||
use cosmic::iced_widget::Row;
|
use cosmic::iced_widget::Row;
|
||||||
|
use cosmic::widget::icon::from_name;
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
iced::{
|
iced::{
|
||||||
wayland::popup::{destroy_popup, get_popup},
|
wayland::popup::{destroy_popup, get_popup},
|
||||||
|
|
@ -17,7 +20,6 @@ use cosmic::{
|
||||||
window,
|
window,
|
||||||
},
|
},
|
||||||
iced_style::application,
|
iced_style::application,
|
||||||
theme::Button,
|
|
||||||
widget::{button, container, divider, icon, scrollable, text, text_input, Column},
|
widget::{button, container, divider, icon, scrollable, text, text_input, Column},
|
||||||
Element, Theme,
|
Element, Theme,
|
||||||
};
|
};
|
||||||
|
|
@ -45,7 +47,7 @@ pub fn run() -> cosmic::iced::Result {
|
||||||
cosmic::applet::run::<CosmicNetworkApplet>(false, ())
|
cosmic::applet::run::<CosmicNetworkApplet>(false, ())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Clone)]
|
||||||
enum NewConnectionState {
|
enum NewConnectionState {
|
||||||
EnterPassword {
|
EnterPassword {
|
||||||
access_point: AccessPoint,
|
access_point: AccessPoint,
|
||||||
|
|
@ -99,6 +101,7 @@ struct CosmicNetworkApplet {
|
||||||
timeline: Timeline,
|
timeline: Timeline,
|
||||||
toggle_wifi_ctr: u128,
|
toggle_wifi_ctr: u128,
|
||||||
token_tx: Option<calloop::channel::Sender<TokenRequest>>,
|
token_tx: Option<calloop::channel::Sender<TokenRequest>>,
|
||||||
|
failed_known_ssids: HashSet<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn wifi_icon(strength: u8) -> &'static str {
|
fn wifi_icon(strength: u8) -> &'static str {
|
||||||
|
|
@ -114,8 +117,38 @@ fn wifi_icon(strength: u8) -> &'static str {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CosmicNetworkApplet {
|
impl CosmicNetworkApplet {
|
||||||
fn update_nm_state(&mut self, new_state: NetworkManagerState) {
|
fn update_nm_state(&mut self, mut new_state: NetworkManagerState) {
|
||||||
self.update_togglers(&new_state);
|
self.update_togglers(&new_state);
|
||||||
|
// check for failed conns that can be reset
|
||||||
|
for new_s in &mut new_state.active_conns {
|
||||||
|
let state = match new_s {
|
||||||
|
ActiveConnectionInfo::WiFi { state, .. } => state,
|
||||||
|
_ => continue,
|
||||||
|
};
|
||||||
|
|
||||||
|
if matches!(state, ActiveConnectionState::Activated) {
|
||||||
|
self.failed_known_ssids.remove(&new_s.name());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if matches!(
|
||||||
|
state,
|
||||||
|
ActiveConnectionState::Activating | ActiveConnectionState::Deactivating
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.nm_state.active_conns.iter().any(|old_s| {
|
||||||
|
matches!(
|
||||||
|
old_s,
|
||||||
|
ActiveConnectionInfo::WiFi {
|
||||||
|
state: ActiveConnectionState::Activating,
|
||||||
|
..
|
||||||
|
} if new_s.name() == old_s.name()
|
||||||
|
)
|
||||||
|
}) {
|
||||||
|
self.failed_known_ssids.insert(new_s.name());
|
||||||
|
}
|
||||||
|
}
|
||||||
self.nm_state = new_state;
|
self.nm_state = new_state;
|
||||||
self.update_icon_name();
|
self.update_icon_name();
|
||||||
}
|
}
|
||||||
|
|
@ -189,6 +222,7 @@ pub(crate) enum Message {
|
||||||
Frame(Instant),
|
Frame(Instant),
|
||||||
Token(TokenUpdate),
|
Token(TokenUpdate),
|
||||||
OpenSettings,
|
OpenSettings,
|
||||||
|
ResetFailedKnownSsid(String),
|
||||||
// Errored(String),
|
// Errored(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -280,26 +314,40 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
self.update_nm_state(state);
|
self.update_nm_state(state);
|
||||||
}
|
}
|
||||||
NetworkManagerEvent::RequestResponse {
|
NetworkManagerEvent::RequestResponse {
|
||||||
state,
|
mut state,
|
||||||
success,
|
success,
|
||||||
req,
|
req,
|
||||||
} => {
|
} => {
|
||||||
if let NetworkManagerRequest::SelectAccessPoint(ssid) = &req {
|
if let NetworkManagerRequest::SelectAccessPoint(ssid) = &req {
|
||||||
if self
|
let conn_match = self
|
||||||
.new_connection
|
.new_connection
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|c| c.ssid() == ssid)
|
.map(|c| c.ssid() == ssid)
|
||||||
.unwrap_or_default()
|
.unwrap_or_default();
|
||||||
&& success
|
if conn_match && success {
|
||||||
{
|
if let Some(s) =
|
||||||
|
state.active_conns.iter_mut().find(|ap| &ap.name() == ssid)
|
||||||
|
{
|
||||||
|
match s {
|
||||||
|
ActiveConnectionInfo::WiFi { state, .. } => {
|
||||||
|
*state = ActiveConnectionState::Activated;
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
self.failed_known_ssids.remove(ssid);
|
||||||
self.new_connection = None;
|
self.new_connection = None;
|
||||||
self.show_visible_networks = false;
|
self.show_visible_networks = false;
|
||||||
|
} else if !matches!(
|
||||||
|
&self.new_connection,
|
||||||
|
Some(NewConnectionState::EnterPassword { .. })
|
||||||
|
)
|
||||||
|
{
|
||||||
|
self.failed_known_ssids.insert(ssid.clone());
|
||||||
}
|
}
|
||||||
} else if let NetworkManagerRequest::Password(ssid, _) = &req {
|
} else if let NetworkManagerRequest::Password(ssid, _) = &req {
|
||||||
if let Some(
|
if let Some(NewConnectionState::Waiting(access_point)) =
|
||||||
NewConnectionState::EnterPassword { access_point, .. }
|
self.new_connection.clone()
|
||||||
| NewConnectionState::Waiting(access_point),
|
|
||||||
) = self.new_connection.take()
|
|
||||||
{
|
{
|
||||||
if !success && ssid == &access_point.ssid {
|
if !success && ssid == &access_point.ssid {
|
||||||
self.new_connection =
|
self.new_connection =
|
||||||
|
|
@ -308,11 +356,28 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
self.new_connection = None;
|
self.new_connection = None;
|
||||||
self.show_visible_networks = false;
|
self.show_visible_networks = false;
|
||||||
}
|
}
|
||||||
|
} else if let Some(NewConnectionState::EnterPassword {
|
||||||
|
access_point, ..
|
||||||
|
}) = self.new_connection.clone()
|
||||||
|
{
|
||||||
|
if success && ssid == &access_point.ssid {
|
||||||
|
self.new_connection = None;
|
||||||
|
self.show_visible_networks = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else if self
|
||||||
|
.new_connection
|
||||||
|
.as_ref()
|
||||||
|
.map(|c| c.ssid()).is_some_and(|ssid| {
|
||||||
|
state.active_conns.iter().any(|c|
|
||||||
|
matches!(c, ActiveConnectionInfo::WiFi { name, state: ActiveConnectionState::Activated, .. } if ssid == name)
|
||||||
|
)
|
||||||
|
}) {
|
||||||
|
self.new_connection = None;
|
||||||
|
self.show_visible_networks = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.nm_state.connectivity != state.connectivity
|
if !matches!(req, NetworkManagerRequest::Reload)
|
||||||
&& !matches!(req, NetworkManagerRequest::Reload)
|
|
||||||
&& matches!(state.connectivity, NmConnectivityState::Portal)
|
&& matches!(state.connectivity, NmConnectivityState::Portal)
|
||||||
{
|
{
|
||||||
let mut browser = std::process::Command::new("xdg-open");
|
let mut browser = std::process::Command::new("xdg-open");
|
||||||
|
|
@ -439,6 +504,38 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
cosmic::process::spawn(cmd);
|
cosmic::process::spawn(cmd);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Message::ResetFailedKnownSsid(ssid) => {
|
||||||
|
let ap = if let Some(pos) = self
|
||||||
|
.nm_state
|
||||||
|
.known_access_points
|
||||||
|
.iter()
|
||||||
|
.position(|ap| ap.ssid == ssid)
|
||||||
|
{
|
||||||
|
self.nm_state.known_access_points.remove(pos)
|
||||||
|
} else if let Some((pos, ap)) = self
|
||||||
|
.nm_state
|
||||||
|
.active_conns
|
||||||
|
.iter()
|
||||||
|
.position(|conn| conn.name() == ssid)
|
||||||
|
.zip(
|
||||||
|
self.nm_state
|
||||||
|
.wireless_access_points
|
||||||
|
.iter()
|
||||||
|
.find(|ap| ap.ssid == ssid),
|
||||||
|
)
|
||||||
|
{
|
||||||
|
self.nm_state.active_conns.remove(pos);
|
||||||
|
ap.clone()
|
||||||
|
} else {
|
||||||
|
tracing::warn!("Failed to find known access point with ssid: {}", ssid);
|
||||||
|
return Command::none();
|
||||||
|
};
|
||||||
|
if let Some(tx) = self.nm_sender.as_ref() {
|
||||||
|
let _ = tx.unbounded_send(NetworkManagerRequest::Forget(ssid.clone()));
|
||||||
|
self.show_visible_networks = true;
|
||||||
|
return self.update(Message::SelectWirelessAccessPoint(ap));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Command::none()
|
Command::none()
|
||||||
}
|
}
|
||||||
|
|
@ -553,6 +650,17 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
),
|
),
|
||||||
_ => {}
|
_ => {}
|
||||||
};
|
};
|
||||||
|
if self.failed_known_ssids.contains(name) {
|
||||||
|
btn_content.push(
|
||||||
|
cosmic::widget::button::icon(
|
||||||
|
from_name("view-refresh-symbolic").size(16),
|
||||||
|
)
|
||||||
|
.icon_size(16)
|
||||||
|
.on_press(Message::ResetFailedKnownSsid(name.clone()))
|
||||||
|
.into(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
known_wifi.push(Element::from(
|
known_wifi.push(Element::from(
|
||||||
column![menu_button(
|
column![menu_button(
|
||||||
Row::with_children(btn_content)
|
Row::with_children(btn_content)
|
||||||
|
|
@ -646,6 +754,15 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
btn_content.push(ssid.into());
|
btn_content.push(ssid.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.failed_known_ssids.contains(&known.ssid) {
|
||||||
|
btn_content.push(
|
||||||
|
cosmic::widget::button::icon(from_name("view-refresh-symbolic").size(16))
|
||||||
|
.icon_size(16)
|
||||||
|
.on_press(Message::ResetFailedKnownSsid(known.ssid.clone()))
|
||||||
|
.into(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
let mut btn = menu_button(
|
let mut btn = menu_button(
|
||||||
Row::with_children(btn_content)
|
Row::with_children(btn_content)
|
||||||
.align_items(Alignment::Center)
|
.align_items(Alignment::Center)
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,33 @@ async fn start_listening(
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
Some(NetworkManagerRequest::Forget(ssid)) => {
|
||||||
|
let s = NetworkManagerSettings::new(&conn).await.unwrap();
|
||||||
|
let known_conns = s.list_connections().await.unwrap_or_default();
|
||||||
|
let mut success = false;
|
||||||
|
for c in known_conns {
|
||||||
|
let settings = c.get_settings().await.ok().unwrap_or_default();
|
||||||
|
let s = Settings::new(settings);
|
||||||
|
if s.wifi
|
||||||
|
.clone()
|
||||||
|
.and_then(|w| w.ssid)
|
||||||
|
.and_then(|ssid| String::from_utf8(ssid).ok())
|
||||||
|
.is_some_and(|s| s == ssid)
|
||||||
|
{
|
||||||
|
_ = c.delete().await;
|
||||||
|
success = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let state = NetworkManagerState::new(&conn).await.unwrap_or_default();
|
||||||
|
_ = output
|
||||||
|
.send(NetworkManagerEvent::RequestResponse {
|
||||||
|
req: NetworkManagerRequest::Forget(ssid.clone()),
|
||||||
|
success,
|
||||||
|
state,
|
||||||
|
})
|
||||||
|
.await;
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
return State::Finished;
|
return State::Finished;
|
||||||
}
|
}
|
||||||
|
|
@ -236,6 +263,7 @@ pub enum NetworkManagerRequest {
|
||||||
SelectAccessPoint(String),
|
SelectAccessPoint(String),
|
||||||
Disconnect(String),
|
Disconnect(String),
|
||||||
Password(String, String),
|
Password(String, String),
|
||||||
|
Forget(String),
|
||||||
Reload,
|
Reload,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -432,6 +460,7 @@ impl NetworkManagerState {
|
||||||
let mut known_conn = None;
|
let mut known_conn = None;
|
||||||
for c in known_conns {
|
for c in known_conns {
|
||||||
let settings = c.get_settings().await.ok().unwrap_or_default();
|
let settings = c.get_settings().await.ok().unwrap_or_default();
|
||||||
|
|
||||||
let s = Settings::new(settings);
|
let s = Settings::new(settings);
|
||||||
if let Some(cur_ssid) = s
|
if let Some(cur_ssid) = s
|
||||||
.wifi
|
.wifi
|
||||||
|
|
@ -445,22 +474,12 @@ impl NetworkManagerState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let active_conn = if let Some(known_conn) = known_conn.as_ref() {
|
let active_conn = if let Some(known_conn) = known_conn.as_ref() {
|
||||||
// update settings if needed
|
// update settings if needed
|
||||||
let mut settings = known_conn.get_settings().await.ok().unwrap_or_default();
|
if password.is_some() {
|
||||||
settings.extend(conn_settings.iter().map(|s| {
|
known_conn.update(conn_settings).await?;
|
||||||
let map = (
|
}
|
||||||
s.0.to_string(),
|
|
||||||
s.1.iter()
|
|
||||||
.filter_map(|(k, v)| {
|
|
||||||
OwnedValue::try_from(v).map(|v| (k.to_string(), v)).ok()
|
|
||||||
})
|
|
||||||
.collect::<HashMap<_, _>>(),
|
|
||||||
);
|
|
||||||
map
|
|
||||||
}));
|
|
||||||
|
|
||||||
known_conn.update(conn_settings).await?;
|
|
||||||
|
|
||||||
nm.activate_connection(known_conn, &device).await?
|
nm.activate_connection(known_conn, &device).await?
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -473,11 +492,14 @@ impl NetworkManagerState {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.interface(dummy.inner().interface().to_owned())
|
.interface(dummy.inner().interface().to_owned())
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
.path(dummy.inner().path().to_owned())
|
||||||
|
.unwrap()
|
||||||
.build()
|
.build()
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
ActiveConnection::from(active)
|
ActiveConnection::from(active)
|
||||||
};
|
};
|
||||||
|
_ = tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
|
||||||
let mut state =
|
let mut state =
|
||||||
enums::ActiveConnectionState::from(active_conn.state().await.unwrap_or_default());
|
enums::ActiveConnectionState::from(active_conn.state().await.unwrap_or_default());
|
||||||
return match state {
|
return match state {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue