Commit Graph

158 Commits

Author SHA1 Message Date
emersion 551700e887
backend/wayland: fix keyboard keys not pressed/released when focus changes 2018-06-03 13:18:57 +01:00
Ilia Bozhinov 24cf70ae96 backends: implement custom EGL and renderer initialization
Compositors now have more control over how the backend creates its
renderer. Currently all backends create an EGL/GLES2 renderer, so
the necessary attributes for creating the context are passed to a
user-provided callback function. It is responsible for initializing
provided wlr_egl and to return a renderer. On fail, return 0.

Fixes #987
2018-05-25 14:56:52 +03:00
emersion 9e3dd6b560
backend/wayland: fix segfault when destroying backend before starting it 2018-05-19 09:34:16 +01:00
emersion 198ad27bd5
backend/wayland: print output name in window title 2018-05-15 00:16:18 +01:00
emersion 0b58579564
Add support for discrete axis values 2018-05-12 13:34:58 +01:00
emersion 13098a18ea
Fix hardware cursors scale & transform 2018-05-09 19:58:18 +01:00
emersion caf9f9022c
Merge pull request #936 from emersion/full-hardware-cursors
output: always use hardware cursors if available
2018-05-04 19:00:45 +01:00
Guido Günther 545d54439d backend/wayland: don't transform pointer events
We do this in a backend independent way in wlr_cursor now.
2018-05-03 11:09:14 +02:00
emersion 225d182765
output: always use hardware cursors if available
This changes the `wlr_output_impl.set_cursor` function to take a
`wlr_texture` instead of a byte buffer. This simplifies the
DRM and Wayland backends since they were creating textures from
the byte buffer anyway.

With this commit, performance should be improved when moving the
cursor since outputs don't need to be re-rendered anymore.
2018-05-01 21:38:04 +01:00
emersion 178ac8bffe
backend/{wayland,x11}: fix pointer coords for transformed outputs 2018-04-30 10:48:35 +01:00
emersion ddac792b61
backend/wayland: only set one pointer listener 2018-04-29 14:30:13 +01:00
emersion 9f8a7c8fc4
backend/wayland: create one virtual pointer per output 2018-04-29 14:30:13 +01:00
emersion 57c36ddcb3
backend/wayland: add proper error handling to wlr_wl_backend_create 2018-04-28 12:38:03 +01:00
Drew DeVault fecb971518
Merge pull request #902 from emersion/various-memory-leaks
Various memory leaks
2018-04-26 11:34:49 +02:00
emersion cd9f25711c
backend: destroy renderer when destroying backend 2018-04-25 23:53:43 +01:00
emersion 625a7a48dc
Don't use the wlr_ prefix for static functions 2018-04-25 23:51:00 +01:00
emersion 71ca45e2c0
Make sure we don't use others' prefixes 2018-04-25 23:24:58 +01:00
emersion b0d99f5c67
Remove wlr_ prefix from local symbols 2018-04-25 23:00:46 +01:00
emersion eaed6bd03b
render/egl: add wlr_egl_destroy_surface 2018-04-24 23:44:43 +01:00
emersion d2ebbd103c
backend: remove wlr_backend_get_egl 2018-04-08 11:00:56 -04:00
emersion 33a2eb4b77
Untie wlr_backend from wlr_renderer 2018-03-31 18:49:43 -04:00
emersion f37e8c5b6e
backend/wayland: cleanup input transform code 2018-03-30 23:51:20 -04:00
Drew DeVault 3813121fef Fix wayland output absolute input handling 2018-03-28 14:04:23 -04:00
Drew DeVault a35a5786b0 Remove width_mm from wlr_pointer events 2018-03-28 10:46:50 -04:00
emersion c63d94483b
Redesign wlr_texture
- Textures are now immutable (apart from those created from raw
  pixels), no more invalid textures
- Move all wl_drm stuff in wlr_renderer
- Most of wlr_texture fields are now private
- Remove some duplicated DMA-BUF code in the DRM backend
- Add more assertions
- Stride is now always given as bytes rather than pixels
- Drop wl_shm functions

Fun fact: this patch has been written 10,000 meters up in the air.
2018-03-24 23:48:32 -04:00
emersion a854c2f246
Merge branch 'master' into gles2-renderer-redesign 2018-03-23 00:55:55 +01:00
Drew DeVault ef3769851f
Merge pull request #740 from emersion/egl-debug
render/egl: use EGL_KHR_debug
2018-03-22 18:54:21 -04:00
Dominique Martinet d5e14ab247 wayland backend: fix use-after free on output destroy
==12021==ERROR: AddressSanitizer: heap-use-after-free on address 0x617000015698 at pc 0x7f1a9abe1c09 bp 0x7ffe9068f6b0 sp 0x7ffe9068f6a0
WRITE of size 4 at 0x617000015698 thread T0
    #0 0x7f1a9abe1c08 in pointer_handle_leave ../backend/wayland/wl_seat.c:40
    #1 0x7f1a96ae7d1d in ffi_call_unix64 (/lib64/libffi.so.6+0x5d1d)
    #2 0x7f1a96ae768e in ffi_call (/lib64/libffi.so.6+0x568e)
    #3 0x7f1a988e0d8a  (/lib64/libwayland-client.so.0+0x8d8a)
    #4 0x7f1a988dd927  (/lib64/libwayland-client.so.0+0x5927)
    #5 0x7f1a988debe3 in wl_display_dispatch_queue_pending (/lib64/libwayland-client.so.0+0x6be3)
    #6 0x7f1a9abdd6d6 in dispatch_events ../backend/wayland/backend.c:28
    #7 0x7f1a9a968c11 in wl_event_loop_dispatch (/lib64/libwayland-server.so.0+0x9c11)
    #8 0x7f1a9a967449 in wl_display_run (/lib64/libwayland-server.so.0+0x8449)
    #9 0x418dff in main ../rootston/main.c:81
    #10 0x7f1a99b5ef29 in __libc_start_main (/lib64/libc.so.6+0x20f29)
    #11 0x4057c9 in _start (/home/shared/wayland/wlroots/build/rootston/rootston+0x4057c9)

0x617000015698 is located 664 bytes inside of 696-byte region [0x617000015400,0x6170000156b8)
freed by thread T0 here:
    #0 0x7f1a9af754b8 in __interceptor_free (/lib64/libasan.so.4+0xde4b8)
    #1 0x7f1a9abe01ee in wlr_wl_output_destroy ../backend/wayland/output.c:194
    #2 0x7f1a9ac12918 in wlr_output_destroy ../types/wlr_output.c:299
    #3 0x7f1a9abe061b in xdg_toplevel_handle_close ../backend/wayland/output.c:255
    #4 0x7f1a96ae7d1d in ffi_call_unix64 (/lib64/libffi.so.6+0x5d1d)
    #5 0x7f1a96ae768e in ffi_call (/lib64/libffi.so.6+0x568e)
    #6 0x7f1a988e0d8a  (/lib64/libwayland-client.so.0+0x8d8a)
    #7 0x7f1a988dd927  (/lib64/libwayland-client.so.0+0x5927)
    #8 0x7f1a988debe3 in wl_display_dispatch_queue_pending (/lib64/libwayland-client.so.0+0x6be3)
    #9 0x7f1a9abdd6d6 in dispatch_events ../backend/wayland/backend.c:28
    #10 0x7f1a9a968c11 in wl_event_loop_dispatch (/lib64/libwayland-server.so.0+0x9c11)
    #11 0x7f1a9a967449 in wl_display_run (/lib64/libwayland-server.so.0+0x8449)
    #12 0x418dff in main ../rootston/main.c:81
    #13 0x7f1a99b5ef29 in __libc_start_main (/lib64/libc.so.6+0x20f29)
    #14 0x4057c9 in _start (/home/shared/wayland/wlroots/build/rootston/rootston+0x4057c9)

previously allocated by thread T0 here:
    #0 0x7f1a9af75a38 in __interceptor_calloc (/lib64/libasan.so.4+0xdea38)
    #1 0x7f1a9abe0703 in wlr_wl_output_create ../backend/wayland/output.c:272
    #2 0x7f1a9abdd8eb in wlr_wl_backend_start ../backend/wayland/backend.c:55
    #3 0x7f1a9abbeb49 in wlr_backend_start ../backend/backend.c:28
    #4 0x7f1a9abd8ce1 in multi_backend_start ../backend/multi/backend.c:24
    #5 0x7f1a9abbeb49 in wlr_backend_start ../backend/backend.c:28
    #6 0x418c32 in main ../rootston/main.c:58
    #7 0x7f1a99b5ef29 in __libc_start_main (/lib64/libc.so.6+0x20f29)
    #8 0x4057c9 in _start (/home/shared/wayland/wlroots/build/rootston/rootston+0x4057c9)
2018-03-22 21:27:49 +01:00
emersion b1f93bc5cc
render/egl: use EGL_KHR_debug 2018-03-21 10:42:43 +01:00
emersion 3581573bdc
render/gles2: make wlr_renderer_begin take viewport size
This allows raw GL calls outside wlr_renderer to be removed.
2018-03-21 07:37:09 +01:00
emersion 11e5f0bac8
backend/wayland: fix uninitialized wlr_event_keyboard_key::update_state 2018-02-23 09:40:31 +01:00
Drew DeVault 1d9be89e2d
Revert "ELF Visibility" 2018-02-19 18:01:27 -05:00
Scott Anderson 86269052eb Explicitly export EFL symbols 2018-02-19 14:26:40 +13:00
emersion c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion 36ead80cd1
Make wlr_signal_emit_safe private 2018-02-12 19:52:47 +01:00
emersion 10ecf871f2
Remove wlr_backend.events.{output_remove,device_remove} 2018-02-12 10:36:43 +01:00
emersion 5e58d46cc1
Add wlr_signal_emit_safe 2018-02-12 09:12:31 +01:00
emersion bf6d245400
Swap buffers with damage 2018-02-09 22:54:14 +01:00
emersion babdd6ccf7
backend: fix use-after-free when destroying backends
The backend destroy signal is emitted before the output_remove
signal is. When the destroy signal is emitted listeners remove
their output_remove listener, so the output_remove signal is never
received and listeners have an invalid output pointer.

The correct way to solve this would be to remove the output_remove
signal completely and use the wlr_output.events.destroy signal
instead. This isn't yet possible because wl_signal_emit is unsafe
and listeners cannot be removed in listeners.
2018-01-30 19:45:57 +01:00
emersion 704130cc11
output: fix performance issues with wlr_output_schedule_frame 2018-01-30 14:45:02 +01:00
emersion 51c22d39a4
Merge remote-tracking branch 'upstream/master' into output-damage 2018-01-29 23:24:09 +01:00
emersion 8d58ed502b
output: add wlr_output_schedule_frame 2018-01-26 22:39:23 +01:00
emersion ece2c1e4e2
Damage tracking for transformed outputs 2018-01-26 22:11:09 +01:00
emersion 4fa90b0511
Backport screenshooter fixes from the renderer redesign v1
This backports some changes to #319 to fix the screenshooter data
format. This also adds wlr_backend_get_renderer which will be
useful to support multiple renderers.
2018-01-23 22:06:54 +01:00
emersion 59c53e8333
Merge remote-tracking branch 'upstream/master' into output-damage 2018-01-21 22:18:06 +01:00
Johannes Schramm dcc743047b style: include brackets for if/while/for, even if it's a single statement 2018-01-21 16:28:21 +01:00
emersion 0365b587f0
output: add damage tracking via buffer age 2018-01-21 00:06:35 +01:00
emersion 6fa0a91ee2
backend/wayland: fix segfault in wlr_wl_output_destroy 2018-01-18 13:06:57 +01:00
Drew DeVault b331c5c2c5
Merge pull request #549 from emersion/output-enabled
Add wlr_output::enabled
2018-01-15 20:53:13 -05:00
Markus Ongyerth c00e9d1416 adds remote argument to wayland backend create
Add a remote display name argument to wlr_wl_backend_create.
If NULL is passed to the wayland backend at all times, creating a
wayland backend *after* the compositor was started up, would require
changing the WAYLAND_DISPLAY environment variable.
2018-01-13 21:20:15 +01:00