Skip to content

Commit

Permalink
[inactivity] Refactor inactivity module. Contributes to JB#31927
Browse files Browse the repository at this point in the history
Use common prefix for all functions in inactivity module and shuffle
code so that functions that are related are close to each other.

Install datapipe trackers for related state variables instead of
polling them here and there.

Split implementation of "activity callback" feature in three layers:
object memory management, list of objects management and dbus
method call handlers.

Instead of defaulting to "active" state on mce startup, make it so
that initial state depends on what display state mce lands on. Also
make sure that a) on mce startup the initial state is always broadcast
b) the same state is not broadcast repeatedly.

Simplify code by omitting return value tracking in callback functions
where the return value is not actually used for anything meaningful.
  • Loading branch information
spiiroin committed Sep 2, 2015
1 parent e1888a0 commit b2f2416
Show file tree
Hide file tree
Showing 3 changed files with 931 additions and 545 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -555,6 +555,7 @@ NORMALIZE_USES_SPC =\
modules/doubletap.h\
modules/filter-brightness-simple.h\
modules/keypad.h\
modules/inactivity.c\
modules/memnotify.c\
modules/memnotify.h\
modules/packagekit.c\
Expand Down Expand Up @@ -606,7 +607,6 @@ NORMALIZE_USES_TAB =\
modules/filter-brightness-als.c\
modules/filter-brightness-als.h\
modules/filter-brightness-simple.c\
modules/inactivity.c\
modules/keypad.c\
modules/led.c\
modules/led.h\
Expand Down
2 changes: 1 addition & 1 deletion datapipe.c
Expand Up @@ -842,7 +842,7 @@ void mce_datapipe_init(void)
setup_datapipe(&touchscreen_pipe, READ_ONLY, FREE_CACHE,
sizeof (struct input_event), NULL);
setup_datapipe(&device_inactive_pipe, READ_WRITE, DONT_FREE_CACHE,
0, GINT_TO_POINTER(FALSE));
0, GINT_TO_POINTER(TRUE));
setup_datapipe(&lockkey_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(0));
setup_datapipe(&keyboard_slide_pipe, READ_ONLY, DONT_FREE_CACHE,
Expand Down

0 comments on commit b2f2416

Please sign in to comment.