mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-15 21:01:03 +00:00
compositor: make new screenhots free for all on --debug
Replicating the policy of the old screenshooting interface, allow all screenshot to anyone with the new interface as well when --debug is used. Looks like there was one stray trailing space in unrelated code that my editor deleted. Better this way. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
f60c9cc1e9
commit
e40a7eae67
|
@ -130,6 +130,7 @@ struct wet_compositor {
|
|||
pid_t autolaunch_pid;
|
||||
bool autolaunch_watch;
|
||||
bool use_color_manager;
|
||||
struct wl_listener screenshot_auth;
|
||||
};
|
||||
|
||||
static FILE *weston_logfile = NULL;
|
||||
|
@ -3575,6 +3576,17 @@ weston_log_subscribe_to_scopes(struct weston_log_context *log_ctx,
|
|||
weston_log_setup_scopes(log_ctx, flight_rec, flight_rec_scopes);
|
||||
}
|
||||
|
||||
static void
|
||||
screenshot_allow_all(struct wl_listener *l,
|
||||
struct weston_output_capture_attempt *att)
|
||||
{
|
||||
/*
|
||||
* The effect of --debug option: indiscriminately allow everyone to
|
||||
* take screenshots of any output.
|
||||
*/
|
||||
att->authorized = true;
|
||||
}
|
||||
|
||||
static void
|
||||
sigint_helper(int sig)
|
||||
{
|
||||
|
@ -3779,8 +3791,12 @@ wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_data)
|
|||
protologger = wl_display_add_protocol_logger(display,
|
||||
protocol_log_fn,
|
||||
NULL);
|
||||
if (debug_protocol)
|
||||
if (debug_protocol) {
|
||||
weston_compositor_enable_debug_protocol(wet.compositor);
|
||||
weston_compositor_add_screenshot_authority(wet.compositor,
|
||||
&wet.screenshot_auth,
|
||||
screenshot_allow_all);
|
||||
}
|
||||
|
||||
if (flight_rec)
|
||||
weston_compositor_add_debug_binding(wet.compositor, KEY_D,
|
||||
|
|
Loading…
Reference in a new issue