Comments (5)
I like the general approach by @tokyo4j above as it basically just interprets the touch down event on the window the same as a mouse click by calling the same binding. This still leaves the user in control of the config (I think by default it is Focus
and Raise
). Some potential issues with the approach are a) the Frame
context and b) closing open menus (root / window menu). Maybe we could either re-use some currently internal function from src/input/cursor.c
here or add a public abstraction there which allows for such use. Then we would have the code in a central place.
An alternative approach could be to synthesize a usual cursor click but somehow prevent it from being forwarded to the actual surface. That might also have some issues though (like seat_set_pressed()
tracking and the whole cursor_update_common()
logic).
from labwc.
Something like this, in addition to #1550 ?
diff --git a/src/input/touch.c b/src/input/touch.c
index 1650059..048aaf2 100644
--- a/src/input/touch.c
+++ b/src/input/touch.c
@@ -7,6 +7,9 @@
#include "idle.h"
#include "input/touch.h"
#include "labwc.h"
+#include "config/mousebind.h"
+#include "action.h"
+#include "view.h"
/* Holds layout -> surface offsets to report motion events in relative coords */
struct touch_point {
@@ -109,6 +112,16 @@ touch_down(struct wl_listener *listener, void *data)
double sx = lx - x_offset;
double sy = ly - y_offset;
+ struct view *view = view_from_wlr_surface(touch_point->surface);
+ struct mousebind *mousebind;
+ wl_list_for_each(mousebind, &rc.mousebinds, link) {
+ if (mousebind->mouse_event == MOUSE_ACTION_PRESS
+ && mousebind->button == BTN_LEFT
+ && mousebind->context == LAB_SSD_CLIENT) {
+ actions_run(view, seat->server, &mousebind->actions, 0);
+ }
+ }
+
wlr_seat_touch_notify_down(seat->seat, touch_point->surface,
event->time_msec, event->touch_id, sx, sy);
} else {
from labwc.
There is also view_move_to_front
(https://github.com/labwc/labwc/blob/master/src/view.c#L1926), which might be an alternative, like:
struct view *view = view_from_wlr_surface(touch_point->surface);
if (view) {
view_move_to_front(view);
}
That said, I'm not sure if that snippet is sufficient for focus management and guarding. There is also desktop_focus_view
(https://github.com/labwc/labwc/blob/master/src/desktop.c#L41), but that on the other hand might be a bit overkill for every touch-down.
from labwc.
For the time being, I've added @tokyo4j 's suggestion to the existing PR to make headerbar touches work - I've tried it here and it seems to work for me; if it turns out not to be the best solution, we've at least got all the touch stuff on the same PR for now!
from labwc.
Thanks! Should be fixed by
from labwc.
Related Issues (20)
- Labwc misplaces titlebar on small window HOT 14
- error code 129 HOT 3
- Partial Keyboard Input Detected HOT 3
- Feature Request: Tablet Relative Tracking Mode HOT 33
- X11 resources set by xrdb don't survive xwayland restart HOT 13
- LCD backlight remains on when laptop lid closed HOT 2
- Extra indicators for the window state HOT 3
- Add resistance option for tiled windows HOT 3
- shadows of qt windows HOT 2
- Monitor configuration when in greeter HOT 6
- Controls in GTK2 applications (Tried in GIMP) don't work or if they work, just barely HOT 9
- Magnifier doesn't work with full-screen surfaces (direct scanout?) HOT 22
- Choose wlroots version when compiling HOT 9
- max_toggled button should fallback to max HOT 1
- 0.7.3: Tablet: Thunar always makes multi selection on left click HOT 2
- way to customize CapsLock behavior? HOT 2
- Stylus input doesn't rotate. HOT 8
- Doubled shortcuts depending on layout HOT 2
- chromium won't open fully maximized on launch HOT 29
- last version doesn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labwc.