aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <ddevault@linode.com>2016-03-24 14:08:53 -0400
committerDrew DeVault <ddevault@linode.com>2016-03-24 14:08:53 -0400
commit5c85c018b4692e1bccedaf9d10be052b79e7dc63 (patch)
treef9cf3829b189547dbcef1fba71770c4f0bb081bd /sway
parent686530d5e8f21ed146a489ad8a477f9241dfc722 (diff)
downloadsway-5c85c018b4692e1bccedaf9d10be052b79e7dc63.tar.xz
Update to new WLC API
Diffstat (limited to 'sway')
-rw-r--r--sway/handlers.c54
-rw-r--r--sway/main.c3
2 files changed, 21 insertions, 36 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index cec63192..7d4ea263 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -706,38 +706,22 @@ static void handle_wlc_ready(void) {
}
}
-struct wlc_interface interface = {
- .output = {
- .created = handle_output_created,
- .destroyed = handle_output_destroyed,
- .resolution = handle_output_resolution_change,
- .focus = handle_output_focused,
- .render = {
- .pre = handle_output_pre_render,
- .post = handle_output_post_render
- }
- },
- .view = {
- .created = handle_view_created,
- .destroyed = handle_view_destroyed,
- .focus = handle_view_focus,
- .request = {
- .geometry = handle_view_geometry_request,
- .state = handle_view_state_request
- }
- },
- .keyboard = {
- .key = handle_key
- },
- .pointer = {
- .motion = handle_pointer_motion,
- .button = handle_pointer_button
- },
- .compositor = {
- .ready = handle_wlc_ready
- },
- .input = {
- .created = handle_input_created,
- .destroyed = handle_input_destroyed
- }
-};
+void register_wlc_handlers() {
+ wlc_set_output_created_cb(handle_output_created);
+ wlc_set_output_destroyed_cb(handle_output_destroyed);
+ wlc_set_output_resolution_cb(handle_output_resolution_change);
+ wlc_set_output_focus_cb(handle_output_focused);
+ wlc_set_output_render_pre_cb(handle_output_pre_render);
+ wlc_set_output_render_post_cb(handle_output_post_render);
+ wlc_set_view_created_cb(handle_view_created);
+ wlc_set_view_destroyed_cb(handle_view_destroyed);
+ wlc_set_view_focus_cb(handle_view_focus);
+ wlc_set_view_request_geometry_cb(handle_view_geometry_request);
+ wlc_set_view_request_state_cb(handle_view_state_request);
+ wlc_set_keyboard_key_cb(handle_key);
+ wlc_set_pointer_motion_cb(handle_pointer_motion);
+ wlc_set_pointer_button_cb(handle_pointer_button);
+ wlc_set_compositor_ready_cb(handle_wlc_ready);
+ wlc_set_input_created_cb(handle_input_created);
+ wlc_set_input_destroyed_cb(handle_input_destroyed);
+}
diff --git a/sway/main.c b/sway/main.c
index 7c712281..d4f18e9a 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -187,7 +187,8 @@ int main(int argc, char **argv) {
/* Changing code earlier than this point requires detailed review */
/* (That code runs as root on systems without logind, and wlc_init drops to
* another user.) */
- if (!wlc_init(&interface, argc, argv)) {
+ register_wlc_handlers();
+ if (!wlc_init2()) {
return 1;
}
register_extensions();