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

rfkill code refactoring #1015

Merged
merged 6 commits into from
Feb 11, 2021
Merged

rfkill code refactoring #1015

merged 6 commits into from
Feb 11, 2021

Commits on Feb 10, 2021

  1. fix(rfkill): accept events larger than v1 event size

    Kernel 5.11 added one more field to the `struct rfkill_event` and broke
    unnecessarily strict check in `rfkill.cpp`. According to `linux/rfkill.h`,
    we must accept events at least as large as v1 event size and should be
    prepared to get additional fields at the end of a v1 event structure.
    alebastr committed Feb 10, 2021
    Configuration menu
    Copy the full SHA
    40f4dc9 View commit details
    Browse the repository at this point in the history
  2. refactor(rfkill): poll rfkill events from Glib main loop

    Open rfkill device only once per module.
    Remove rfkill threads and use `Glib::signal_io` as a more efficient way
    to poll the rfkill device.
    Handle runtime errors from rfkill and stop polling of the device instead
    of crashing waybar.
    alebastr committed Feb 10, 2021
    Configuration menu
    Copy the full SHA
    38c29fc View commit details
    Browse the repository at this point in the history
  3. refactor(bluetooth): remove Bluetooth::status_

    The string was always overwritten in `update()`; don't need to store
    temporary value in the class.
    alebastr committed Feb 10, 2021
    Configuration menu
    Copy the full SHA
    ecc32dd View commit details
    Browse the repository at this point in the history
  4. refactor(bluetooth): remove interval and timer thread

    The timer thread was always reading the same value from Rfkill state.
    alebastr committed Feb 10, 2021
    Configuration menu
    Copy the full SHA
    52dd3d2 View commit details
    Browse the repository at this point in the history
  5. fix(network): don't block the main thread on rfkill update

    Moving rfkill to the main event loop had unexpected side-effects.
    Notably, the network module mutex can block all the main thread events
    for several seconds while the network worker thread is sleeping.
    
    Instead of waiting for the mutex let's hope that the worker thread
    succeeds and schedule timer thread wakeup just in case.
    alebastr committed Feb 10, 2021
    Configuration menu
    Copy the full SHA
    6d5afda View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e786ea6 View commit details
    Browse the repository at this point in the history