Commit Graph

1383 Commits

Author SHA1 Message Date
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 9f11bf571e
rootston: add a view child interface 2019-02-23 14:18:32 +01:00
emersion e86c7a3dd6
rootston: move part of desktop.c to view.c, use an interface for views 2019-02-23 12:15:37 +01:00
emersion d6de640440
data-device: unbreak wl_data_source.cancel during drag-and-drop 2019-02-20 18:42:34 +01:00
emersion 6291e84532
data-device: refactor wlr_drag 2019-02-20 18:42:29 +01:00
Brian Ashworth 50011e7170 backend/drm: fix modeset on drm fd resume
On DRM resume, such as switching back to a TTY, the output needs to be
modeset to the current mode. However, wlr_output_set_mode will return
early when attempting to set the mode to the current mode. This just
steps around wlr_output_set_mode and calls drm_connector_set_mode
directly.
2019-02-19 16:49:51 +01:00
Drew DeVault ea28887a23
Merge pull request #1493 from emersion/primary-selection-v1
primary-selection-v1: copy from gtk-primary-selection
2019-02-19 08:59:20 -05:00
emersion 943e918a96
subsurface: add map/unmap events
Fixes https://github.com/swaywm/wlroots/issues/1414
2019-02-17 12:01:15 +01:00
Uli Schlachter e7d9cf5815 xwm: Add _NET_CLIENT_LIST support
Fixes: https://github.com/swaywm/wlroots/issues/1469
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-02-15 11:08:54 +01:00
emersion 8163f7e1e2
primary-selection-v1: copy from gtk-primary-selection 2019-02-13 19:28:25 +01:00
Geoff Greer 5c8d2da0a1 Add a wlr_output_set_subpixel()
drmModeConnector.subpixel doesn't seem to detect subpixel order on many displays (especially laptops). Allow subpixel order to be manually set.

The corresponding PR for sway adds a subpixel output option: https://github.com/swaywm/sway/pull/3645

Once both are merged, https://github.com/swaywm/sway/issues/3163 will be fixed.
2019-02-13 19:20:29 +01:00
Ivan Molodetskikh 9e49ceb129 data-control: add primary selection support
data-control: separate out a data_offer struct

This is a prerequisite to adding primary selection support.

data-control: separate out data_control_source

This is a prerequisite to adding primary selection support, since that
doesn't use wlr_data_source, but rather wlr_primary_selection_source.

Update the data-control protocol

data-control: add primary selection support

Merge create_offer and create_primary_offer

Extract code into data_control_source_destroy()

Fix pointer style

Move resource neutralization to destructor

Store wl_resource in the data_offer

Extract data_offer destruction into a function
2019-02-10 17:12:05 +01:00
emersion 6c8eaaef2d
Deprecate old protocols 2019-02-09 19:57:10 +01:00
emersion 7f5967234c
xdg-shell: destroy child popups on unmap
It doesn't make sense to keep popups opened when unmapped. We also need to do
so in wlr_xdg_popup_destroy so that popups are destroyed in the correct order.
2019-02-05 19:29:00 +01:00
Vincent Vanlaer 7bc43413ed Allow cursor render surface to be used as fb
In order for a surface to be used as a cursor plane framebuffer, it
appears that requiring the buffer to be linear is sufficient.

GBM_BO_USE_SCANOUT is added in case GBM_BO_USE_LINEAR isn't sufficient
on untested hardware.

Fixes #1323

Removed wlr_drm_plane.cursor_bo as it does not serve any purpose
anymore.

Relevant analysis (taken from the PR description):

While trying to implement a fix for #1323, I found that when exporting
the rendered surface into a DMA-BUF and reimporting it with
`GBM_BO_USE_CURSOR`, the resulting object does not appear to be valid.
After some digging (turning on drm-kms debugging and switching to legacy
mode), I managed to extract the following error: ```
[drm:__setplane_check.isra.1 [drm]] Invalid pixel format AR24
little-endian (0x34325241), modifier 0x100000000000001 ``` The format
itself refers to ARGB8888 which is the same format as
`renderer->gbm_format` used in master to create the cursor bo. However,
using `gbm_bo_create` with `GBM_BO_USE_CURSOR` results in a modifier of
0. A modifier of zero represents a linear buffer while the modifier of
the surface that is rendered to is  `I915_FORMAT_MOD_X_TILED` (see
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/uapi/drm/drm_fourcc.h?h=v4.20.6#n263).
In order to fix this mismatch in modifier, I added the
`GBM_BO_USE_LINEAR` to the render surface and everything started to work
just fine. I wondered however, whether the export and import is really
necessary. I then decided to test if the back buffer of the render
surface works as well, and at least on my hardware (Intel HD 530 and
Intel UHD 620) it does. This is the patch in this PR and this requires
no exporting and importing.

I have to note that I cheated in order to import DMA_BUFs into a cursor
bo when doing the first tests, since on import the Intel drivers check
that the cursor is 64x64. This is strange since cursor sizes other than
64x64 have been around for quite some time now
(https://lists.freedesktop.org/archives/mesa-commit/2014-June/050268.html).
Removing this check made everything work fine. I later (while writing
this PR) found out that `__DRI_IMAGE_USE_CURSOR` (to which
`GBM_BO_USE_CURSOR` translates) has been deprecated in mesa
(https://gitlab.freedesktop.org/mesa/mesa/blob/master/include/GL/internal/dri_interface.h#L1296),
which makes me wonder what the usecase of `GBM_BO_USE_CURSOR` is. The
reason we never encountered this is that when specifying
`GBM_BO_USE_WRITE`, a dumb buffer is created trough DRM and the usage
flag never reaches the Intel driver directly. The relevant code is in
https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/gbm/backends/dri/gbm_dri.c#L1011-1089
. From this it seems that as long as the size, format and modifiers are
right, any surface can be used as a cursor.
2019-02-04 20:47:07 +01:00
emersion 7defb30781
relative-pointer-v1: time is in usec, not msec 2019-01-30 21:25:42 +01:00
emersion faa00a4a33
rootston: only allow one drag icon per seat 2019-01-30 15:24:18 +01:00
emersion d6de329d98
seat: don't send motion if pointer hasn't moved 2019-01-30 15:24:17 +01:00
emersion 75371d2c88
Require libdrm >= 2.4.95 2019-01-29 19:33:38 +01:00
Drew DeVault feb1b9b1cb
Merge pull request #1509 from emersion/gbm-fmt-mismatch
backend/drm: fix GBM format mismatch
2019-01-29 10:39:54 -05:00
emersion ee293fab58
backend/drm: fix GBM format mismatch
We create the EGL config with GBM_FORMAT_ARGB8888, but then initialize GBM BOs
with GBM_FORMAT_XRGB8888. This mismatch confuses Mesa.

Instead, we can always use GBM_FORMAT_ARGB8888, and use DRM_FORMAT_XRGB8888
when calling drmModeAddFB2.

Fixes https://github.com/swaywm/wlroots/issues/1438
2019-01-29 12:04:12 +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 a1f9d7ad9e
data-device: keep track of wlr_data_offer in wlr_seat lists 2019-01-24 12:18:41 +01:00
emersion 909b3b16f3
data-device: add wlr_data_offer.type 2019-01-24 12:18:40 +01:00
emersion 0040f7089f
data-device: unexport wlr_seat_client_send_selection 2019-01-24 12:15:18 +01:00
emersion 84f278eca1
data-device: remove data_source_send_offer 2019-01-24 12:12:55 +01:00
emersion 1150ff13ce
data-device: make sources inert, rename cancel to destroy 2019-01-24 12:12:55 +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
emersion 06467d2e12
primary-selection: add a serial argument
The serial needs to be bumped when X11 clients set the selection, otherwise
some Wayland clients (e.g. GTK) will overwrite it when they gain focus.
2019-01-21 19:23:40 +01:00
emersion a4eb90315e
Fix indentation in various files 2019-01-21 17:56:19 +01:00
Jente Hidskes edf0e49195
Add wlr_x11_output_set_title 2019-01-20 16:21:04 +01:00
Jente Hidskes 5b07e20f2a
wlr/backend/x11.h: add documentation
Copied from wlr/backend/wayland.h and modified accordingly.
2019-01-20 16:14:43 +01:00
Drew DeVault d4de2bd708
Merge pull request #1476 from emersion/fullscreen-shell
fullscreen-shell-v1: initial protocol implementation
2019-01-20 09:30:52 -05:00
Ryan Dwyer 53b29e5443 Add noop.h to include/wlr/backend/meson.build 2019-01-19 21:31:24 +10:00
Ryan Dwyer 9b4be5a595 Introduce noop backend
The noop backend is similar to headless, but it doesn't contain a
renderer. It can be used as a place to stash views for when there's no
physical outputs connected.
2019-01-17 20:13:55 +10:00
Connor E e7fff4f560 Remove wlr_xdg_surface_send_close. 2019-01-13 14:22:49 +00:00
Drew DeVault d3d1437bc4 Add wlr_wl_output_set_title 2019-01-10 21:53:32 -05:00
Drew DeVault 97af2464b7 Update Wayland backend to xdg-shell stable 2019-01-10 09:17:14 -05:00
Drew DeVault e61ea7706b
Merge pull request #1423 from emersion/data-control
Implement data-control-unstable-v1
2019-01-06 22:41:35 -05:00
emersion f71cf15aad
relative-pointer-v1: move pointer iteration in wlroots
This makes sure we always send events to the right client.
2019-01-06 12:17:31 +01:00
emersion 86f263a0b8
fullscreen-shell-v1: initial protocol implementation 2019-01-06 12:12:06 +01:00
emersion 610f5bfc77
Merge pull request #1432 from ForTheReallys/relative-pointers
Relative pointers
2019-01-04 13:42:53 +01:00
Alex Maese 8b97c20d01 Finish addressing @emersion's comments 2019-01-02 11:46:13 -06:00
emersion 69e7fd61b7
data-control-v1: update to latest protocol proposal 2018-12-30 02:52:03 +01:00
emersion 99d879c887
data-control-v1: initial protocol implementation 2018-12-30 02:48:03 +01:00
Jente Hidskes ed5296c6cf Protect against redefining MESA_EGL_NO_X11_HEADERS 2018-12-22 19:05:19 +01:00
Timidger 9af0c5338f
Standardize the wlr_box input paramaters
Fixes #1094
2018-12-21 13:56:10 -05:00
Alex Maese 5999d0322b Add a listener for when the pointer gets destroyed 2018-12-21 12:20:48 -06:00