Skip to content
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 with layoutmanager crashing when dismissing the quick set… #951

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

indiesaudi
Copy link
Contributor

@indiesaudi indiesaudi commented Jan 16, 2024

…tings

Summary by CodeRabbit

  • Bug Fixes
    • Improved stability by preventing an index out of range error in action sorting.

Copy link
Contributor

coderabbitai bot commented Jan 16, 2024

Walkthrough

The code update involves a crucial fix to a conditional check within a layout manager. The fix ensures that the index reference stays within the bounds of the sortedActions list, thereby averting potential index out of range errors that could occur during list operations.

Changes

File Summary
HandheldCompanion/.../LayoutManager.cs Modified index check in sortedActions to prevent out of range exceptions.

🐇
In the code's burrow, deep and vast,
An index out of bounds has passed.
Now with a check, firm and tight,
No error lurks in the code's night. 🌙✨

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 5c9d14d and 10a513e.
Files selected for processing (1)
  • HandheldCompanion/Managers/LayoutManager.cs (1 hunks)

HandheldCompanion/Managers/LayoutManager.cs Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 10a513e and 8afced9.
Files selected for processing (1)
  • HandheldCompanion/Managers/LayoutManager.cs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • HandheldCompanion/Managers/LayoutManager.cs

@Valkirie Valkirie merged commit 81e3e0f into Valkirie:main Jan 16, 2024
1 check passed
Valkirie pushed a commit that referenced this pull request Feb 3, 2024
#951)

* fixed issue with layoutmanager crashing when dismissing the quick settings

* Update HandheldCompanion/Managers/LayoutManager.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Valkirie added a commit that referenced this pull request Feb 3, 2024
* Implement CustomWpf (#154)

* Disable the RealTimeStylus for WPF Applications

* Update MainWindow.xaml.cs

* test ?

* Restore LegionGo fan control (#159)

* restore Legion Go FanControl ability (requires BIOS v29)

* Implement Sapientia function getUSBVerify()

* Implement WMI class (wip)

* implement new functions

- GetFanFullSpeedAsync
- SetFanFullSpeedAsync
- SetFanTable
- SetSmartFanMode

* implement SetCPUPowerLimit()

* Implement support for Intel Graphics Control Library (IGCL) (#158)

* Start implementing IGCL (wip)

* More work

- Implemented GPUManager
- Implemented GPU-specific classes (AMDGPU, IntelGPU)
- Implemented IGCLBackend (wip)
- SystemManager renamed to MultimediaManager
- PowerManager renamed to SystemManager

* more work on IGCL

* prevent crash on null MainThread

* prevent useless SetResolution() calls

* more work on IGCL

* add missing sharpness check

* implement ctl_device_adapter_properties_t  (wip)

* what if the issue was deviceIdx all along...

* Update IGCL_Wrapper.dll

* fix remaining implementations

* implement IntegerScalingType (Intel only)

* make sure to use defaultGPU (idx: 0)

We need to find a proper way to guess which one is used for 3D rendering I guess or linked to main screen..

* fix ctl_device_adapter_properties_t Marshalling

* implemented some form of logic to pick the first available external GPU (if any)

* improve GPUManager

- add support for Manufacturer: "Advanced Micro Devices, Inc."
- improve GPUManager and GPU Start() and Stop() logics
- prevent Task Execution within Tasks on AMDGPU

* fix a crash when UpdateTimer is null

* Implement new UI classes (#153)

* Implement new UI classes

- UISounds to manage UI sounds on interaction.
- UIGamepad to manage gamepad interactions.
- Audio files from https://kenney.nl/assets/ui-audio.
- Add support for TextBox and RepeatButton selection via gamepad.

* Update HandheldCompanion/UI/UISounds.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix PlayOggFile refs

* removed unused audio files

* Add UI Sounds toggle on SettingsPage (default Off)

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Improve ADLX and IGCL (#160)

* Migrate everything ADLX related to ADLX_Wrapper()

* update IGCL logic

- Implemented Terminate() and Initialize() as well as GetTelemetryData()

* debug functions on both IGCL and ADLX backends

* Update ADLX_Wrapper and fix Initialize() calls on GPU classes

* add Telemetry Timer as part of GPU class

* Implement GPU GetLoad() and GetPower()

* oups forgot to remove that part

* implement telemetryLock

* Allow OSD customization (#161)

* SapientiaUsb update (#104)

* SapientiaUsb update

* Legion Go - additional settings

* Modify the CPUBoost logic to use PerfBoostMode rather than boolean (#162)

Also improved the threading logic on powerWatchdog_Elapsed

* fixed issue with layoutmanager crashing when dismissing the quick set… (#951)

* fixed issue with layoutmanager crashing when dismissing the quick settings

* Update HandheldCompanion/Managers/LayoutManager.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* prevent crash on null AdapterRAM

@0SkillAllLuck, we shouldn't loop through all video controllers but instead only look for "main" one

* Improve Controller UI experience (#163)

* Update ControllerPage and IController UI logic a bit

Should simplify the virtual/physical distinction

* more work on UI

* minor tweaks

* misc text tweaks

* more work on UI

* improve wording

* Hide Hints Stackpanel if all childrens are hidden as well

* ControllerRefresh: move non-UI logic away from Dispatcher

* cleanup

* Improve gamepad navigation

When navigating, don't focus TextBox if IsReadOnly

* Change Serilog.Sinks.File MinimumLevel to Information

This should prevent AutoTDP and TDP control to flood the log.

* Increase GPUManager robustness (#166)

- GPUManager should be started before Profile and PowerProfile managers to avoid an IGCL/ADLX calls from being made before they're initialized.
- Implemented an IsInitialized check before executing any ADLX/IGCL calls.
- Implemented a try{] catch{} on GPU Execute().
- Halt Telemetry timer before closing IGCL/ADLX.

* Update README.md to include Droix Discord link (#168)

* Improvement Increased gyro aiming down sites multiplier lower range. (#165)

* Improve process detection, sort and add #947 (#164)

- Sorted Desktop list alphabetically to prevent possible duplicate entries in the future
- Added PC Manager and PowerToys' MouseWithoutBorders:

* Translation and localization update (#167)

* Improvement, translations update.

* Localization support for Device page Legion Go settings.

* Support GPD WIN MINI (Initial) (#169)

* allow LibreHardwareMonitor to start on HC startup (#171)

* Misc UI (#170)

* display "no virtual controller" error properly

* remove thread.Join() calls to avoid freezing the thread manager

* When XInput is drunk, add a delay

* safer thread manipulations

* improve threading management

* Update DynamicLightingManager.cs

* Fix optional uninstall of HidHide (#172)

* migrate fan control to PerformanceManager (#173)

* GPD WIN MINI Fan Control (#174)

* prevent crash on device cooperative level check (#176)

when device is null

* fix crash on HC close when an IGCL or ADLX task is running (#175)

* fix crash on HC close when an IGCL or ADLX task is running

* also check telemetry locks

* might be better to use Task.Delay on InitializeDirect3DDevice()

because it is called by SettingsManager

* test fix QT locks

* Build 0.20.4.0

* overlayfix

* VRAMUsage is MiB not %

* do not try and restore default GPU frequency on AMD GPUs

* Update HidHide to 1.4.202 (#182)

Fixing the rare case of soft-brick issue on uninstallation caused by a race condition

* Merge EA into Mainline

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Cedric Lewe <[email protected]>
Co-authored-by: Matthias Seys <[email protected]>
Co-authored-by: Abdullah Hamed <[email protected]>
Co-authored-by: CasperH2O <[email protected]>
Co-authored-by: CasperH2O <[email protected]>
Co-authored-by: Matthias Seys <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants