Commit graph

9 commits

Author SHA1 Message Date
Tobi-wan Kenobi
1a4cddb0b6 [core] Fix callback registration ("shadowed" events)
Until now, as soon as a widget registered *any* callback, the default
callbacks (e.g. scroll up/down to go to next/previous workspace) didn't
work anymore, as there was a better match for the general registration
(even though not for the button).

To fix this, merge the callback registration into a flat registration,
where a key is calculated from the ID of the registrar and the
registered button.

see #23
2016-12-11 07:38:56 +01:00
Tobi-wan Kenobi
8f6bb7b45d [core/input] Remove "valid input required" logic from input
Accidentially committed a experimental way to enforce waiting for a
valid input, mainly for testing.

see #23
2016-12-10 18:22:05 +01:00
Tobi-wan Kenobi
771c597ce9 [modules/caffeine] Re-implement caffeine module
Add caffeine module & add a framework for testing it (no tests yet,
though).

see #23
2016-12-10 15:36:18 +01:00
Tobi-wan Kenobi
029492e16d [core] Non-blocking input thread for i3bar events
Make input thread non-blocking by using select(). This increases the CPU
utilization a bit (depending on the timeout), but makes the thread exit
cleanly, even if an exception is thrown in the main thread.

see #23
2016-12-10 13:45:54 +01:00
Tobi-wan Kenobi
0489ce1b51 [core/engine] Register wheel up/down callbacks for desktop switch
Switch desktop to prev/next on wheel up/down.

see #23
2016-12-10 12:14:12 +01:00
Tobi-wan Kenobi
c820223d0c [core/input] Execute commands in background
When spawning a command from an input interaction, do it in the
background, so as to not block further interactions.

see #23
2016-12-10 10:47:23 +01:00
Tobi-wan Kenobi
918d7a6046 [core/input] Add callback deregistration
Enable components to unregister callbacks (i.e. for dynamic widgets).

see #23
2016-12-10 10:26:07 +01:00
Tobi-wan Kenobi
38a42e4a77 [tests/cmus] Add tests for cmus mouse interaction
see #23
2016-12-10 08:37:04 +01:00
Tobi-wan Kenobi
e72c25b0bc [core] Add input processing
Create infrastructure for input event handling and add i3bar event
processing. For each event, callbacks can be registered in the input
module.
Modules and widgets both identify themselves using a unique ID (the
module name for modules, a generated UUID for the widgets). This ID is
then used for registering the callbacks. This is possible since both
widgets and modules are statically allocated & do not change their IDs.

Callback actions can be either callable Python objects (in which case
the event is passed as parameter), or strings, in which case the string
is interpreted as a shell command.

see #23
2016-12-09 19:29:16 +01:00