add new-output handler
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "seat.h"
|
||||
|
||||
#include "river-control-unstable-v1.h"
|
||||
#include "call-new-output-handler.h"
|
||||
|
||||
/**
|
||||
* ISO C forbids casting a function pointer to a void pointer because on some
|
||||
@@ -77,7 +78,29 @@ static SCM install_handler (SCM key, SCM proc)
|
||||
return SCM_UNSPECIFIED;
|
||||
}
|
||||
|
||||
if ( scm_is_eq(scm_from_utf8_symbol("layout-demand"), key) == 1 )
|
||||
if ( scm_is_eq(scm_from_utf8_symbol("new-output"), key) == 1 )
|
||||
{
|
||||
context.mode = CONTINOUS;
|
||||
context.new_output_handler = proc;
|
||||
|
||||
/* Call handler for all already existing outputs. */
|
||||
struct Output *output;
|
||||
wl_list_for_each(output, &context.outputs, link)
|
||||
{
|
||||
struct Call_new_output_handler_parameters params = {
|
||||
.output = output,
|
||||
};
|
||||
|
||||
void *res = scm_with_guile(call_new_output_handler, (void *)¶ms);
|
||||
if ( res != NULL )
|
||||
{
|
||||
fputs(res, stderr);
|
||||
fputs("INFO: This error is not fatal.\n", stderr);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( scm_is_eq(scm_from_utf8_symbol("layout-demand"), key) == 1 )
|
||||
{
|
||||
if ( context.layout_manager == NULL )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user