diff --git a/compositor/meson.build b/compositor/meson.build index 8a54ea99..427167e7 100644 --- a/compositor/meson.build +++ b/compositor/meson.build @@ -78,6 +78,7 @@ if get_option('screenshare') deps_screenshare = [ dep_libexec_weston, dep_libshared, + dep_shell_utils, dep_libweston_public, dep_libweston_private_h, # XXX: https://gitlab.freedesktop.org/wayland/weston/issues/292 dep_wayland_client, diff --git a/compositor/screen-share.c b/compositor/screen-share.c index 0c2f413d..c79bc3c4 100644 --- a/compositor/screen-share.c +++ b/compositor/screen-share.c @@ -47,6 +47,7 @@ #include "shared/helpers.h" #include "shared/os-compatibility.h" #include "shared/timespec-util.h" +#include "shell-utils/shell-utils.h" #include "fullscreen-shell-unstable-v1-client-protocol.h" struct shared_output { @@ -1144,16 +1145,19 @@ share_output_binding(struct weston_keyboard *keyboard, struct screen_share *ss = data; pointer = weston_seat_get_pointer(keyboard->seat); - if (!pointer) { - weston_log("Cannot pick output: Seat does not have pointer\n"); - return; + if (pointer) { + output = weston_output_find(pointer->seat->compositor, + wl_fixed_to_int(pointer->x), + wl_fixed_to_int(pointer->y)); + } else { + output = get_focused_output(keyboard->seat->compositor); + if (!output) + output = get_default_output(keyboard->seat->compositor); } - output = weston_output_find(pointer->seat->compositor, - wl_fixed_to_int(pointer->x), - wl_fixed_to_int(pointer->y)); if (!output) { - weston_log("Cannot pick output: Pointer not on any output\n"); + weston_log("Cannot pick output: Pointer not on any output, " + "or no focused/default output found\n"); return; } diff --git a/meson.build b/meson.build index 67917dea..82796740 100644 --- a/meson.build +++ b/meson.build @@ -170,8 +170,8 @@ subdir('shared') subdir('libweston') subdir('libweston-desktop') subdir('xwayland') -subdir('compositor') subdir('shell-utils') +subdir('compositor') subdir('desktop-shell') subdir('fullscreen-shell') subdir('ivi-shell')