feat: add ipc dispatch
This commit is contained in:
@@ -167,6 +167,13 @@ I would probably just submit raphi's patchset but I don't think that would be po
|
|||||||
<description summary="Quit maomao">This request allows clients to instruct the compositor to quit maomao.</description>
|
<description summary="Quit maomao">This request allows clients to instruct the compositor to quit maomao.</description>
|
||||||
</request>
|
</request>
|
||||||
|
|
||||||
|
<request name="dispatch" since="2">
|
||||||
|
<description summary="Set the active tags of this output"/>
|
||||||
|
<arg name="dispatch" type="string" summary="dispatch name."/>
|
||||||
|
<arg name="arg1" type="string" summary="arg1."/>
|
||||||
|
<arg name="arg2" type="string" summary="arg2."/>
|
||||||
|
</request>
|
||||||
|
|
||||||
<!-- Version 2 -->
|
<!-- Version 2 -->
|
||||||
<event name="fullscreen" since="2">
|
<event name="fullscreen" since="2">
|
||||||
<description summary="Update fullscreen status">
|
<description summary="Update fullscreen status">
|
||||||
|
|||||||
17
src/maomao.c
17
src/maomao.c
@@ -494,6 +494,8 @@ static void dwl_ipc_output_set_tags(struct wl_client *client,
|
|||||||
uint32_t tagmask, uint32_t toggle_tagset);
|
uint32_t tagmask, uint32_t toggle_tagset);
|
||||||
static void dwl_ipc_output_quit(struct wl_client *client,
|
static void dwl_ipc_output_quit(struct wl_client *client,
|
||||||
struct wl_resource *resource);
|
struct wl_resource *resource);
|
||||||
|
static void dwl_ipc_output_dispatch(struct wl_client *client,
|
||||||
|
struct wl_resource *resource,const char *dispatch,const char* arg1,const char* arg2);
|
||||||
static void dwl_ipc_output_release(struct wl_client *client,
|
static void dwl_ipc_output_release(struct wl_client *client,
|
||||||
struct wl_resource *resource);
|
struct wl_resource *resource);
|
||||||
static void focusclient(Client *c, int lift);
|
static void focusclient(Client *c, int lift);
|
||||||
@@ -703,6 +705,7 @@ static struct zdwl_ipc_output_v2_interface dwl_output_implementation = {
|
|||||||
.release = dwl_ipc_output_release,
|
.release = dwl_ipc_output_release,
|
||||||
.set_tags = dwl_ipc_output_set_tags,
|
.set_tags = dwl_ipc_output_set_tags,
|
||||||
.quit = dwl_ipc_output_quit,
|
.quit = dwl_ipc_output_quit,
|
||||||
|
.dispatch = dwl_ipc_output_dispatch,
|
||||||
.set_layout = dwl_ipc_output_set_layout,
|
.set_layout = dwl_ipc_output_set_layout,
|
||||||
.set_client_tags = dwl_ipc_output_set_client_tags};
|
.set_client_tags = dwl_ipc_output_set_client_tags};
|
||||||
|
|
||||||
@@ -3493,6 +3496,20 @@ void dwl_ipc_output_quit(struct wl_client *client,
|
|||||||
quit(&(Arg){0});
|
quit(&(Arg){0});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dwl_ipc_output_dispatch(struct wl_client *client,
|
||||||
|
struct wl_resource *resource,
|
||||||
|
const char *dispatch, const char *arg1,
|
||||||
|
const char *arg2) {
|
||||||
|
|
||||||
|
void (*func)(const Arg *);
|
||||||
|
Arg arg;
|
||||||
|
func = parse_func_name((char*)dispatch, &arg, (char*)arg1, (char*)arg2);
|
||||||
|
if(func) {
|
||||||
|
func(&arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void dwl_ipc_output_release(struct wl_client *client,
|
void dwl_ipc_output_release(struct wl_client *client,
|
||||||
struct wl_resource *resource) {
|
struct wl_resource *resource) {
|
||||||
wl_resource_destroy(resource);
|
wl_resource_destroy(resource);
|
||||||
|
|||||||
Reference in New Issue
Block a user