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)
- Add support for listening and reconfiguring the keyboard settings from locale1 HOT 6
- Action MoveToOutput uses name attribute twice HOT 4
- Add workspace name to separate applications in window switcher when using allWorkspaces=yes option HOT 7
- [Feature request] Add " --exit-with-session" option to labwc. HOT 8
- No tray icon with Qt6 program - QSystemTrayIcon with SNI HOT 9
- Keyboard and display issue under some conditions HOT 1
- Github Actions: Arch HOT 2
- Only create the headless backend if there isn't one already
- Try to re-set cursor image on reconfigure if either cursor theme or cursor size changed
- Dragging a tiled window in nested session causes flickering HOT 1
- Johan's Meta Issue - to bind a few others
- Xwayland support HOT 8
- NLS: "Workspace" HOT 12
- workspaces: when cycling through desktops RTL languages shift right too much. HOT 3
- Programs to enhance labwc experience. HOT 14
- Window switcher switching back to the previous window immediately HOT 43
- [Feature request] vertical title bar HOT 3
- Regression for lxqt-runner: no focus if not clicked by mouse HOT 21
- Strange doubleclick on title behavior HOT 7
- Calculation of nested layershell popup offsets don't seem correct 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.