Commit Graph

3412 Commits

Author SHA1 Message Date
emersion a9e02a9ea6 tablet-v2: fix memory leak on OOM, fix resource version 2018-10-13 11:01:38 +02:00
emersion f9eb5df80e backend: fix use-after-free in wlr_backend_autocreate
Found by clang static analyzer.
2018-10-13 10:58:59 +02:00
emersion cff471ce3e
Merge pull request #1305 from Wolf480pl/fix-xwayland-input-hint
xwayland/xwm: make hints->input default to true
2018-10-13 00:42:09 +02:00
Wolf480pl 3512db3ded xwayland/xwm: make hints->input default to true
An X11 client can leave the hints->input WM hint unspecified,
by not setting the XCB_ICCCM_WM_HINT_INPUT flag in hints->flags.
In that case, we should assume a sane default.

Make the hint default to true, so that clients which do not specify
the hint, like mupdf, still get keyboard focus.

This should fix swaywm/sway#2231
2018-10-13 00:20:22 +02:00
nyorain affbfb6a28 Support older wlr_linux_dmabuf_v1 clients
If a client uses an older version of the dmabuf protocol, use the
`formats` event instead of `modifiers` (since that didn't exist in older
versions).
With a bit of necessary guessing, support dmabuf importing even when
EGL_EXT_image_dma_buf_import_modifiers isn't present instead of
failing up front.
2018-10-12 23:07:45 +02:00
emersion 3ceb064f02
Merge pull request #1303 from dcz-purism/fix_surface_gone
text-input: fix releasing destroy handlers
2018-10-12 22:45:42 +02:00
Dorota Czaplejewicz 226eedfa2b text-input: fix releasing destroy handlers 2018-10-12 20:09:11 +00:00
emersion 4897267bd6 input-method-v2: fix include guard name 2018-10-12 19:58:12 +02:00
Drew DeVault b99da405e7 Assert read return value in examples/input-method 2018-10-12 09:35:19 -04:00
Drew DeVault 4c28745c95 Update README.md 2018-10-12 08:27:09 -04:00
Drew DeVault 66e8908e9a
Merge pull request #1203 from dcz-purism/input
Support input method and text input
2018-10-12 13:44:46 +02:00
emersion c5452feb77
Merge pull request #1302 from ascent12/x11_config
Include wlr/config.h in x11.h
2018-10-11 23:20:45 +02:00
Scott Anderson 93a496f3a8 Include wlr/config.h in x11.h
This fixes a warning from the linker when using LTO, due to mismatched
types.
2018-10-12 09:46:35 +13:00
Drew DeVault 7dedfce1ae
Merge pull request #1301 from emersion/cleanup-page-flip
backend/drm: don't reset conn->pageflip_pending in drm_connector_cleanup
2018-10-09 20:57:02 +02:00
emersion b66041a9e5 backend/drm: don't reset conn->pageflip_pending in drm_connector_cleanup
If a pageflip is pending before cleanup, it's still pending after. This
is used line 1177: drm_connector_cleanup is called and
conn->pageflip_pending is checked afterwards.

Fixes #1297
2018-10-09 14:54:33 +02:00
Drew DeVault 8488ed2997
Merge pull request #1298 from emersion/output-dangling-idle-frame
output: remove idle_frame event source when destroying output
2018-10-09 13:41:04 +02:00
Drew DeVault feb0614d32
Merge pull request #1299 from Emantor/set-drm-version
backend/drm: set drmEventContext version to 2
2018-10-09 13:40:06 +02:00
Rouven Czerwinski 77478ac302 backend/drm: set drmEventContext version to 2
As per [1] set drmEventContext version to 2, since wlroots does not use the
page_flip_handler2.

[1]: https://s-opensource.org/2017/04/12/libdrm-event-handling-youre-probably-wrong/
2018-10-09 12:34:01 +02: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
Dorota Czaplejewicz cec7471119 wlroots: add basic support for zwp_input_method_v2
Implemented basic input method functionality. Not included: popups, grabbing.
2018-10-09 09:56:46 +00:00
Dorota Czaplejewicz 174e8a48aa build: bump wayland-scanner version
wayland-scanner >= 1.15.0 accepts foreign struct references, necessary in protocols like zwp-input-method-v2
2018-10-09 09:56:46 +00:00
Dorota Czaplejewicz 427735fcd9 wlroots: add support for zwp_text_input_unstable_v3 2018-10-09 09:56:11 +00:00
emersion 46b1ba386f output: remove idle_frame event source when destroying output
This prevents the idle event to be activated on a destroyed
output.

This also makes the backend responsible for free-ing modes, as it
is the one allocating them and adding them to the list. Note that
the DRM backend (the only one using modes) already frees them.
2018-10-09 10:55:03 +02:00
Drew DeVault 75005fd58d
Merge pull request #1294 from emersion/xcursor-env-config
rootston: export XCURSOR_SIZE and XCURSOR_THEME
2018-10-09 00:00:12 +02:00
Scott Anderson 885586a831
Merge pull request #1280 from emersion/drm-link-status
backend/drm: add support for the link-status property
2018-10-08 21:01:30 +02:00
emersion 3a181ab430 rootston: export XCURSOR_SIZE and XCURSOR_THEME
These can be used by toolkits (currently Qt) to choose a default
cursor theme and size. Note that this isn't a perfect solution:

- Per-seat configuration isn't possible
- It's not possible to set the default image
- Live config reload isn't possible

But it's easy to implement and simple. To fix these remaining
issues a separate protocol would be needed.
2018-10-08 16:02:53 +02:00
ixru 8d0997a5e7 Better placement of visibility check 2018-10-08 15:58:24 +02:00
emersion 97049576f7
Merge pull request #1292 from n3rdopolis/patch-3
meson.build: require logind v237
2018-10-08 09:00:13 +02:00
n3rdopolis cf7323a831
meson.build: require logind v237
Commit 7b52388424 uses a function added in logind v237
2018-10-07 18:26:35 -04:00
ixru 6a9995d18c Fix cursor visibility on surface commit 2018-10-07 21:26:38 +02:00
emersion f44003f04b data-device: remove wlr_data_source.seat_client
Since the source doesn't always come from a client, this field
doesn't make sense. It is replaced by a new "finalized" field in
wlr_client_data_source. This is used to make sure set_actions is
not sent after start_drag has been sent.

A check in data_offer_choose_action has been removed: if an offer
has been sent then start_drag has been called, no need to check.

I also wanted to add a check for wl_data_source.offer, but it
turns out (1) this isn't in the spec (2) it breaks GTK+.

This is some preliminary work for Firefox on Wayland compatibility.
2018-10-07 16:01:57 +02:00
Drew DeVault fb5572db5a
Merge pull request #1286 from emersion/drm-no-crtc
backend/drm: better handle GPUs without CRTCs
2018-10-07 16:00:39 +02:00
emersion 37de179013 backend/drm: fix zero-length VLAs 2018-10-07 13:04:52 +02:00
emersion 776008da69 backend/drm: properly handle GPUs without CRTCs 2018-10-07 12:59:00 +02:00
Scott Anderson eb44d18cdd
Merge pull request #1284 from emersion/schedule-frame
output: don't trigger a frame immediately in schedule_frame
2018-10-05 20:15:09 +02:00
emersion 5afaccedfc output: fix busy loop when backend doesn't implement schedule_frame 2018-10-05 16:26:40 +02:00
emersion ba91422747 output: don't trigger a frame immediately in schedule_frame
This desynchronizes our rendering loop with the vblank cycle.

In case a compositor doesn't swap buffers but schedules a frame,
emitting a frame event immediately enters a busy-loop.

Instead, ask the backend to send a frame when appropriate. On
Wayland we can just register a frame callback on our surface. On
DRM we can do a no-op pageflip.

Fixes #617
Fixes swaywm/sway#2748
2018-10-05 16:18:37 +02:00
Drew DeVault 4e89a21397
Merge pull request #1283 from swaywm/revert-1282-fix-idle-frame
Revert "Prevent excessive frame events when compositor doesn't swap buffers"
2018-10-05 13:56:42 +02:00
Drew DeVault 1e70b4cea2
Revert "Prevent excessive frame events when compositor doesn't swap buffers" 2018-10-05 07:37:41 -04:00
Drew DeVault 1280b4920d
Merge pull request #1282 from RyanDwyer/fix-idle-frame
Prevent excessive frame events when compositor doesn't swap buffers
2018-10-05 13:10:22 +02:00
Ryan Dwyer b7b781ff44 Prevent excessive frame events when compositor doesn't swap buffers
When we send an output frame event, we should not assume that the
compositor is going to call wlr_output_swap_buffers in response to it.
If the compositor does not swap the buffers, the idle event source still
exists and is executed every time the Wayland event loop becomes idle,
which means we send frame events repeatedly until the buffers are
swapped.

This moves the removal of the idle event source out of
wlr_output_swap_buffers and into wlr_output_send_frame, where it is
guaranteed to be removed.
2018-10-05 20:14:34 +10:00
Drew DeVault 24a48d4858
Merge pull request #1272 from emersion/presentation-time
Implement presentation-time
2018-10-04 22:18:19 +02:00
emersion eac7c2ad2f output: add presentation refresh prediction 2018-10-04 22:00:24 +02:00
emersion abd3e995ab rootston: send presentation events 2018-10-04 22:00:23 +02:00
emersion ba63d77ec1 rootston: add output_for_each_surface 2018-10-04 22:00:23 +02:00
emersion 0aafd6e234 rootston: add layer_for_each_surface 2018-10-04 22:00:23 +02:00
emersion b0635bf3e7 Rename get_present_clock to get_presentation clock, use it 2018-10-04 22:00:22 +02:00
emersion abddfc99f2 output: fix clock_gettime return value handling 2018-10-04 21:58:17 +02:00
emersion 54e1287f30 backend: add get_present_clock 2018-10-04 21:58:17 +02:00
emersion 9203bfdd4f output: document signals 2018-10-04 21:56:38 +02:00