Commit Graph

141 Commits

Author SHA1 Message Date
Sebastian Krzyszkowiak 6345000b92 seat: Move focus back to first shell surface when unfocusing layer surface 2019-07-11 12:31:21 -04:00
Ryan Walklin 4453757fc9 s/lid_switch/switch_device
Rename lid_switch to switch_device to disambiguate lid and tablet mode switches.
2019-03-19 22:45:58 -04:00
Drew DeVault e77e53dae5
Merge pull request #1517 from emersion/refactor-dnd
Refactor drag-and-drop
2019-02-23 13:02:28 -05:00
emersion 9adcbabea4
rootston: make roots_view embedded and remove unions 2019-02-23 15:24:28 +01:00
emersion ae2aeb65cc
rootston: cancel drag on invalid serial 2019-02-20 18:42:34 +01:00
emersion 6291e84532
data-device: refactor wlr_drag 2019-02-20 18:42:29 +01:00
emersion faa00a4a33
rootston: only allow one drag icon per seat 2019-01-30 15:24:18 +01:00
Greg V 9fe8e37961 Implement the pointer-gestures-unstable-v1 protocol
This protocol relays touchpad gesture events produced by libinput to
supporting clients (e.g. Evince, Eye of GNOME).
2019-01-28 22:06:36 +01:00
emersion 5de26ad8ed
pointer: add a frame event
Frame events group logically connected pointer events. It makes sense to make
the backend responsible for sending frame events, since once the events are
split (ie. once the frame events are stripped) it's not easy to figure out
which events belongs to which frame again.

This is also how Weston handles frame events.

Fixes https://github.com/swaywm/wlroots/issues/1468
2019-01-26 11:04:05 +01:00
emersion 4cb0697e57 data-device, primary-selection: add request_set_selection
This makes compositors able to block and/or customize set_selection requests
coming from clients. For instance, it's possible for a compositor to disable
rich selection content (by removing all MIME types except text/plain). This
commit implements the design proposed in [1].

Two new events are added to wlr_seat: request_set_selection and
request_set_primary_selection. Compositors need to listen to these events and
either destroy the source or effectively set the selection.

Fixes https://github.com/swaywm/wlroots/issues/1138

[1]: https://github.com/swaywm/wlroots/issues/1367#issuecomment-442403454
2019-01-24 11:38:23 +01:00
Ryan Walklin 810c7b700c Working switches in rootston:
Factor out switch handling to separate file
Add formal enum for toggle action
Implement binding actions
2018-12-15 14:42:35 +11:00
Ryan Walklin cc656670b2 Remove redundant signal in seat.c 2018-12-15 14:42:35 +11:00
Ryan Walklin 2a3c62b4d2 [WIP][DONTMERGE]Add support for libinput_switch input devices
These are used primarily by laptops to signal
the state of the lid (open/closed) and tablet
mode if supported, based on ACPI events.
2018-12-15 14:42:35 +11:00
Louis Taylor 0f3a061f60
rootston: use box for views position 2018-12-05 19:20:50 +00:00
emersion 51bfdd620e
Use #if instead of #ifdef for wlroots config data
This prevents some annoying issues when e.g. not including wlr/config.h or
making a typo in the guard name.
2018-11-12 10:12:46 +01:00
Dorota Czaplejewicz 585757d6e6 rootston: add support for text input and the basic of input method
The compositor acts as a relay between applications using the text-input protocol and input methods using the input-method protocol.

This change implements the basic but useful support for input-method, leaving out grabs as well as popups.
2018-10-09 09:56:46 +00:00
Drew DeVault 19f3804548
Merge pull request #1266 from Ongy/xdc_tablet_fix
Fix tablet_tool tilt and send proximity_out
2018-09-27 16:24:35 -05:00
Markus Ongyerth 3e494efc5c Fix tablet_tool tilt and send proximity_out
Originally I asumed tilt_x and tilt_y are very unlikely to change
independent, I was proven wrong.
And while investigating Krita not using the Erasor tool, I found a bug,
which is unrelated though.
2018-09-27 18:31:50 +02:00
emersion dac4f8e19f pointer-constraints: refactoring
* Rename the constraint_create signal to new_constraint for
  consistency
* Move the constraint_destroy signal to the constraint itself
* Use rotate_child_position instead of duplicating logic
* Fix inert constraint resource handling
* Style fixes
2018-09-27 10:25:59 +02:00
Las fa2e6e7d9d Implement pointer-constraints protocol in wlroots and rootston 2018-09-18 10:14:33 +02:00
Las 437f538772 Make wlr_seat->data in rootston point to the wrapping roots_seat 2018-09-18 10:14:33 +02:00
Las 59dd1dddba Update pointer focus when cycling focus 2018-09-18 10:14:33 +02:00
emersion fc960e5d06 layer-shell: add _v1 suffix 2018-09-14 19:32:33 +02:00
emersion 769a8e9917
Merge pull request #1160 from Ongy/tablet-grabs
Tablet grabs
2018-09-12 19:01:50 +02:00
Drew DeVault 76ad4804bc
Merge pull request #1227 from emersion/rootston-segfault-tablet-destroy
rootston: fix segfault on tablet pad destroy
2018-09-10 21:11:32 -04:00
nyorain f6168c2afe Fix #1129 and remove sx, sy from wlr_drag_icon
sx, sy used to store the buffer offset of the drag surface which was
then be added (by rootston) to the drag icon position.
Buffer offsets are handled already in surface_intersect_output
(output.c) so they were added twice for dnd surfaces.
2018-09-07 14:48:28 +02:00
emersion 62af1c630a rootston: fix segfault on tablet pad destroy 2018-09-02 21:40:03 +02:00
emersion f86f1daf9a Fix build on FreeBSD 2018-08-16 10:54:45 +01:00
Markus Ongyerth f64962ace8 tablet-v2 tool: Implement implicit grab
Implement the tablet-v2 tablet tool's implicit grab semantics for
buttons and tip.

This avoids losing focus (to other [sub]surfaces) when a button is held,
or the tip is down.
This should help when the device is used close to a surface's border and
would otherwise have to be very precise.
2018-08-06 08:45:41 +02:00
Markus Ongyerth 81cc842f8f reintroduce xwayland is_unmanaged
153f37bdf5 (#1145) removed the
wlr_xwayland_is_unamanged function while fixing OR, because it was
belieived that it's supposed to work around the broken OR handling.

This was a misunderstanding. is_unmanaged is (while sort of a hack)
intended to work around inherent differences between "real" X sessions
and our Xwayland/wayland situation.

The main reason it exists is to support applications like rofi and dzen,
while not handing focus to other OR windows (which should *not* be
required).
Traditionally, these applications just grabbed input from X and didn't
need to be focused by any logic in the WM. Which of course doesn't work
in wayland compositors. So we have to give them focus in some way.
Giving *every* OR window focus, breaks other applications that don't
expect focus to change.

A testcase that was pointed out to me where wlr_xwayland_is_unamanged was
breaking things is https://github.com/swaywm/sway/issues/2128 (syncplay,
gitk, gitgui)
Supposedly it broke using keyboard to navigate the menus.
I can't reproduce this with this patch. The popups can be navigated as
long as the parent has focus.
2018-07-29 14:43:17 +02:00
Markus Ongyerth d5950255de tablet-v2 tablet_tool grab implementation
Implement the basic logic for tablet-v2 tablet_tool's grabs. And plug in
the default grab.
2018-07-23 10:08:10 +02:00
Markus Ongyerth 454f2a84a8 tablet-v2 tablet_pad grab implementation
Implement the basic logic for tablet-v2 tablet_pad's grabs. And plug in
the default grab.
Features like "holding" the focus should be implemented via grabs, like
they are for pointer and keyboard.
2018-07-19 11:35:00 +02:00
emersion 153f37bdf5 xwayland: handle override_redirect flag changes
The override_redirect flag can change on configure notify and
on map notify. This adds an event to know when it changes.

This removes wlr_xwayland_surface_is_unmanaged which was wrongly
using the window type to decide whether the view should be
unmanaged.

A similar patch was proposed to Weston, but has never been
merged upstream [1].

[1]: https://patchwork.freedesktop.org/patch/211161/
2018-07-18 18:51:03 +01:00
Markus Ongyerth 9313ac1068 propagate rename to rootston code 2018-07-14 09:51:26 +02:00
Markus Ongyerth d9e978e1b3 rename wlr_tablet_tool to wlr_tablet
The previous naming was based on the input-device capability names from
libinput.
With code that uses the libinput_tablet_tool and mapping into tablet-v2,
this is confusing, so the name is changed to follow the names used in
the protocol.
2018-07-14 09:49:58 +02:00
Markus Ongyerth b84288af16 Remove unused tablet_pad list from tools 2018-07-14 09:48:57 +02:00
Markus Ongyerth 101080a382 Another feedback pass 2018-07-14 09:48:57 +02:00
Markus Ongyerth 48e2cba9b6 Handle relative motion for mouse tools 2018-07-14 09:48:57 +02:00
Markus Ongyerth 2c12011472 Send all tablet tool axis events 2018-07-14 09:47:16 +02:00
Markus Ongyerth 6a40561e4c Fix clang build errors 2018-07-14 09:47:16 +02:00
Markus Ongyerth b79d11395c Hook up set_cursor in rootston 2018-07-14 09:47:16 +02:00
Markus Ongyerth 31cec36b74 1st feedback pass
Rename make_ functions to _create
Implement set_cursor and set_feedback
2018-07-14 09:43:16 +02:00
Markus Ongyerth 15870ceb4b Fix segfaultiness 2018-07-14 09:40:39 +02:00
Markus Ongyerth 5c7a37f309 Add tool buttons 2018-07-14 09:40:39 +02:00
Markus Ongyerth 391eef6ea9 Propagate most axis events to clients 2018-07-14 09:40:39 +02:00
Markus Ongyerth f375246657 Implement basic tablet_pad handling (bound to keyboard focus) 2018-07-14 09:40:39 +02:00
Markus Ongyerth e235f7d336 Basic tablet_v2 object lifetime 2018-07-14 09:40:39 +02:00
emersion 7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
Tony Crisci 356e466d5a use seat function to end grab 2018-06-24 18:18:30 -04:00
Genki Sky 28d718c0dd rootston: Cancel existing keyboard grab when changing focus
It's possible that a non-default keyboard grab exists when we are trying
to change focus. For example, say there is an XDG popup when we click on
a different window. This popup's keyboard grab will swallow any
keyboard_notify_enter(), meaning the newly-clicked window won't receive
keyboard input.

So, we cancel any existing grabs in roots_seat_set_focus(). Before this
fix, a window would have been set as active but not receive keyboard
entry.

Fixes #233.

Signed-off-by: Genki Sky <sky@genki.is>
2018-06-10 21:47:49 -04:00