diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2019-09-16 19:43:18 +0300 |
---|---|---|
committer | Sergey Bugaev <bugaevc@gmail.com> | 2019-09-16 19:52:50 +0300 |
commit | 7c771d259d40a79f974af9e445b45b16da0b9172 (patch) | |
tree | a789026f2ac347c3fdcdecd9f1fd7895625ea8f3 | |
parent | 235f10060f58f012af6d5fb079a52e09c30f49da (diff) |
Improve an error message
Namely, print a better the error message when trying to
use the --watch mode if wl-clipboard was built without
wlr-data-control support.
-rw-r--r-- | src/util/misc.c | 13 | ||||
-rw-r--r-- | src/util/misc.h | 1 | ||||
-rw-r--r-- | src/wl-paste.c | 5 |
3 files changed, 15 insertions, 4 deletions
diff --git a/src/util/misc.c b/src/util/misc.c index f252a62..e9f7671 100644 --- a/src/util/misc.c +++ b/src/util/misc.c @@ -44,3 +44,16 @@ void complain_about_selection_support(int primary) { bail("The compositor does not seem to support primary selection"); } + +void complain_about_watch_mode_support() { +#ifdef HAVE_WLR_DATA_CONTROL + bail( + "Watch mode requires a compositor that supports " + "wlroots data-control protocol" + ); +#else + bail( + "wl-clipboard was built without wlroots data-control protocol support" + ); +#endif +} diff --git a/src/util/misc.h b/src/util/misc.h index be5298f..02c9984 100644 --- a/src/util/misc.h +++ b/src/util/misc.h @@ -27,5 +27,6 @@ void print_version_info(void); void complain_about_selection_support(int primary); +void complain_about_watch_mode_support(void); #endif /* UTIL_MISC_H */ diff --git a/src/wl-paste.c b/src/wl-paste.c index 899c7c4..a6572b6 100644 --- a/src/wl-paste.c +++ b/src/wl-paste.c @@ -443,10 +443,7 @@ int main(int argc, argv_t argv) { if (device->needs_popup_surface) { if (options.watch) { - bail( - "Watch mode requires a compositor that supports " - "wlroots data-control protocol" - ); + complain_about_watch_mode_support(); } /* If we cannot get the selection directly, pop up * a surface. When it gets focus, we'll immediately |