Fix prefs crash, DRM GPU sensor bugs, and default off public-IP calls - #1
Open
Vigwear wants to merge 3 commits into
Open
Fix prefs crash, DRM GPU sensor bugs, and default off public-IP calls#1Vigwear wants to merge 3 commits into
Vigwear wants to merge 3 commits into
Conversation
AdwViewSwitcherSidebar is not a real libadwaita widget in any released version (confirmed against libadwaita 1.7.6's typelib, which only has AdwViewSwitcher, AdwViewSwitcherBar, AdwViewSwitcherTitle, and AdwInlineViewSwitcher). Referencing it in prefs.ui made GtkBuilder throw Gtk.BuilderError: Invalid object type 'AdwViewSwitcherSidebar', crashing prefs on open. The file's declared <requires lib="libadwaita" version="1.9"/> was also bogus (1.9 doesn't exist). Rebuild the sidebar as a GtkListBox of rows (Adw.ButtonContent icon+label) bound to the AdwViewStack pages, wired up in prefs.js instead of relying on the missing widget's stack/mode properties and activated signal. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ding _readGpuDrm() built typeName from the raw sysfs card index (gpu#0 for card0), but other code paths that reference the same group key use a 1-based index (e.g. the hardcoded 'Refresh Rate' at gpu#1, and the NVIDIA path's 'gpu#' + gpuNum). The mismatch means the DRM-path Graphics group is created under a key nothing else looks up, so it silently disappears (upstream corecoding#474/corecoding#554, fixed the same way in open PR corecoding#517). The vendor switch also compared uppercase hex literals ('0x10DE', '0x13B5') against vendor strings that sysfs always reports lowercase, so NVIDIA (nouveau) and ARM cards could never match and fell through to "Unknown 0x...". Normalize with toLowerCase() before comparing. Also add a Frequency reading for Intel (i915) GPUs, sourced from gt_cur_freq_mhz, since i915 has no gpu_busy_percent equivalent to amdgpu and previously showed no usage data at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
include-public-ip defaulted to true, with the provider defaulting to Core Coding's own endpoint (ipv4.corecoding.com) — meaning a fresh install phoned home once an hour (network-public-ip-interval defaults to 60) without the user opting in. _refreshIPAddress() is gated solely by this one setting, so flipping the default to false stops all such requests until a user explicitly turns "Include public IP address" on in Network settings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three unrelated fixes, stacked on one branch:
1. Prefs crash —
AdwViewSwitcherSidebardoesn't existprefs.uireferencedAdwViewSwitcherSidebar, which is not a real widget in any released libadwaita version (confirmed against 1.7.6's typelib — onlyAdwViewSwitcher,AdwViewSwitcherBar,AdwViewSwitcherTitle, andAdwInlineViewSwitcherexist). Opening extension preferences threwGtk.BuilderError: Invalid object type 'AdwViewSwitcherSidebar'and crashed immediately. The file's<requires lib="libadwaita" version="1.9"/>was also bogus (1.9 doesn't exist).Rebuilt the sidebar as a
GtkListBoxof rows (Adw.ButtonContenticon+label) bound to theAdwViewStackpages, wired up inprefs.js.2. GPU/DRM sensor bugs
_readGpuDrm()built the sensor group key from the raw sysfs card index (gpu#0forcard0), but other code paths reference the same key with a 1-based index (hardcodedRefresh Rateatgpu#1, and the NVIDIA path's'gpu#' + gpuNum). The mismatch means the DRM-path Graphics group is created under a key nothing looks up, so the group silently disappears — matches upstream AMD GPU not seen in the graphic monitor corecoding/Vitals#474/Problème gpu AMD RX 9060 XT non reconnu et stockage nvmie non reconnu corecoding/Vitals#554, same fix as open PR Fix DRM GPU index mapping for UI groups corecoding/Vitals#517.'0x10DE','0x13B5') againstvendor, which sysfs always reports lowercase, so NVIDIA (nouveau) and ARM cards could never match and fell through to "Unknown 0x...". Fixed with.toLowerCase().gt_cur_freq_mhz, since i915 has nogpu_busy_percentequivalent to amdgpu and previously showed no usage data at all.3. Public IP lookup — default off
include-public-ipdefaulted totrue, with the provider defaulting to Core Coding's own endpoint (ipv4.corecoding.com), andnetwork-public-ip-intervaldefaulting to60— so a fresh install phoned home to the developer's server once an hour without the user opting in._refreshIPAddress()is gated solely by this one boolean; flipping its default tofalsestops all such requests until a user explicitly enables "Include public IP address" in Network settings.Test plan
prefs.uiXML is well-formed and every widget class it now references resolves against the installed libadwaita/GTK typelibs (no live-display test available in the dev sandbox — needs a manual open-preferences check)node --checkclean onprefs.jsandsensors.jsCo-Authored-By: Claude Sonnet 5 noreply@anthropic.com