- Create new file `led_wireless.c` to contain wireless-related led
functionality.
- Move `updatergb_darkcore` functionality to `updatergb_wireless`.
- Extend `updatergb_wireless` with K63_WL support.
- Replace `updatergb_darkcore` with `updatergb_wireless`.
- Add conditional usage of `updatergb_wireless` for K63_WL devices.
- Rename compile flag `OSX_DEPLOYMENT_TARGET` ->
`CMAKE_OSX_DEPLOYMENT_TARGET`, and
- bump deployment target from 10.11 to 10.12 for non-legacy builds.
- Amend `showAnimBox` label with qualifier to when animation is shown,
and
- add paragraph to its tooltip property to explain what the intention is
behind the auto-suspension of the animation preview.
- Create private methods to reuse preview animation signal dis-/connecting,
- create signal handler for `qApp->applicationStateChanged` signal, that
uses the private methods to start/stop animation preview depending on
new application state (preview, if active, else stop).
The segfault was based on a race condition between resetting/closing of
one of the attached devices, a subsequent input event that was handled
by another device's CFRunLoop callback, and a mutex lock.
Fix:
- Listen for `reset_stop` - which is set by `quit` when shutting down
the daemon - to stop processing input urbs.
Specific versions of glibc flagged read(2) and write(2) with
`warn-unused-results`. As it didn't suffice to cast the call to void,
this commit bypasses the warning by assigning the return value to a
variable that is then cast to void.
This commit introduces a safer signal handling routine by splitting this
workflow into catching and handling of signals. In the catching routine
no unsafe function call is allowed (signal-safety(7)).
The general idea is generate a local socketpair (acting as an anonymous
pipe) that is written to with the caught signal type in the direct
sighandler routine. The calling of the routine that actually handles the
interrupts is elevated to the main loops, where the pipe is monitored.
As soon as data is available on the pipe it is read and the
sighandling-routine is called manually. This allows for greater freedom
of function calls to handle the signal with.
- Create anonymous socket pair for sending/receiving intent, only setup
signal handlers if the socket pair exists.
- Call `write` to sender side of socket pair in signal-catching
function.
- Replace `printf` with signal-safe `write` function in nested
`ignore_signal` handler.
- [usb] Declare the socket pair and the exit condition as externally
defined for calling them from inside the main loops.
- [macOS] Setup and read from receiver side via a core foundation socket
object, that is registered as a CF Run Loop Source, deconstructed into
a native socket and read from in the appropriate handler.
- [linux] Check whether data is available on the pipe when `select`
returns -1, indicating that there has been an error (e.g. a signal).
Manually call the signal handling routine with the read data if there
is.
- Merge `quit` and `quitWithLock` functions, as the latter was called
exclusively from the former.
- Remove the parameter as this also was always the same fixed value.
This commit basically reverts the function to restart the daemon which
was introduced in 64bebfef. This decision was based on the fact, that
this functionality is a) not widespreadedly enough used to b) justify
the suboptimal implementation (and its impact on the debugging).
commit a6b12a95fa
Author: Karl Fleischmann <[email protected]>
Date: Tue Jan 8 13:25:28 2019 +0100
Fix thread names on macOS
In BSD systems apparently `pthread_setname_np` is not used to externally
name threads but only to name the current thread.
This commit changes the thread-naming calls in the following way:
- Guard thread-naming calls in global code sections to only occur in
non-mac environments.
- Move mac-specific indicatorthread naming into the appropriate thread
(fixing a previously introduced syntax error).
commit 1651ae2eae
Author: Karl Fleischmann <[email protected]>
Date: Tue Jan 8 12:26:15 2019 +0100
Set thread names for debugging
- Define max name length for thread names (16 chars including the null
terminator '\0').
- Include "os.h" in `src/daemon/input.c` to define `_GNU_SOURCES` for
`pthread_setname_np`.
- Call `pthread_setname_np` for each thread we create to help debugging
them.
To have the correct signature for `IS_V3_OVERRIDE` to work correctly,
`fakekb` needs to be a pointer to a struct (to have the `->` accessor
available).
The addition of the CoC was unsolicited and again I'm sorry. :/
To mend this:
- Remove Code of Conduct file.
- Replace link to file with short summary of what our current policy on
inappropriate behavior is.
Change some implementation aspect of the daemon-dialog:
- Replace custom form widget with QMessageBox.
- Make message box a critical warning.
- Add translations.
Change the warning-icon to a critical error icon to indicate the
severity of the problem. This change conforms with the devs decision to
make it clear how unusable the GUI is without the daemon.
- Replace the singular strings with a full, rich text version of how to
handle the issue.
- Setup the message box locally, as it's not persistent across main
window state (as was previously the case).
- Show the main window early and the dialog afterwards, if the daemon
is not running. The former is necessary, as otherwise the dialog/modal
will delay further execution on early execution (as in earlier than
the mainwindow showing).
As the first step in replacing the daemondialog with a QMessageBox this
commit removes all explicit daemondialog files and their uses in the
mainwindow.
Use the previously defined daemon-related check to show the (already
constructed) dialog.
- Add DaemonDialog header/member to main window's header file.
- Define messages to show for mac/linux users.
NOTE: This only shows `systemctl` commands. This might need more work
to also include upstart-related commands.
- Show dialog, if daemon is assumed to not run.
- Add ui file, that describes the layout of the dialog.
- Add basic header and implementation file, that instantiates the dialog
with start/enable command label texts.
- Setup dialog for compilation by adding these files to their
appropriate lists in the project file.
Instead of the pidfile's existance and readability, the check now only
includes the root device path. This is possible, as it is created by the
daemon and is hence not existing when the daemon doesn't run.
Add a check in startup routine of main window to determine, whether the
daemon has already created the root dev path with an accompanying "/pid"
file. If no daemon is running, set the settings panel's status
accordingly.
NOTE:
There is still a dialog missing to really convey to the user, that the
daemon is not running and how they are able to start/enable them for
their appropriate system.
Depending on how much we want to assume that the daemon is running, this
check can be narrowed/widened (i.e. check for pid in the file and make
sure there is a process running resp. only check for the root device
path to exist).
As mentioned in Issue #125 the `ckb` program lacks a way of inspecting
the available command line switches. A `--help` option was added to
dispaly and elaborate on the available options.
To streamline the experience and make the program anticipate further
command line options, implement the default QCommandLineParser
functionality as documented in
http://doc.qt.io/qt-5/qcommandlineparser.html