-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stylus input doesn't rotate. #1990
Comments
@jp7677 - may we lean on your knowledge here? |
Sorry, I should have added more detail in the original post. It didn't occur to me there might be a I think particularly relevant is:
For some reason the output isn't being mapped to the output, despite the option shown in my original post.
There seems to be a lot more going on for the "Finger" input than the "Pen" input, but I am not sure any of it is relevant apart from the last line about mapping to output. |
What happens if you add `mapToOutput` from the tablet section to your config? See https://labwc.github.io/labwc-config.5.html#tablet
|
The same behaviour (stylus input doesn't follow screen orientation) but in the logs it does say it is being mapped to that screen now. |
Is there any more information I can provide to help debug this? |
I have noticed that the cursor is correctly rotated, despite the actual stylus movements not being rotated. I've been trying to work this out without success, but I've wondered whether the rotation here should be coming from a non-static source? I haven't yet worked out what that source might be. Hopefully this is helpful to solve the problem or at least to tell me if I'm barking up the wrong tree! Just to confirm also, the issue still exists on 0.7.3 and latest HEAD. |
Are you okay to wait until @jp7677 has time to respond? They are the most knowledgeable on this. |
Of course. Sorry, I didn't mean to seem impatient. I know people have other things to do. |
Sorry for the late response, I was indeed away for a while. I'm seeing the same behavior on my machine using That said, I don't see (yet, not yet looked that closely) what we are doing differently for output mapping comparing to sway and where auto rotation should comes from in sway. Does your sway logs say anything interesting with regard to output mapping or even rotation? |
@dashavoo Do you have a chance to try this hack applied on labwc master? I just wanna make sure that I'm on the right track for your setup. Edit: Removed wrong approach.
|
Oh, i think i know what is going on. We (labwc) are subscribed directly to the tablet events (https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/include/wlr/types/wlr_tablet_tool.h#L70), but the tablet events also exists on So something like this is probably the correct fix: diff --git a/include/input/tablet.h b/include/input/tablet.h
index 93fdda5a..0ca11fae 100644
--- a/include/input/tablet.h
b/include/input/tablet.h
@@ -23,10 23,10 @@ struct drawing_tablet {
double slider;
double wheel_delta;
struct {
- struct wl_listener proximity;
- struct wl_listener axis;
- struct wl_listener tip;
- struct wl_listener button;
struct wl_listener tablet_tool_proximity;
struct wl_listener tablet_tool_axis;
struct wl_listener tablet_tool_tip;
struct wl_listener tablet_tool_button;
struct wl_listener destroy;
} handlers;
struct wl_list link; /* seat.tablets */
diff --git a/src/input/tablet.c b/src/input/tablet.c
index 743fa72e..c207b83f 100644
--- a/src/input/tablet.c
b/src/input/tablet.c
@@ -236,7 236,7 @@ notify_motion(struct drawing_tablet *tablet, struct drawing_tablet_tool *tool,
}
static void
-handle_proximity(struct wl_listener *listener, void *data)
handle_tablet_tool_proximity(struct wl_listener *listener, void *data)
{
struct wlr_tablet_tool_proximity_event *ev = data;
struct drawing_tablet *tablet = ev->tablet->data;
@@ -286,7 286,7 @@ handle_proximity(struct wl_listener *listener, void *data)
static bool is_down_mouse_emulation = false;
static void
-handle_axis(struct wl_listener *listener, void *data)
handle_tablet_tool_axis(struct wl_listener *listener, void *data)
{
struct wlr_tablet_tool_axis_event *ev = data;
struct drawing_tablet *tablet = ev->tablet->data;
@@ -460,7 460,7 @@ seat_pointer_end_grab(struct drawing_tablet_tool *tool,
}
static void
-handle_tip(struct wl_listener *listener, void *data)
handle_tablet_tool_tip(struct wl_listener *listener, void *data)
{
struct wlr_tablet_tool_tip_event *ev = data;
struct drawing_tablet *tablet = ev->tablet->data;
@@ -535,7 535,7 @@ handle_tip(struct wl_listener *listener, void *data)
}
static void
-handle_button(struct wl_listener *listener, void *data)
handle_tablet_tool_button(struct wl_listener *listener, void *data)
{
struct wlr_tablet_tool_button_event *ev = data;
struct drawing_tablet *tablet = ev->tablet->data;
@@ -604,10 604,10 @@ handle_destroy(struct wl_listener *listener, void *data)
wl_list_remove(&tablet->link);
tablet_pad_attach_tablet(tablet->seat);
- wl_list_remove(&tablet->handlers.tip.link);
- wl_list_remove(&tablet->handlers.button.link);
- wl_list_remove(&tablet->handlers.proximity.link);
- wl_list_remove(&tablet->handlers.axis.link);
wl_list_remove(&tablet->handlers.tablet_tool_tip.link);
wl_list_remove(&tablet->handlers.tablet_tool_button.link);
wl_list_remove(&tablet->handlers.tablet_tool_proximity.link);
wl_list_remove(&tablet->handlers.tablet_tool_axis.link);
wl_list_remove(&tablet->handlers.destroy.link);
free(tablet);
}
@@ -636,10 636,10 @@ tablet_init(struct seat *seat, struct wlr_input_device *wlr_device)
tablet->wheel_delta = 0.0;
wlr_log(WLR_INFO, "tablet dimensions: %.2fmm x %.2fmm",
tablet->tablet->width_mm, tablet->tablet->height_mm);
- CONNECT_SIGNAL(tablet->tablet, &tablet->handlers, axis);
- CONNECT_SIGNAL(tablet->tablet, &tablet->handlers, proximity);
- CONNECT_SIGNAL(tablet->tablet, &tablet->handlers, tip);
- CONNECT_SIGNAL(tablet->tablet, &tablet->handlers, button);
CONNECT_SIGNAL(tablet->seat->cursor, &tablet->handlers, tablet_tool_axis);
CONNECT_SIGNAL(tablet->seat->cursor, &tablet->handlers, tablet_tool_proximity);
CONNECT_SIGNAL(tablet->seat->cursor, &tablet->handlers, tablet_tool_tip);
CONNECT_SIGNAL(tablet->seat->cursor, &tablet->handlers, tablet_tool_button);
CONNECT_SIGNAL(wlr_device, &tablet->handlers, destroy);
wl_list_insert(&seat->tablets, &tablet->link); |
I am using a laptop with a touchscreen and stylus and using rot8 to rotate the screen based on orientation.
This works well under Xorg and Sway, but under labwc the rotation is only applying to the finger input, not the stylus input.
These are the lines from my
rc.xml
The same works under Sway when I run these commands:
The text was updated successfully, but these errors were encountered: