Commit Graph

328 Commits

Author SHA1 Message Date
Dominique Martinet f481791669 xcb error: get unhandled events names
This provides more friendly debug messages for unhandled events,
for example:
[xwayland/xwm.c:1033] unhandled X11 event: FocusOut (10)
[xwayland/xwm.c:1033] unhandled X11 event: MappingNotify (34)
2018-03-03 16:27:29 +01:00
Dominique Martinet 8026cd2a06 xcb error: always log sequence 2018-03-03 16:13:45 +01:00
Dominique Martinet 6f9da97565 xcb errors: address declare-assign style 2018-03-03 12:00:32 +01:00
Dominique Martinet f8428d1063 xcb errors: optional dependency with improved messages
Now message can look like:
[xwayland/xwm.c:991] xcb error: op ChangeProperty (no minor), code Window (no extension), value 6291465

instead of this one when the lib is not available:
[xwayland/xwm.c:999] xcb error: op 18:0, code 3, sequence 103, value 6291465

The value in case of Window is the window id, so we can tell what
function applied on which window which is a good start.
The sequence ought to be able to tell us more precisely which
invocation it was, but we never log it when calling functions
so is useless in practice and no longer logged.
2018-03-03 11:46:04 +01:00
Dominique Martinet 2a9ba5c8dc xcb errors: log raw values 2018-03-03 11:43:23 +01:00
Dominique Martinet 5ec06dcecd xwm: fix call of xcb_change_window_attributes for old gcc versions
gcc 6.3.0 (at least) complains about &values:
expected ‘const uint32_t * {aka const unsigned int *}’ but argument
is of type ‘uint32_t (*)[1] {aka unsigned int (*)[1]}’

Reported by thorwil on irc
2018-03-01 21:13:00 +01:00
Markus Ongyerth bb676013ed add xwayland unmanaged tests to support dmenu
This adds `wlr_xwayland_surface_is_unamanged`, to allow compositors more
fine grained control over XWayland focus.
A surface that is unmanaged should not receive focus, while other
windows that are just override redirect may want it (dmenu).
The way unamanged is determined is taken from wlc.
2018-02-26 12:02:49 +01:00
emersion b1e2718dd7
xwayland: fix some use-after-free in xwm 2018-02-23 10:20:53 +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
Drew DeVault 8c1cc45c7d
Merge pull request #629 from emersion/safe-wl-resource-get-user-data
Wrap wl_resource_get_user_data into safer helper functions
2018-02-16 09:27:26 -05:00
Rodrigo Lourenço 168e26489a Add missing dependencies 2018-02-14 18:42:39 +00:00
emersion 392d54a35d
Wrap wl_resource_get_user_data into safer helper functions
This ensures we're not incorrectly casting a resource.

Fixes #628
2018-02-13 23:48:46 +01: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 5e58d46cc1
Add wlr_signal_emit_safe 2018-02-12 09:12:31 +01:00
emersion 59c53e8333
Merge remote-tracking branch 'upstream/master' into output-damage 2018-01-21 22:18:06 +01:00
emersion f704c3d42b
rootston: fix damage tracking for fullscreen xwayland views 2018-01-21 22:08:38 +01:00
Johannes Schramm 47eb478c35 style: add else keywords in xwm.c 2018-01-21 17:04:23 +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 eeffe11337
surface: add wlr_surface new_subsurface and wlr_subsurface destroy events 2018-01-21 14:22:33 +01:00
emersion 65b28b3823
xwayland: render children window in fullscreen 2018-01-14 18:19:37 +01:00
emersion 38ed3b4245
seat: rename selection_source to selection_data_source, remove unused data_device 2017-12-30 09:58:04 +01:00
Dominique Martinet 6ed1884c84 xwm_get_render_format: fix typo in error message 2017-12-29 21:23:55 +01:00
Dominique Martinet ec952931a1 wlr_xwayland: preserve end of struct on restart
This is more robust than trying to recopy a few fields.
Note: wlr_xwayland->events.ready now resets after each trigger, so one can
hook on it again and be called when restart is ready
2017-12-29 20:50:50 +01:00
Dominique Martinet a6fb4b007b xwm_get_render_format: check NULL return value 2017-12-29 20:31:04 +01:00
Dominique Martinet 41649a1f9a xwm_selection_finish: set NULL seat for xwayland
While they could eventually be split appart, the current approach could lead to
double wl_list_remove() calls on selections which is incorrect
2017-12-29 20:30:49 +01:00
Dominique Martinet e0eafa0429 xwayland: listen to wlr_seat destroy signal 2017-12-29 19:00:08 +01:00
Dominique Martinet 61b91a5721 xwayland restart: copy seat and events over
This is very ugly, there must be a better way to do that (not memset it?)
Meanwhile, this fixes rootston xwayland on restart
2017-12-29 17:33:11 +01:00
Dominique Martinet bb0d888f25 xwayland selection: further cleanup on Xwayland exit
This is necessary if our last primary/clipboard selection was on Xwayland,
and we try to paste to native wayland after Xwayland died
2017-12-29 16:30:59 +01:00
Dominique Martinet f8a346380c xwayland xwm_get_render_format: free reply 2017-12-29 15:56:47 +01:00
Dominique Martinet dad9543c51 Xwayland: remove xwm from selection seat listeners on destroy 2017-12-29 15:56:26 +01:00
Dominique Martinet e5dd98c7f5 xwayland/selection: handle wl_array_add failure better
Just abort and deregister instead of trying to throw some input out,
which would have lead to inconsistent paste
2017-12-28 12:17:57 +01:00
Dominique Martinet 3eb4fa15ee ENOMEM checks: consistently check wl_array_add return 2017-12-28 09:48:35 +01:00
Björn Esser ff13849624
config: Avoid clash with other config-headers 2017-12-27 17:13:58 +01:00
emersion a79dc7df51
Merge pull request #524 from acrisci/role-committed
[wip] Role committed
2017-12-27 13:02:49 +01:00
Tony Crisci 5c5f0611c4 xwayland: role committed 2017-12-27 06:50:21 -05:00
Tony Crisci e809250171
Merge pull request #519 from emersion/xwayland-primary-selection
Implement xwayland primary selection sync
2017-12-27 06:23:04 -05:00
emersion 1c9b09ca92
Add logging to selection message handlers 2017-12-27 11:58:51 +01:00
emersion b3072f81fe
Allow calling xwm_set_seat with a NULL seat 2017-12-27 11:49:25 +01:00
Björn Esser 57a09c8ca4
config: Put all defines into config.h 2017-12-26 18:51:27 +01:00
emersion 998267e291
Fix primary selection not sent to xwayland when clipboard is empty 2017-12-26 12:20:01 +01:00
emersion 4a11609b76
Fix use-after-free when destroying selection sources 2017-12-25 18:18:26 +01:00
emersion cdc21cdcff
Properly free selection sources 2017-12-25 16:23:17 +01:00
emersion 6dffaa7bb7
Implement xwayland primary selection sync 2017-12-25 16:10:16 +01:00
emersion 810c4b119b
Fix clipboard from xwayland to wayland 2017-12-15 09:42:42 +01:00
emersion 76dcb694c1
Send empty selection when clipboard is empty 2017-12-15 09:37:04 +01:00
emersion 5584f42c1e
Destroy xwm selection window on destroy 2017-12-15 00:05:05 +01:00
emersion 6b42bfad18
Merge branch 'master' into xwm-selection 2017-12-14 23:59:04 +01:00
emersion b884025558
Deny access to clipboard if no xwayland window is focused 2017-12-14 23:57:44 +01:00
emersion 75ef7860bb
Merge branch 'master' into display-destroy 2017-12-14 20:29:30 +01:00
emersion 343efd0c20
Only reply to clipboard selection events 2017-12-14 16:44:30 +01:00
emersion a4094c82c7
Support selection MIME types from wayland to xwayland 2017-12-14 16:24:12 +01:00
emersion 62a16a356d
Support selection MIME types from xwayland to wayland 2017-12-14 13:59:36 +01:00
emersion 6ef0219763
Merge branch 'master' into xwm-selection 2017-12-14 11:20:38 +01:00
Tony Crisci ea4b871e16 xwm: user custom event handler 2017-12-13 17:54:19 -05:00
emersion c67a5824b8
Merge branch 'master' into display-destroy 2017-12-11 16:14:03 +01:00
Tony Crisci 4da4048189 remove todo 2017-12-09 09:21:11 -05:00
Tony Crisci a4bb0574c4 selection fixes 2017-12-08 09:46:50 -05:00
Tony Crisci 52cda5653b Revert "xwm: only take clipboard if window is focused"
This reverts commit e3542d879d.
2017-12-08 09:23:26 -05:00
Tony Crisci 35188834db Merge branch 'master' into feature/xwm-selection 2017-12-08 09:22:44 -05:00
Tony Crisci 31bafc2461 xwm: use edges enum 2017-12-08 06:03:57 -05:00
emersion e30b943fbd
Destroy xwayland client when possible 2017-12-08 10:58:36 +01:00
emersion b06535718d
Do not destroy wl_client in wlr_xwayland_finish 2017-12-08 01:38:45 +01:00
emersion 18eb1eee3f
Listen to display destroy in xwayland, rename wlr_egl_free 2017-12-08 00:59:37 +01:00
Tony Crisci 86df909256 xwayland: remove xwayland param from xsurface methods 2017-12-03 17:30:57 -05:00
Tony Crisci 5d7eb438d9
Merge pull request #437 from emersion/fullscreen
Fullscreen support
2017-11-30 03:25:05 -05:00
Tony Crisci e3542d879d xwm: only take clipboard if window is focused 2017-11-22 14:58:36 -05:00
Greg V 1ae944c071 Use SIGUSR2 for vt switching instead of SIGUSR1
Xwayland uses SIGUSR1 to signal readiness.
With direct(-freebsd) session and Xwayland, wlroots was confusing the
Xwayland readiness signal with a vt switch signal, freezing the desktop.

Same problem was found in Weston in 2014:
https://phabricator.freedesktop.org/T7080
2017-11-22 16:29:31 +03:00
Tony Crisci fc17c74516 xwayland: clean up seat setting 2017-11-22 08:23:23 -05:00
Tony Crisci b0683874e9 xwm: send selection data 2017-11-22 08:10:06 -05:00
Greg V 71aa634ac5 Fix Xwayland second socket path on non-Linux systems
It was creating two sockets with the same path
2017-11-22 15:17:10 +03:00
Tony Crisci ea6f77b484 xwm: get selection data 2017-11-21 18:25:21 -05:00
Tony Crisci 39e2ea8420 xwm: get selection targets 2017-11-21 18:09:25 -05:00
emersion dcb168914e
Merge branch 'master' into fullscreen 2017-11-21 18:34:12 +01:00
Tony Crisci 1ada1b7f0b xwm: x11 data source 2017-11-21 11:19:55 -05:00
Tony Crisci c67cf2e9e4 xwm: handle selection stubs 2017-11-21 10:18:44 -05:00
Tony Crisci 1f976a0f25 xwm: xfixes selection notify 2017-11-21 09:25:05 -05:00
Tony Crisci e786d17f63 Merge branch 'master' into feature/xwm-selection 2017-11-21 07:55:36 -05:00
emersion 151901123f
Merge branch 'master' into refactor-wlr-list 2017-11-20 21:15:58 +01:00
emersion bc68f26960
Fix evince fullscreen under xwayland 2017-11-20 19:52:47 +01:00
Tony Crisci 444257b6b1 xwm: selection init 2017-11-20 08:51:40 -05:00
Tony Crisci 3880fb0a53 xwm: selection stubs 2017-11-20 07:42:09 -05:00
Tony Crisci 0672d9cb52 bug: properly send WM_STATE 2017-11-19 17:55:02 -05:00
emersion 016744ef4d
Refactor wlr_list inside wlroots 2017-11-19 00:17:40 +01:00
Drew DeVault a317ecdab8 Run startup command after xwayland is ready 2017-11-12 16:01:48 -05:00
emersion 26dadacb71
Add wl_shell support for maximized views 2017-11-09 20:06:05 +01:00
emersion 758514fe5d
Fix xwayland _NET_WM_STATE handling 2017-11-09 11:21:55 +01:00
emersion 900fb326f7
Fixes segfault when no xcb_render_pictforminfo_t is available 2017-11-02 17:21:00 +01:00
emersion bb76f52640
Fetch xcb_render_pictformat_t at startup 2017-11-02 16:59:57 +01:00
emersion 3f4ad47421
Use compositor theme for xwm cursor 2017-11-02 16:49:22 +01:00
emersion ddd7b7711c
Load xwm cursor from theme 2017-11-02 15:52:02 +01:00
emersion 4254c28138
Free xwm cursor in xwm_destroy 2017-11-02 11:09:14 +01:00
emersion bdaf66a292
Set xwayland root cursor 2017-11-02 00:03:55 +01:00
Dominique Martinet bf225a60d8 rootston: flush 'close' command on Xwayland
The close would otherwise wait for another xcb event to happen.
Flushing helps 'close' feel reactive.
2017-11-01 20:08:26 +01:00
Tony Crisci ce72a687ce xwm: cleanup send focus window logic 2017-10-29 10:40:16 -04:00
Tony Crisci 88316e7921 xwm: get rid of xcb call macro 2017-10-29 10:36:16 -04:00
Tony Crisci 942a19a069 xwm: cleanup and consistent naming 2017-10-29 10:31:01 -04:00
Tony Crisci 680f8a169d xwm: remove duplicate calls in net wm state read 2017-10-27 15:32:19 -04:00
Tony Crisci 325def3841 xwm: create colormap and visual depth detection 2017-10-27 15:20:50 -04:00
Tony Crisci be297d9d14 xwm: net wm state 2017-10-27 13:17:34 -04:00
Tony Crisci 6a4290b86a xwm: moveresize events 2017-10-27 10:48:09 -04:00
Tony Crisci 4a106648c4 xwm: remove incorrect implementation of net wm state 2017-10-26 15:58:18 -04:00
Tony Crisci 32b848bd46 xwm: handle focus in 2017-10-26 11:54:39 -04:00
Tony Crisci 930ab06857 xwm: send net_wm_state 2017-10-26 11:39:08 -04:00
Tony Crisci 263279b7e0 xwm: rewrite xwm initialization 2017-10-26 10:39:36 -04:00
Tony Crisci ff0006d0f0 xwm: refactor client message handler 2017-10-26 09:01:53 -04:00
Tony Crisci a861b380ef xwm: add net active window to supported 2017-10-25 20:41:55 -04:00
Tony Crisci 7914f4bda9 xwm: dont focus override redirect windows 2017-10-25 20:40:55 -04:00
Tony Crisci d6a1e6fd79 xwm: dont flush if no events 2017-10-25 18:51:15 -04:00
Tony Crisci b443b9a998 xwm: set net active window on xwm create 2017-10-25 08:42:42 -04:00
Tony Crisci 0d1dd84a48 xwm: improve activation and dont send focus twice 2017-10-25 08:39:28 -04:00
Tony Crisci 1be650d78a xwm: only emit unmap notify once 2017-10-25 07:12:25 -04:00
Tony Crisci e5ee01254b xwm: map and unmap notify 2017-10-24 21:07:46 -04:00
Tony Crisci 22435e00c5 xwm: 80col cleanup 2017-10-24 19:18:31 -04:00
Tony Crisci 7643765e7b xwm: unpaired surface list cleanup 2017-10-24 19:16:50 -04:00
Alexander Taylor 3277c6d994 Fix order of WM_HINTS and WM_PROTOCOLS in xwm atom_map 2017-10-24 19:11:57 -04:00
Tony Crisci 2ff94d0036 xwm: get rid of displayable surfaces list 2017-10-24 18:57:20 -04:00
Tony Crisci 79e14f65e0 xwm: fix lists 2017-10-24 14:37:18 -04:00
Tony Crisci fa94a06fd6 xwm: handle configure notify 2017-10-24 13:57:10 -04:00
Tony Crisci a9d70a6256 xwm: set window attributes on create 2017-10-24 13:24:26 -04:00
Tony Crisci a3f2754668 xwm: add surface to rootston on surface commit 2017-10-24 12:00:43 -04:00
Tony Crisci c666d34d2d xwm: add missing atoms to list 2017-10-24 11:00:41 -04:00
Tony Crisci 79978383ba xwm: net active window 2017-10-24 10:04:33 -04:00
Tony Crisci 03bd34e826 xwm: atom cleanup 2017-10-24 09:21:11 -04:00
Tony Crisci 2ca502b546 Merge branch 'master' into feature/xwm-rewrite 2017-10-24 09:11:12 -04:00
Tony Crisci 0f7f6b1373 xwm: refactor xwm init 2017-10-24 08:49:10 -04:00
Tony Crisci 1dbe314937 Merge branch 'master' into feature/data-device-selection 2017-10-24 07:57:36 -04:00
Drew DeVault c5fff08f8a Forgot to rename these 2017-10-22 10:56:40 -04:00
Tony Crisci fb25adae36 xwayland: use xfixes extension 2017-10-15 14:50:21 -04:00
Greg V a5fe9aa736 Add FreeBSD compatibility 2017-10-11 00:07:21 +03:00
Drew DeVault 6aafc2f61a Merge pull request #223 from versusvoid/xwayland-activate
Activate only active xwayland views
2017-10-06 09:34:48 -04:00
Drew DeVault 528f000a7a Deactivate xwayland when focus leaves there 2017-10-06 09:34:22 -04:00
Versus Void c22b02618c Flush xwayland surface configuration
Fix #215
2017-10-06 12:55:36 +03:00
emersion 12b9b1a4bd
Copy xcb_icccm structs into wlroots 2017-10-05 22:23:37 +02:00
emersion 454a6a902b
Parse _MOTIF_HINTS 2017-10-05 19:11:28 +02:00
emersion fc61e82795
Use pointers for xwayland hints and size_hints 2017-10-05 19:11:28 +02:00
emersion 267f24753f
Add support for WM_HINTS 2017-10-05 19:10:24 +02:00
emersion ed9796ec68
xwayland: parse normal hints 2017-10-05 19:10:23 +02:00
emersion ef5914bdb6
xwayland: add wlr_xwayland_surface->motif_hints 2017-10-05 19:10:23 +02:00
emersion 0c22ad09a7
xwayland: request hints 2017-10-05 19:10:23 +02:00
Versus Void c5df6ca900 Fix memory leaks 2017-10-05 20:01:56 +00:00
Calvin Lee dd4bdf1f56 Unset $DISPLAY until XWayland is ready 2017-10-03 22:42:10 -06:00
emersion 7f5d0624d6
Add x, y, width, height arguments to wlr_xwayland_surface_configure 2017-09-30 16:33:04 +02:00
emersion 4ccb83bf33
xwayland: add wlr_xwayland_surface_close 2017-09-29 23:18:12 +02:00
emersion 5002d968f3
xwayland: add window_type support 2017-09-29 23:03:01 +02:00
emersion b78ae54158
xwayland: add pid support 2017-09-29 22:43:14 +02:00
emersion 97346e7a1b
xwayland: add state support 2017-09-29 22:26:03 +02:00
emersion 7c9f3240f6
xwayland: add set_parent event 2017-09-29 20:22:35 +02:00
emersion d8c86431e0
xwayland: add signals for configure, set_{class,title} 2017-09-29 18:28:38 +02:00
emersion f2b03b2ec1
Add reply->type checks, add XCB_ATOM_WM_TRANSIENT_FOR 2017-09-29 16:44:22 +02:00
emersion 47d767dbc4
xwayland: expose wlr_xwayland_surface_configure 2017-09-29 16:19:06 +02:00
emersion e3917af69d
xwayland: read window title & class 2017-09-29 15:57:21 +02:00
Drew DeVault efadbf8424 Fix atom_map usage 2017-09-28 18:47:20 -04:00
emersion f0a14a318c
Fix segfault on startup 2017-09-28 23:50:20 +02:00
emersion b7927078e9
x11 -> xwayland, window -> surface, fix some calloc sizes and wrong types 2017-09-28 23:26:31 +02:00
Drew DeVault 3cd4cf4fba Fix ATOM_LAST position 2017-09-28 09:30:43 -04:00
Drew DeVault 220a6e9bf6 Add xwayland activate and fix EGL bug 2017-09-28 09:11:16 -04:00
Drew DeVault 906a816abf Fix rootston keyboard, add Xwayland 2017-09-28 08:54:57 -04:00
Tony Crisci 368f74e4df Refactor meson build files
Use tabs for indentation and break up function calls over 80 col.
2017-08-30 14:30:47 -04:00
Dominique Martinet c278b6fd52 xwayland: free xcb events 2017-08-27 22:30:56 +02:00
Dominique Martinet 871646d225 Double-fork for xwayland execution
The intermediate fork needs to wait for SIGUSR1 for when Xserver is
ready, or SIGCHLD if the exec didn't work out.

Also change the exit() to _exit() as that is apparently more appropriate
for forks (and waitpid's status was wrong without it for some reason)

Fixes #122.
2017-08-27 21:41:08 +02:00
Scott Anderson 48fa59c22e Remove __PRETTY_FUNCTION__
This is pointlessly non-portable and completely equivilent to __func__
in C.
2017-08-26 22:43:42 +12:00
Dominique Martinet b29c7d01b1 xwayland: relinquish wl_fd[0] after creating client
wayland WILL close this fd during wl_client_destroy, after our handler
if we close it as well this will close some of the fd we reopened
2017-08-24 07:51:24 +02:00
Dominique Martinet 4a288fdacb xwm: free x11 windows on finish 2017-08-24 07:51:24 +02:00
Dominique Martinet e3143b50b6 xwayland: fix some shutdown cases 2017-08-24 07:51:24 +02:00
Dominique Martinet fd3ad3b9e4 xwayland: fix shutdown caused by Xwayland/client stop 2017-08-24 07:51:24 +02:00
Dominique Martinet 0196284331 xwm: remove xcb-util dependency
This hardcodes a define, but other projects (wlc/weston) either use the raw
number or just redefine it with another name anyway...

This should fix travis build.
2017-08-23 22:03:49 +02:00
Dominique Martinet 3391e5b634 xwayland: fix style issues 2017-08-23 22:03:49 +02:00
Dominique Martinet a39b091bd9 xwm: reply to configure_requests 2017-08-23 22:03:49 +02:00
Dominique Martinet 1458a95e65 example compositor: loop through xwayland surfaces 2017-08-23 22:03:49 +02:00
Dominique Martinet f912316d9b xwm: handle some more events
handle map/unmap_notify, property_notify (just logging for now), and
client_message for wl_surface_id.

We almost can display an X window now, just need the compositor to
iterate over them
2017-08-23 22:03:49 +02:00
Dominique Martinet eb5b9cc6da xwayland: move & split internal header file 2017-08-23 22:03:49 +02:00
Dominique Martinet fa0e1015c6 xwm: fix minimal init, this gets us some events on window creations 2017-08-23 22:03:49 +02:00
Dominique Martinet 6eb20fb8d2 init xwm only once Xwayland server is ready 2017-08-23 22:03:49 +02:00
Dominique Martinet 3cc5b1acc6 wlr_compositor: add signal for create_surface 2017-08-23 22:03:49 +02:00
Dominique Martinet b2bab1af5c xwayland: split xwm structure out, initial xwm.c 2017-08-23 22:03:49 +02:00
Dominique Martinet 49a823d4c6 Xwayland: first draft, just start server for now 2017-08-23 22:03:49 +02:00