-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[WIP] Make a tap on a windows title bar focus it #5265
base: master
Are you sure you want to change the base?
Conversation
This is my first attempt, which is basically a simplified copy of the mouse down even handling
ccec906
to
daad8c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sway_log(SWAY_ERROR, "Touch Event on Titlebar"); | ||
node = seat_get_focus_inactive(seat, &cont->node); | ||
seat_set_focus(seat, node); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need this return
, since this is the end of the function anyway.
bool on_titlebar = cont && !on_border && !surface; | ||
|
||
if (on_titlebar) { | ||
sway_log(SWAY_ERROR, "Touch Event on Titlebar"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't an error :)
@@ -17,6 +17,7 @@ struct sway_seatop_impl { | |||
enum wlr_button_state state); | |||
void (*motion)(struct sway_seat *seat, uint32_t time_msec, | |||
double dx, double dy); | |||
void (*touch_down)(struct sway_seat *seat, uint32_t time_msec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in terms of placement, this is not a good line to put this on. button
/motion
/axis
all refer to pointers, so having a touch handler in the middle is a bit weird. Same with the decl of the prototype, and .touch_down = handle_touch_down,
.
You're right, #5229 does have the the same effect. Does it make sense to reuse this code to get moving windows, to work with that, using mod + dragging a window, for example? |
I suspect that #5229 enables mod + dragging a window that doesn't bind touch (like a Wayland-native terminal, e.g. alacritty or kitty), but not one that does (e.g. I expect If that's the case, then adding a seatop handler for touch should allow for that case too. That's roughly the stage tablet support is at currently. The motion handler, for instance, can be shimmed for seatops that don't care about the distinction between pointer and touch motion. |
@Xyene yes it does, the position is not updated on motion though, only after lifting the finger, I have to check that out. Edit: fixed Alacritty btw does seem to bind to touch, but not use it (https://github.com/alacritty/alacritty/blob/33abfe34a86863958e70a6b5109eab5740a6bc81/alacritty/src/event.rs#L619, I think it's simply part of the library they are using) - kitty doesn't though, that's what I'm using to test the cursor simulation stuff. |
We can't do anything about these clients. Would you mind opening a winit issue to let them know about this issue? |
That's good to know, I made a false assumption here that because it didn't bind tablet it would also not be binding touch, but that's not the case. |
|
This is my first attempt, which is basically a simplified copy of the
mouse down even handling.
this should fix #4182