Commit Graph

1076 Commits

Author SHA1 Message Date
Drew DeVault ac26d23711
Merge pull request #1287 from emersion/source-seat-client
data-device: remove wlr_data_source.seat_client
2018-10-19 14:18:05 +02:00
emersion 6730f5ba93
Merge pull request #1314 from nyorain/write_pixels_format
Remove fmt parameter from wlr_texture_write_pixels
2018-10-19 14:04:27 +02:00
Dorota Czaplejewicz 14c6ee894e text-input: Don't reject enable requests when unfocused
The prevoius implementation would always raise an error in the following sequence:

-> enter
-> leave
<- enable

The text-input type is not equipped to manage the validity of clents' requests, which should be handled in the compositor, as rootston does.
2018-10-17 15:34:41 +00:00
nyorain cd28637187 Remove fmt parameter from wlr_texture_write_pixels
It's not allowed to change the format of a texture so remove
the confusing parameter.
2018-10-15 23:56:56 +02:00
Drew DeVault e4a1560433
Merge pull request #1304 from nyorain/dmabuf_v1
Support older wlr_linux_dmabuf_v1 clients
2018-10-13 15:12:40 +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
Dorota Czaplejewicz 226eedfa2b text-input: fix releasing destroy handlers 2018-10-12 20:09:11 +00: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
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 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
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
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 1e70b4cea2
Revert "Prevent excessive frame events when compositor doesn't swap buffers" 2018-10-05 07:37:41 -04: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
emersion eac7c2ad2f output: add presentation refresh prediction 2018-10-04 22:00:24 +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 26b9d6dbb1 output: send present event from all backends 2018-10-04 21:56:38 +02:00
emersion 78389fe722 output: add present event 2018-10-04 21:56:38 +02:00
emersion 3aad9fd6a9 presentation-time: add protocol implementation 2018-10-04 21:55:31 +02:00
emersion 2beb68007e output: make gamma size a size_t and gamma table const 2018-10-03 10:36:33 +02:00
Emmanuel Gil Peyrot 130bf15cfa Fix a crash on zxdg_decoration_manager_v1 destroy
When this request was called from a client, the unimplemented callback
was NULL and thus was crashing rootston.
2018-10-01 14:45:17 +02:00
emersion f5ff702a69 gamma-control-v1: add missing destroy handler 2018-09-29 14:30:41 +02:00
Drew DeVault 5e9959daaa
Merge pull request #852 from Laaas/master
Implement pointer-constraints-unstable-v1 protocol
2018-09-27 05:57:43 -05:00
emersion fadbdcd13c seat: remove unused keyboard focus_change event 2018-09-27 12:21:30 +02:00
emersion d98181dab8 pointer-constraints: use proper wayland-scanner functions 2018-09-27 10:53:11 +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
emersion 31cc2fa4f9 pointer-constraints: make region not a pointer, add committed bitfield 2018-09-26 23:08:52 +02:00
emersion c89cd4945b pointer-constraints: rename wl_{global,resources} 2018-09-26 17:38:41 +02:00
Drew DeVault 33a3d8a555
Merge pull request #1252 from emersion/fatal-unknown-buffer
buffer: disconnect clients that commit an unknown buffer type
2018-09-19 08:02:31 -04:00
emersion ac28d701c0 buffer: disconnect clients that commit an unknown buffer type
If this happens, something went really wrong and we should do more
than just logging an error. See [1].

[1]: https://gitlab.freedesktop.org/wayland/weston/issues/148
2018-09-19 11:29:48 +02:00
Las afa2e399aa Fix implicit conversion of floats to ints in calls to pixman_region32_contains_point
I do not think the conversion is specifically defined, but on my system and SirCmpwn's
the floats are rounded instead of floored, which is incorrect in this case, since
for a range from 0 to 256, any value greater or equal to 0 and less than 256 is valid.
I.e. [0;256[, or 0 <= x < 256, but if x is e.g. -0.1, then it will be rounded to 0, which
is invalid. The correct behavior would be to floor to -1.
2018-09-18 13:05:44 +02:00
emersion 3df602a62d export-dmabuf: disable hardware cursors if desired
Also make the frame resource inert when sending "ready".
2018-09-18 11:48:04 +02:00
emersion 928572c14d output: add wlr_output_set_hardware_cursors_enabled
And use it in screencopy.
2018-09-18 11:37:37 +02:00
random human 40a43003a1
Send unique keymap file descriptors
To prevent wl_keyboard keymap being written to by clients, use a unique
file descriptor for each wl_keyboard resource.

Reference: weston, commit 76829fc4eaea329d2a525c3978271e13bd76c078
2018-09-18 13:58:36 +05:30
Las fa2e6e7d9d Implement pointer-constraints protocol in wlroots and rootston 2018-09-18 10:14:33 +02:00
Las 6367e0bc93 Add wlr_surface::input_region member
This is analogous to the opaque_region member.

In addition the code for setting the opaque region is cleaned up.
2018-09-18 10:14:33 +02:00
Las d446c53fe1 Make (wlr_)seat_client_from_pointer_resource public 2018-09-18 10:14:33 +02:00
Las 252bcce2f3 Add focus change event for seats 2018-09-18 10:14:33 +02:00
emersion 9f76263404 output-layout: don't expose outputs without a mode 2018-09-17 15:22:33 +02:00
Drew DeVault df991a55ab
Merge pull request #1241 from emersion/output-enable-error-checking
output: make wlr_output_enable return a bool
2018-09-14 21:14:18 -04:00
Drew DeVault 0210905eef
Merge pull request #1243 from emersion/layer-shell-suffix
layer-shell: add _v1 suffix
2018-09-14 20:47:42 -04:00
Drew DeVault a088000983
Merge pull request #1244 from emersion/xdg-output-suffix
xdg-output: add _v1 suffix
2018-09-14 20:47:14 -04:00
emersion fc960e5d06 layer-shell: add _v1 suffix 2018-09-14 19:32:33 +02:00
emersion b3cb22c003 xdg-output: add _v1 suffix 2018-09-14 19:29:08 +02:00
emersion cb293f09e7 output: make wlr_output_enable return a bool 2018-09-14 18:18:07 +02:00
emersion 524702eb16 output: introduce WLR_NO_HARDWARE_CURSORS 2018-09-14 18:07:21 +02:00