Commit graph

234 commits

Author SHA1 Message Date
Dominique Martinet
4a1c9a1925 xwm: fix use-after-free involving parents/children
Happens when e.g. closing gimp.

==24039==ERROR: AddressSanitizer: heap-use-after-free on address 0x6150001a7a78 at pc 0x7f09b09f1bb2 bp 0x7ffcf0237bf0 sp 0x7ffcf0237be0
WRITE of size 8 at 0x6150001a7a78 thread T0
    #0 0x7f09b09f1bb1 in wl_list_remove ../util/signal.c:55
    #1 0x7f09b094cf03 in xwayland_surface_destroy ../xwayland/xwm.c:295
    #2 0x7f09b0950245 in xwm_handle_destroy_notify ../xwayland/xwm.c:717
    #3 0x7f09b095304a in x11_event_handler ../xwayland/xwm.c:1149
    #4 0x7f09b0c68f01 in wl_event_loop_dispatch src/event-loop.c:641
    #5 0x7f09b0c67601 in wl_display_run src/wayland-server.c:1260
    #6 0x40a2f4 in main ../sway/main.c:433
    #7 0x7f09b011018a in __libc_start_main (/lib64/libc.so.6+0x2318a)
    #8 0x40b749 in _start (/opt/wayland/bin/sway+0x40b749)

0x6150001a7a78 is located 120 bytes inside of 496-byte region [0x6150001a7a00,0x6150001a7bf0)
freed by thread T0 here:
    #0 0x7f09b2b58880 in __interceptor_free (/lib64/libasan.so.5+0xee880)
    #1 0x7f09b094d1a1 in xwayland_surface_destroy ../xwayland/xwm.c:315
    #2 0x7f09b0950245 in xwm_handle_destroy_notify ../xwayland/xwm.c:717
    #3 0x7f09b095304a in x11_event_handler ../xwayland/xwm.c:1149
    #4 0x7f09b0c68f01 in wl_event_loop_dispatch src/event-loop.c:641
    #5 0x7f09b0c67601 in wl_display_run src/wayland-server.c:1260
    #6 0x40a2f4 in main ../sway/main.c:433
    #7 0x7f09b011018a in __libc_start_main (/lib64/libc.so.6+0x2318a)
    #8 0x40b749 in _start (/opt/wayland/bin/sway+0x40b749)

previously allocated by thread T0 here:
    #0 0x7f09b2b58e50 in calloc (/lib64/libasan.so.5+0xeee50)
    #1 0x7f09b094b585 in xwayland_surface_create ../xwayland/xwm.c:119
    #2 0x7f09b0950151 in xwm_handle_create_notify ../xwayland/xwm.c:706
    #3 0x7f09b0953032 in x11_event_handler ../xwayland/xwm.c:1146
    #4 0x7f09b0c68f01 in wl_event_loop_dispatch src/event-loop.c:641
    #5 0x7f09b0c67601 in wl_display_run src/wayland-server.c:1260
    #6 0x40a2f4 in main ../sway/main.c:433
    #7 0x7f09b011018a in __libc_start_main (/lib64/libc.so.6+0x2318a)
    #8 0x40b749 in _start (/opt/wayland/bin/sway+0x40b749)
2018-06-25 17:28:44 +09:00
Ilia Bozhinov
5dd1a838f3 xwm: set the proper event mask in client messages
Fixes #927
2018-05-26 10:08:20 +03:00
Scott Anderson
1a3921d4d4 Remove unused argument 2018-05-19 23:39:51 +12:00
Vincent Vanlaer
72a75b3a72 Fix Xwayland cleanup
Fixes #964
2018-05-10 01:44:17 +02:00
emersion
8e831cd416
Merge pull request #959 from VincentVanlaer/xwayland-lazy
Add the option to start Xwayland only when a client connects
2018-05-08 23:04:26 +01:00
Vincent Vanlaer
119a6cf35c Make xwayland_finish* clean up wlr_xwayland 2018-05-08 22:22:35 +02:00
Vincent Vanlaer
80586b8f6b Clean up events 2018-05-07 00:48:02 +02:00
Vincent Vanlaer
446ea3a340 Add beter handling for Xwayland failing at startup 2018-05-07 00:43:26 +02:00
Vincent Vanlaer
c80bf1591e Allow xwayland to start lazily
Makes the xwayland startup process two phased.
The first phase just initialises the X11 sockets.
The second phase starts the Xwayland server itself.
When starting xwayland lazily the second phase will be postponed until
a client has connected to the X11 socket.

Changes in behaviour:
The DISPLAY environment is now set immediately after the X11 sockets
are created.
When the Xwayland server is killed or crashes, the sockets will not be
recreated, but reused.

Fixes #849: Start up Xwayland lazily
2018-05-06 23:41:25 +02:00
emersion
cf10cbc00c
Use UTF-8 xwayland window title if available 2018-05-04 20:44:00 +01:00
emersion
001045e47a
xwayland: make utility windows unmanaged again
7f70d244a9 made utility windows
managed, because it made sense according to the spec. Turns out
Firefox uses them for popups.
2018-04-27 10:44:20 +01:00
Drew DeVault
04af09862a
Merge pull request #918 from emersion/xwayland-unmapped-request-configure
xwayland: forward configure events to compositor when unmapped
2018-04-27 10:49:31 +02:00
emersion
7f70d244a9
xwayland: fix some Chromium comboboxes
Some comboboxes (e.g. in chrome://flags) are advertized as…
Notifications of course! Yeah, notifications, the thing that
tells you you have mail, your battery is low, or the dog has
eaten your carpet. This isn't the first time we notice Chromium's
X11 backend is pretty shit.

Anyway, added notifications and splash screens to the list of
unmanaged windows. Also removed utility windows because those
should be managed, but maybe I'm wrong and I'll revert this.
2018-04-26 23:18:59 +01:00
emersion
af668ceb7c
xwayland: forward configure events to compositor when unmapped 2018-04-26 22:18:31 +01:00
emersion
c119c43b48
xwayland/selection: fix little memory leak on error 2018-04-26 15:59:58 +01:00
Drew DeVault
fac2c3e25f
Merge pull request #882 from emersion/unprefix-local-symbols
Remove wlr_ prefix from local symbols
2018-04-26 11:18:01 +02:00
Guido Guenther
085452f9d9 Use correct printf format specifiers for ssize_t
This unbreaks the build on armhf that otherwise fails like

    ../xwayland/selection/incoming.c: In function 'xwm_data_source_write':
    ../include/wlr/util/log.h:34:17: error: format '%ld' expects argument of type 'long int', but argument 6 has type 'ssize_t {aka int}' [-Werror=format=]
      _wlr_log(verb, "[%s:%d] " fmt, wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__)
                     ^
    ../xwayland/selection/incoming.c:34:2: note: in expansion of macro 'wlr_log'
      wlr_log(L_DEBUG, "wrote %zd (chunk size %ld) of %d bytes",
      ^~~~~~~
    ../xwayland/selection/incoming.c:34:44: note: format string is defined here
      wlr_log(L_DEBUG, "wrote %zd (chunk size %ld) of %d bytes",
                                              ~~^
                                              %d
2018-04-26 10:46:11 +02: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
Drew DeVault
12bf39a715
Merge pull request #885 from emersion/remove-surface-subsurface
Remove wlr_surface::subsurface, add wlr_subcompositor
2018-04-22 10:54:15 +02:00
n3rdopolis
a470f101c1
xwayland: preserve the PATH variable
Some systems don't have xwayland in /usr/bin, but in other paths. 
wlroots was unable to find Xwayland binaries outside of standard locations
2018-04-21 19:19:25 -04:00
emersion
3bce5dfc9f
Fix segfaults in wlr_surface_is_* 2018-04-21 19:04:48 +01:00
emersion
fa02e30adf
xwayland: emit new_surface when unmapped 2018-04-13 14:37:13 +02:00
emersion
8dec7036d0
Always unmap before destroying surface 2018-04-11 23:09:13 -04:00
emersion
17d0440b75
Add wlr_xwayland_surface_ping 2018-04-08 16:28:01 -04:00
emersion
c55ad11d96
xwayland: add _NET_WM_WINDOW_TYPE_MENU support 2018-04-08 12:02:52 -04:00
emersion
8b07a4d055
Emit xwayland unmap signal before unmapping
This allows compositors to access the surface being unmapped. This
is also more consistent with the destroy signal.
2018-04-06 14:13:52 -04:00
emersion
591ea27cf9
xwayland: refactor selection code 2018-04-03 12:56:54 -04:00
emersion
67dec2da2b
xwayland: fix incoming incr transfers 2018-04-03 11:26:55 -04:00
emersion
58ac05c276
Merge branch 'master' into xwayland-dnd 2018-04-03 10:38:46 -04:00
emersion
1cd7ff7d3a
xwayland: use strndup in xwm_get_atom_name 2018-04-03 10:36:22 -04:00
emersion
d7e03c7adc
xwayland: fix outgoing incr transfers 2018-04-03 10:25:50 -04:00
emersion
8f84c5b05f
xwayland: only send one target at a time 2018-04-03 00:44:04 -04:00
emersion
103e59703f
xwayland: improve xwm_selection_send_notify 2018-04-02 21:55:09 -04:00
Drew DeVault
506acbdecd Missed a spot 2018-04-02 20:57:09 -04:00
emersion
92b74071d0
xwayland: support multiple wayland → xwayland selection transfers
This fixes drag'n'drop support for Chromium.
2018-04-02 19:56:41 -04:00
emersion
8836b4f024
Merge branch 'master' into xwayland-dnd 2018-04-02 15:57:04 -04:00
emersion
692f1746cf
xwayland: specify xwm cursor stride in bytes 2018-03-31 00:22:58 -04:00
emersion
865b0aa123
xwayland: rename map_notify to map for consistency 2018-03-30 11:01:23 -04:00
emersion
cadfccf1fd
xwayland: use a separate window for drag'n'drop 2018-03-29 17:53:47 -04:00
emersion
79dd4a0ff9
xwayland: receive DND_FINISHED 2018-03-29 12:11:30 -04:00
emersion
ca2a73b90d
xwayland: allow drag data source transfer after drag ends 2018-03-29 11:40:19 -04:00
emersion
5dc5f446a8
xwayland: send drag'n'drop action to data source 2018-03-29 11:19:42 -04:00
emersion
6fd50947bd
xwayland: improve error handling 2018-03-28 21:36:53 -04:00
emersion
3effe153bc
xwayland: make wayland → xwayland work 2018-03-28 17:32:52 -04:00
emersion
30babb3865
xwayland: send DND_LEAVE 2018-03-28 16:26:45 -04:00
emersion
e208f8dd8c
xwayland: fixes events not flushed causing issues with GTK apps 2018-03-28 16:06:49 -04:00
emersion
bde859452d
xwayland: print names of unsupported properties and client messages 2018-03-28 15:45:15 -04:00
emersion
2a34b154e6
xwayland: send DND_DROP 2018-03-28 15:33:23 -04:00
emersion
73394deb76
xwayland: send DND_POSITION 2018-03-28 14:16:14 -04:00