30 Commits
Author SHA1 Message Date
Karl Fleischmann 8da399e4fb Make wireless code work for K63WL 2021-06-21 01:31:24 +03:00
Karl Fleischmann 6a7d288aaf Update DARK CORE keymap/lighting layout
- Amend position of rendered image.
- Remove non-existing keys; Fix existing but incorrectly placed keys.
2021-06-21 01:31:23 +03:00
Karl Fleischmann 44a3785f18 Outfactor updatergb_wireless
- 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.
2021-06-21 01:31:23 +03:00
Karl Fleischmann c2b692528f Add daemon-restart script
- Add script to unload/load the daemon, and
- add installation instructions into gui setup.
2019-10-08 04:10:32 +03:00
Karl Fleischmann bdba530bbf Fix deployment target typo in macOS build scripts
- Rename compile flag `OSX_DEPLOYMENT_TARGET` ->
  `CMAKE_OSX_DEPLOYMENT_TARGET`, and
- bump deployment target from 10.11 to 10.12 for non-legacy builds.
2019-09-05 15:47:11 +02:00
Karl Fleischmann f5a79f4b43 Improve UI to display auto-suspend of animation
- 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.
2019-07-24 00:54:54 +03:00
Karl Fleischmann 3e14acb48a Toggle animation preview on state change
- 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).
2019-07-24 00:54:54 +03:00
Karl Fleischmann 505240084e Fix segfault on macOS when quitting
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.
2019-06-01 16:22:13 +02:00
Karl Fleischmann e3081a3dec Silence overeager warning about unused-results
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.
2019-03-06 15:50:29 +01:00
Karl Fleischmann cafcdfff16 Improve safety of signal handling
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.
2019-03-05 19:25:11 +02:00
Karl Fleischmann 4fa56362e4 Flatten unnecessary quitting-hierarchy
- 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.
2019-01-25 21:46:47 +01:00
Karl Fleischmann 6238178a35 Remove restarting capabilities
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).
2019-01-25 21:28:23 +01:00
Karl Fleischmann f24988ab68 Squashed commit of the following:
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.
2019-01-10 10:02:51 +02:00
Karl Fleischmann b92dd59a80 Make fakekb a pointer
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).
2018-02-12 18:02:20 +01:00
Karl Fleischmann 290e55ec97 Remove CoC and link in Readme
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.
2018-01-24 12:43:59 +01:00
Karl Fleischmann 231651891e Add code of conduct
NOTE: I put myself as the contact person for now, this should probably
      be changed sometime soon.
2018-01-22 16:44:50 +01:00
Karl Fleischmann 074c114e99 Merge branch 'chore/change-deamon-dialog-implementation'
Change some implementation aspect of the daemon-dialog:
- Replace custom form widget with QMessageBox.
- Make message box a critical warning.
- Add translations.
2018-01-13 00:33:31 +01:00
Karl Fleischmann 5ddeb805d9 Omit code lines from translations
Remove calls to `tr()` for lines that only contain executable code, as
this will probably not be necessary for translation.
2018-01-13 00:29:57 +01:00
Karl Fleischmann 1286b70d69 Change severity level of message box
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.
2018-01-12 22:36:04 +01:00
Karl Fleischmann 789ba0a947 Implement the daemon dialog via a QMessageBox
- 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).
2018-01-10 20:31:06 +01:00
Karl Fleischmann c32fc4e46f Remove daemondialog files
As the first step in replacing the daemondialog with a QMessageBox this
commit removes all explicit daemondialog files and their uses in the
mainwindow.
2018-01-10 20:16:37 +01:00
Karl Fleischmann fb149a77f4 [WIP] Show daemon dialog if it is not running
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.
2017-12-13 12:46:00 +01:00
Karl Fleischmann 0cf6877372 [WIP] Create daemon dialog
- 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.
2017-12-13 12:46:00 +01:00
Karl Fleischmann ebb0bcb8b6 [WIP] Simplify check for whether daemon is running
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.
2017-12-13 12:46:00 +01:00
Karl Fleischmann f4033c20da [WIP] Check, whether daemon created root dev path
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).
2017-12-13 12:46:00 +01:00
Karl Fleischmann 1a219efb0e Additional hid checks for FWv3
In addition to checking the input, output and feature sizes query the
version number key to determine, whether a device is above FWv3.
2017-12-04 20:40:37 +01:00
Karl Fleischmann 9ed6541d3d Merge branch 'auibrian-issue29' into testing
This merge closes PR #106 and thus issue #29.
2017-04-28 11:34:55 +02:00
Karl Fleischmann d62b7ff9a8 Amend changes
Incorporate suggestions from @light2yellow from the PR.
2017-02-16 11:47:53 +01:00
Karl Fleischmann cd57ffedae Add CMD/Shift+select issue to Known Issues
This was a recommendation of @clodal in #29.
2017-02-16 10:13:59 +01:00
Karl Fleischmann 6974bcd79f Implement CommandLineParser in main.cpp
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
2016-01-08 14:55:06 +01:00