| 161 | } |
| 162 | |
| 163 | static int get_screen_brightness(bool emit) { |
| 164 | if (paused_state) { |
| 165 | return 0; |
| 166 | } |
| 167 | |
| 168 | double new_br = 0.0f; |
| 169 | SYSBUS_ARG_REPLY(args, parse_bus_reply, &new_br, CLIGHTD_SERVICE, "/org/clightd/clightd/Screen", "org.clightd.clightd.Screen", "GetEmittedBrightness"); |
| 170 | |
| 171 | screen_msg.bl.old = state.screen_br; |
| 172 | int ret = call(&args, "ss", fetch_display(), fetch_env()); |
| 173 | if (ret == 0 && emit) { |
| 174 | state.screen_br = new_br; |
| 175 | screen_msg.bl.new = state.screen_br; |
| 176 | M_PUB(&screen_msg); |
| 177 | } |
| 178 | return ret; |
| 179 | } |
| 180 | |
| 181 | static void timeout_callback(int old_val, bool reset) { |
| 182 | if (conf.screen_conf.timeout[state.ac_state] <= 0) { |
no test coverage detected