MCPcopy Create free account
hub / github.com/FedeDP/Clight / init

Function init

src/modules/screen.c:30–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28MODULE_WITH_PAUSE("SCREEN");
29
30static void init(void) {
31 M_SUB(AMBIENT_BR_UPD);
32 M_SUB(SCR_TO_REQ);
33 M_SUB(UPOWER_UPD);
34 M_SUB(DISPLAY_UPD);
35 M_SUB(SENS_UPD);
36 M_SUB(LID_UPD);
37 M_SUB(SUSPEND_UPD);
38 M_SUB(NO_AUTOCALIB_UPD);
39 M_SUB(INHIBIT_UPD);
40 M_SUB(CONTRIB_REQ);
41
42 if (get_screen_brightness(false) != 0) {
43 // We are on an unsupported wayland compositor; kill ourself immediately without further message processing
44 WARN("Failed to init. Killing module.\n");
45 module_deregister((self_t **)&self());
46 } else {
47 m_become(waiting_state);
48 init_Screen_api();
49 }
50}
51
52static bool check(void) {
53 return true;

Callers

nothing calls this directly

Calls 1

get_screen_brightnessFunction · 0.85

Tested by

no test coverage detected