Skip to content

Commit

Permalink
compositor.c: Prepare output information in create
Browse files Browse the repository at this point in the history
Makes things such as wlc_output_get_name work in output.created
@SirCmpwn
  • Loading branch information
Cloudef committed Aug 16, 2015
1 parent 3f9d86e commit 94ce0ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/compositor/compositor.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,10 @@ add_output(struct wlc_compositor *compositor, struct wlc_backend_surface *bsurfa
{
assert(compositor && bsurface && info);

bool created = false;
struct wlc_output *output;
if (!(output = get_surfaceless_output(compositor)) && (output = wlc_handle_create(&compositor->outputs)))
WLC_INTERFACE_EMIT(output.created, convert_to_wlc_handle(output));
created = true;

if (!output) {
wlc_backend_surface_release(bsurface);
Expand All @@ -382,6 +383,9 @@ add_output(struct wlc_compositor *compositor, struct wlc_backend_surface *bsurfa
wlc_output_set_information(output, info);
wlc_output_set_backend_surface(output, bsurface);

if (created && WLC_INTERFACE_EMIT_EXCEPT(output.created, false, convert_to_wlc_handle(output)))
wlc_output_terminate(output);

if (!compositor->active.output)
active_output(compositor, output);

Expand Down

0 comments on commit 94ce0ca

Please sign in to comment.