Skip to content

Commit

Permalink
Make compositor D-Bus service run state globally available
Browse files Browse the repository at this point in the history
Add compositor available datapipe and update it from display plugin.
  • Loading branch information
spiiroin committed Jan 22, 2015
1 parent 298c8ce commit 8c260c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datapipe.c
Expand Up @@ -154,6 +154,9 @@ datapipe_struct thermal_state_pipe;
/** Heartbeat; read only */
datapipe_struct heartbeat_pipe;

/** compositor availability; read only */
datapipe_struct compositor_available_pipe;

/** lipstick availability; read only */
datapipe_struct lipstick_available_pipe;

Expand Down Expand Up @@ -862,6 +865,8 @@ void mce_datapipe_init(void)
0, GINT_TO_POINTER(THERMAL_STATE_UNDEF));
setup_datapipe(&heartbeat_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(0));
setup_datapipe(&compositor_available_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(FALSE));
setup_datapipe(&lipstick_available_pipe, READ_ONLY, DONT_FREE_CACHE,
0, GINT_TO_POINTER(FALSE));
setup_datapipe(&dsme_available_pipe, READ_ONLY, DONT_FREE_CACHE,
Expand Down Expand Up @@ -931,6 +936,7 @@ void mce_datapipe_quit(void)
free_datapipe(&master_radio_pipe);
free_datapipe(&system_state_pipe);
free_datapipe(&heartbeat_pipe);
free_datapipe(&compositor_available_pipe);
free_datapipe(&lipstick_available_pipe);
free_datapipe(&dsme_available_pipe);
free_datapipe(&packagekit_locked_pipe);
Expand Down
1 change: 1 addition & 0 deletions datapipe.h
Expand Up @@ -130,6 +130,7 @@ extern datapipe_struct jack_sense_pipe;
extern datapipe_struct power_saving_mode_pipe;
extern datapipe_struct thermal_state_pipe;
extern datapipe_struct heartbeat_pipe;
extern datapipe_struct compositor_available_pipe;
extern datapipe_struct lipstick_available_pipe;
extern datapipe_struct dsme_available_pipe;
extern datapipe_struct packagekit_locked_pipe;
Expand Down
6 changes: 6 additions & 0 deletions modules/display.c
Expand Up @@ -5652,6 +5652,12 @@ static void mdy_stm_compositor_name_owner_changed(const char *name,
* Turning the display on at lipstick runstate change
* deals with both (a) and (b) */
mdy_stm_push_target_change(MCE_DISPLAY_ON);

/* and finally broadcast within mce */
bool available = mdy_compositor_is_available();
execute_datapipe(&compositor_available_pipe,
GINT_TO_POINTER(available),
USE_INDATA, CACHE_INDATA);
}

/** react to systemui availability changes
Expand Down

0 comments on commit 8c260c4

Please sign in to comment.