mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-06 06:48:04 +02:00
screenshot: Print warning if we're not launched from weston
weston-screenshooter is a helper binary that weston launches to write the screenshot to disk. If somebody tries to launch it by hand, print a warning and mention the screenshot keybinding.
This commit is contained in:
parent
033b5df52f
commit
c4831be22d
1 changed files with 7 additions and 0 deletions
|
|
@ -241,6 +241,13 @@ int main(int argc, char *argv[])
|
|||
struct screenshooter_output *output;
|
||||
int width, height;
|
||||
|
||||
if (getenv("WAYLAND_SOCKET") == NULL) {
|
||||
fprintf(stderr, "%s is must be launched by weston.\n"
|
||||
"Use the MOD+S shortcut to take a screenshot.",
|
||||
argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
display = wl_display_connect(NULL);
|
||||
if (display == NULL) {
|
||||
fprintf(stderr, "failed to create display: %m\n");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue