mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
parent
2d4bc66f11
commit
415267ac13
3 changed files with 143 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <wlr/interfaces/wlr_output.h>
|
||||
#include <wlr/interfaces/wlr_pointer.h>
|
||||
#include <wlr/interfaces/wlr_touch.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
||||
#include "backend/x11.h"
|
||||
|
|
@ -80,6 +81,7 @@ static void output_destroy(struct wlr_output *wlr_output) {
|
|||
struct wlr_x11_backend *x11 = output->x11;
|
||||
|
||||
wlr_input_device_destroy(&output->pointer_dev);
|
||||
wlr_input_device_destroy(&output->touch_dev);
|
||||
|
||||
wl_list_remove(&output->link);
|
||||
wl_event_source_remove(output->frame_timer);
|
||||
|
|
@ -167,7 +169,10 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
|
|||
XCB_INPUT_XI_EVENT_MASK_BUTTON_RELEASE |
|
||||
XCB_INPUT_XI_EVENT_MASK_MOTION |
|
||||
XCB_INPUT_XI_EVENT_MASK_ENTER |
|
||||
XCB_INPUT_XI_EVENT_MASK_LEAVE,
|
||||
XCB_INPUT_XI_EVENT_MASK_LEAVE |
|
||||
XCB_INPUT_XI_EVENT_MASK_TOUCH_BEGIN |
|
||||
XCB_INPUT_XI_EVENT_MASK_TOUCH_END |
|
||||
XCB_INPUT_XI_EVENT_MASK_TOUCH_UPDATE,
|
||||
};
|
||||
xcb_input_xi_select_events(x11->xcb, output->win, 1, &xinput_mask.head);
|
||||
|
||||
|
|
@ -201,8 +206,16 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
|
|||
output->pointer_dev.pointer = &output->pointer;
|
||||
output->pointer_dev.output_name = strdup(wlr_output->name);
|
||||
|
||||
wlr_input_device_init(&output->touch_dev, WLR_INPUT_DEVICE_TOUCH,
|
||||
&input_device_impl, "X11 touch", 0, 0);
|
||||
wlr_touch_init(&output->touch, &touch_impl);
|
||||
output->touch_dev.touch = &output->touch;
|
||||
output->touch_dev.output_name = strdup(wlr_output->name);
|
||||
wl_list_init(&output->touchpoints);
|
||||
|
||||
wlr_signal_emit_safe(&x11->backend.events.new_output, wlr_output);
|
||||
wlr_signal_emit_safe(&x11->backend.events.new_input, &output->pointer_dev);
|
||||
wlr_signal_emit_safe(&x11->backend.events.new_input, &output->touch_dev);
|
||||
|
||||
return wlr_output;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue