Commit Graph

37 Commits

Author SHA1 Message Date
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
emersion 62fd03a7be rootston: refactor rendering
This implements rootston surface iterators to ease rendering, sending
frame/presentation events and accumulating damage.
2019-03-02 09:37:05 -07:00
emersion fc960e5d06 layer-shell: add _v1 suffix 2018-09-14 19:32:33 +02:00
Dorota Czaplejewicz e9e65c549a rootston: Keep older anchored layers near anchor points
Layer surfaces are attached to edges of the screen starting with the youngest, causing new ones to always displace existing ones. This changes the order to oldest first, keeping the positions more often.
2018-09-11 11:47:22 +02:00
Dorota Czaplejewicz f4ae9824f7 rootston/layer_shell: fix clicking after surface moved/resized
Layer surfaces are not notified of cursor position changes if the surface moves, only if the cursor moves. This workaround emits a cursor position event every time a cursor ends up over a newly resized layer surface to make sure the following clicks land in the right place.

This change doesn't address sending leave events when a cursor previously present over the surface becomes away.

There are 2 separate mechanisms in play, because a layer surface gets resized in 2 steps:

1. Layer surface resize & rearrange.
2. Underlying surface resize.

The first step may affect all layer surfaces. The cursor events are sent to cursors placed over all layer surfaces which have moved (not been resized). The second step affects any layer surface whose surface changed size. The cursor event is sent only to that surface.

Together, these events cover all surfaces: those which moves, and those which changed size, as long as each layer surface resize is accompanied by an immediate surface resize.
2018-08-23 11:29:03 +02:00
Ilia Bozhinov 2e6eb097b6 rootston: focus newly-created surfaces
Whenever a new surface is created, we have to update the cursor focus,
even if there's no input event. So, we generate one motion event, and
reuse the code to update the proper cursor focus. We need to do this
for all surface roles - toplevels, popups, subsurfaces.

Fixes #1162
2018-07-29 21:58:33 +03:00
emersion 7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
Dominique Martinet 1e17f4deb6 rootston: fix leak in handle_layer_shell_surface
Found through static analysis
2018-06-30 11:38:21 +09:00
Guido Günther b1bd0e2557 layer-shell: Fix crash when cursor is intially outside any output
On the X11 backend the cursor position might be outside the output
window so no output is returned leading to the assert to trigger. Use
sane fallback instead of crashing.
2018-04-26 14:08:30 +02:00
Guido Günther 24fa07565d layer-shell: use output_damage_{whole,from}_local_surface on map/unmap
These handle rotation and scaling
2018-04-24 13:11:42 +02:00
Guido Günther c4dff67e00 layer-shell: use output_damage_{whole,from}_local_surface for popups
Reuse what already handles rotation and scaling. This unbreaks popups
on rotated or scaled outputs.
2018-04-24 13:11:42 +02:00
Guido Günther ad22e02310 rootston: Damage layer-shell popups 2018-04-23 11:24:31 +02:00
Drew DeVault edbf4a2f60 Implement output auto-selection in rootston 2018-04-22 19:15:49 +02:00
Guido Günther 47e1eda669 rootston: don't crash on shutdown
When e.g. running rootston under X11 it would otherwise crash when
closing rootston like:

    #0  0x00007f0197da7327 in wl_list_remove () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    #1  0x000056306fcee7fb in handle_destroy (listener=0x5630723a2948, data=0x5630723a5d20) at ../rootston/layer_shell.c:273
    #2  0x00007f019800a552 in wlr_signal_emit_safe (signal=0x5630723a5e30, data=0x5630723a5d20) at ../util/signal.c:29
    #3  0x00007f0197fef808 in layer_surface_destroy (surface=0x5630723a5d20) at ../types/wlr_layer_shell.c:169
    #4  0x00007f0197ff0001 in client_handle_destroy (resource=0x56307229c4c0) at ../types/wlr_layer_shell.c:371
    #5  0x00007f0197da2f30 in  () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    #6  0x00007f0197da77f9 in  () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    #7  0x00007f0197da301d in wl_client_destroy () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    #8  0x00007f0197da30d8 in  () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    #9  0x00007f0197da4c12 in wl_event_loop_dispatch () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    #10 0x00007f0197da344a in wl_display_run () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    #11 0x000056306fcef069 in main (argc=3, argv=0x7ffd22032528) at ../rootston/main.c:83

since the output_destroy got already removed in handle_output_destroy.
2018-04-16 15:51:03 +02:00
emersion f7539b9d14
rootston: send enter event for layer surfaces 2018-04-03 20:18:04 -04:00
Drew DeVault 9ae861c416 Address review feedback 2018-04-02 18:54:16 -04:00
Drew DeVault 37036df822 Handle layer surfaces below shell surfaces 2018-04-02 18:44:06 -04:00
Drew DeVault a94f4d0edc Always give keyboard focus to the topmost layer 2018-04-02 15:48:22 -04:00
Drew DeVault 883d8d306c Identify topmost interactive layer surface 2018-04-02 15:16:14 -04:00
Drew DeVault d466cc117f Don't reset exclusive between layer shell passes
This is not the intended behavior of exclusive zones, the second pass is
meant to respect the usable area.
2018-04-02 14:55:17 -04:00
Drew DeVault b887af9a60 Fix maximized windows interaction with layer shell
If there were no layer surfaces the usable area of the output would be
an empty box.
2018-03-29 12:18:50 -04:00
Drew DeVault 3e5131e664 Address further review feedback 2018-03-27 21:28:22 -04:00
Drew DeVault a1d5d20914 Address some more feedback 2018-03-27 18:51:41 -04:00
Drew DeVault 52fe2688ea Address @emersion's feedback 2018-03-27 18:51:41 -04:00
Drew DeVault 776b81d499 Fix surface layer damage tracking 2018-03-27 18:50:32 -04:00
Drew DeVault 0e318df13d Add margin animation to the example demo 2018-03-27 18:50:32 -04:00
Drew DeVault 86ca4bea6d Fix layer rendering/layout bugs 2018-03-27 18:50:32 -04:00
Drew DeVault 097e87ca9f Handle usable area for maximized windows
Also fixes some bugs
2018-03-27 18:50:32 -04:00
Drew DeVault ab6c2bf584 Reset exclusivity after shell layer
Also fixes an issue which was applying exclusivity to all edges
2018-03-27 18:50:32 -04:00
Drew DeVault df9dbf3170 Fix rebase issues; rearrange layers on destroy 2018-03-27 18:50:32 -04:00
Drew DeVault 11c57d22b0 Use 0 for default width/height (rather than -1) 2018-03-27 18:50:32 -04:00
Drew DeVault d1c0e6fe2c Add layer_surface.close 2018-03-27 18:50:32 -04:00
Drew DeVault b73c4f48c1 Fix exclusive zone among other layers 2018-03-27 18:50:32 -04:00
Drew DeVault 8c98c18880 Gracefully deal with outputs being removed 2018-03-27 18:50:32 -04:00
Drew DeVault f444a0d14c Implement layer surface damage 2018-03-27 18:50:32 -04:00
Drew DeVault 4bf936360d Arrange & render layer surfaces 2018-03-27 18:50:09 -04:00
Drew DeVault b31ce4220c Add broken test client and rootston stubs 2018-03-27 18:50:09 -04:00