Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR fully removes Firefox DPI scaling support (including its tests) to eliminate related audio crashes, and strengthens updateDefaultSink by moving the sinkInfo nil check earlier to avoid null pointer dereferences. Class diagram for removed Firefox DPI scaling code in XSManagerclassDiagram
class XSManager {
+updateXResources()
-updateFirefoxDPI() // Removed
}
%% The following helper functions were also removed:
class getFirefoxConfigs {
-getFirefoxConfigs(dir string) ([]string, error) // Removed
}
class setFirefoxDPI {
-setFirefoxDPI(value float64, src, dest string) error // Removed
}
XSManager --|> getFirefoxConfigs : used
XSManager --|> setFirefoxDPI : used
Class diagram for updated Audio.updateDefaultSink() methodclassDiagram
class Audio {
+updateDefaultSink(sinkName string)
-defaultSinkName : string
-defaultSink
+setPropDefaultSink(path string)
+moveSinkInputsToSink(sink)
}
%% updateDefaultSink now checks sinkInfo == nil earlier to prevent null pointer dereference.
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Remove any leftover imports or constants in xsettings_dpi.go that are no longer used after deleting the Firefox DPI code to avoid dead code.
- Add a unit test or integration scenario for the new early-return path in updateDefaultSink to verify nil sinkInfo handling works as expected.
- Consider renaming or updating comments around updateDPI/updateXResources to reflect that Firefox DPI scaling has been removed, improving code clarity.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Remove any leftover imports or constants in xsettings_dpi.go that are no longer used after deleting the Firefox DPI code to avoid dead code.
- Add a unit test or integration scenario for the new early-return path in updateDefaultSink to verify nil sinkInfo handling works as expected.
- Consider renaming or updating comments around updateDPI/updateXResources to reflect that Firefox DPI scaling has been removed, improving code clarity.
## Individual Comments
### Comment 1
<location> `audio1/audio.go:1396-1401` </location>
<code_context>
logger.Info("virtual sink is", sinkName, ",sink_master is", sinkInfo.Name)
}
-
+ if sinkInfo == nil {
+ logger.Warning("failed to get sinkInfo for name:", sinkName)
+ a.setPropDefaultSink("/")
+ a.defaultSinkName = ""
+ a.defaultSink = nil
+ return
+ }
a.moveSinkInputsToSink(nil)
</code_context>
<issue_to_address>
**suggestion:** Duplicate nil check for sinkInfo can be removed.
Since the nil check is now handled earlier, please remove the redundant check and any unreachable code below to improve readability.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
mhduiy
approved these changes
Nov 3, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1. Fix an audio crash issue 2. Remove Firefox DPI settings Influence: audio/firefox
deepin pr auto review我来对这段代码进行审查分析:
if sinkInfo == nil {
logger.Warning("failed to get sinkInfo for name:", sinkName)
a.setPropDefaultSink("/")
a.defaultSinkName = ""
a.defaultSink = nil
return
}优点:
建议:
- go m.updateFirefoxDPI()优点:
优点:
优点:
总体评价:
建议:
这些修改整体上是积极的,提高了代码的质量和可维护性。 |
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.
Influence: audio/firefox