Commit Graph

32 Commits

Author SHA1 Message Date
Isaac Freund 1c3e0816f3
scene: fix wlr_scene_send_frame_done() API
This doesn't work if scene outputs are not used as the primary output of
scene surfaces will always be NULL.

Therefore, take a wlr_scene_output instead of separate wlr_scene and
wlr_output arguments and rename the function to
wlr_scene_output_send_frame_done().

The actual behavior of the function is unchanged.
2021-12-13 17:26:22 +01:00
Isaac Freund ad01cdf0b2 tinywl: use wlr_scene_send_frame_done() 2021-12-13 15:21:05 +00:00
Quantum 812ab2e716 Fix uninitialized variable errors in release mode
When using `meson --buildtype=release`, `-Wextra -Werror` is passed.
This includes `-Werror=maybe-uninitialized`, which complains about
the instances fixed in this commit.
2021-12-01 02:39:14 -05:00
Isaac Freund a44b2af672
tinywl: use wlr_scene 2021-11-30 22:06:42 +01:00
Simon Zeni ee210758fc tinywl: init output render before commit 2021-11-19 10:44:51 -05:00
Simon Zeni a6538ced35 tinywl: autocreate allocator and init output 2021-11-18 09:37:57 -05:00
Elyes HAOUAS dc3d1530bf Fix spelling errors
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2021-10-02 10:22:13 +02:00
Isaac Freund f2f3df9fb1 tinywl: simplify logic for sending pointer events 2021-08-20 16:32:28 +02:00
Simon Ser fbc2182b9f Stop specifying xkb_rule_names
If a NULL xkb_rule_names pointer is passed to
xkb_keymap_new_from_names, libxkbcommon will default to reading
the XKB_* env variables. So there's no need to do it ourselves.

Also s/xkb_map_new_from_names/xkb_keymap_new_from_names/ since the
latter is more consistent with the returned struct name.

[1]: https://xkbcommon.org/doc/current/structxkb__rule__names.html
2021-04-19 17:33:28 +02:00
Simon Zeni 1458f7d974 tinywl: fix wlr_backend_autocreate call 2021-01-07 14:39:04 +01:00
Isaac Freund 7693f61d81 Replace wlr_key_state with wl_keyboard_key_state
There's no reason to have duplicate enums
2020-11-11 10:58:38 +01:00
Greg Depoire--Ferrer 21397e2b4a tinywl: Fix wrong anchor point while resizing a window
Previously, when dragging the left border of a window with the mouse in tinywl,
there was a bug where it snap the top level surface's geometry X coordinate
directly to the position of the mouse, as if you started the resize right on the
border. This also affected the other (right, top and bottom) borders.

I think that the previous resize code was hard to understand. Honestly I
have not spent a lot of time trying to understand why it didn't work and
I wrote another resize algorithm instead: now, instead of working directly
with widths and heights which are complicated, we work with the borders (left,
right, top, bottom). This is easier to understand IMO.

Note: I originally fixed this [in the waybox compositor](https://github.com/wizbright/waybox/pull/23) but
then I realized that the code was taken from tinywl and that it had the same
issues so I copied my fix for tinywl.
2020-04-28 21:44:27 +02:00
Isaac Freund fa5d709fc3 tinywl: handle request set selection 2020-04-28 09:19:22 +02:00
Isaac Freund 9d650a7c1a tinywl: remove unused variables 2020-04-28 09:19:22 +02:00
Kalyan Sriram 326c8bc818
tinywl: fix geo_box bug in cursor resizing
While trying out the tinywl code, I found that the resize mode was behaving
weirdly ... so I looked into code. Turns out the `begin_interactive` method
stores the cursor position plus the geo_box position; however,
`process_cursor_resize` wasn't taking this into account, causing windows to
jump down in size unexpectedly when resized and lose alignment with the cursor.
To fix this, I simply added a member to the `tinywl_server` struct that stores
the geo_box when the mouse enters grab mode, and I referenced that data in the
resize method. I considered polling for this data every time instead of storing
it in the server struct, but 1) since changes in this value are not relevant
and 2) it could potentially decrease performance (I don't know enough about
wlroots to know how much) I decided to just store it. I can change this if
desired.
2020-04-23 10:00:06 +02:00
Isaac Freund 25d0d1be3a tinywl: remove redundant create output global call 2020-04-15 12:40:20 +02:00
Simon Ser 31f721286a tinywl: enable and commit output when modesetting
While at it, choose the preferred mode instead of the last one.
2019-12-30 11:21:11 -07:00
Simon Ser ca45f4490c Remove all wayland-server.h includes
The documentation for wayland-server.h says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
2019-07-27 15:49:32 -04:00
Simon Ser 23e37e7b1d output: refactor frame submission API
This is necessary for direct scan-out and other upcoming features. This patch
changes the output API to look like the wl_surface API.

Outputs now have some double-buffered state: the frame to be submitted
(currently only wlr_renderer frames are supported) and the damaged region.
To attach a pending frame, use wlr_output_attach_render. To set the pending
damaged region, use wlr_output_set_damage.

To submit the pending state, call wlr_output_commit. This will submit the
pending frame to the backend.

To migrate from the old API to the new one:

- Replace wlr_output_make_current calls by wlr_output_attach_render
- Replace wlr_output_swap_buffers calls by wlr_output_set_damage and
  wlr_output_commit
2019-04-23 14:34:30 -06:00
emersion 755a1c9138 tinywl: send pointer frame events
Fixes https://github.com/swaywm/wlroots/issues/1544
2019-03-02 08:39:41 -07:00
athrungithub 2000d52405 clang compile fix #1572
clang consider error no enum handled,
in BSD and Linux
2019-02-26 08:05:17 +01:00
Alexander Bakker 776b6ce395 Fix software cursor rendering for tinywl and some examples 2019-01-13 21:39:56 +01:00
Drew DeVault 9921f9b28d Remove unused struct from tinywl 2019-01-10 21:18:52 -05:00
emersion 0fafab87e3
Fix a few typos 2019-01-10 09:30:14 +01:00
Drew DeVault 33d9d9f175 Annotate the source 2019-01-03 10:55:14 -05:00
Drew DeVault f0d8b793a8 Update READMEs per tinywl merge 2019-01-03 10:10:03 -05:00
Louis Taylor b3f51e39f8 view_at: remove unused variable 2018-11-27 21:36:24 -05:00
Louis Taylor b1d820c492 Correct WLR_BUTTON_PRESSED to WLR_KEY_PRESSED
This worked since it was the same value, but results in compile
warnings.
2018-11-26 21:09:23 -05:00
Drew DeVault 20e55f9458 Implement Alt+F1 (next window) and Alt+Esc (exit) 2018-08-15 19:12:35 -04:00
Drew DeVault 9e6ef44deb Fix uninitialized variable 2018-08-15 18:54:34 -04:00
Drew DeVault 09c8a048da Fix various bugs 2018-08-15 18:48:31 -04:00
Drew DeVault 5f4c64fbeb Tiny Wayland compositor 2018-08-15 18:27:48 -04:00