summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-11-18 15:06:29 +0200
committerMarius Vlad <marius.vlad@collabora.com>2020-11-19 12:28:35 +0000
commit54ab8a8cc447323d6a25ffdad5f1e98ac595bf26 (patch)
treed6c49800d554789151de56e5f743ec139976d964
parent9c605257e22e0f28939c6b679324488b2719999d (diff)
shell: Throttle the log message
As libweston doesn't currently have a rate limiting the log message function, use a static variable to limit the amount of log message we might be seeing if application do not set-up an app_id. Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I4fb3a5b7421a154d8da483b2ac577df7a60e09cc
-rw-r--r--src/shell.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shell.c b/src/shell.c
index f059de6..5a8cc42 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -54,6 +54,7 @@ agl_shell_desktop_advertise_application_id(struct ivi_compositor *ivi,
struct ivi_surface *surface)
{
struct desktop_client *dclient;
+ static bool display_adv = false;
if (surface->advertised_on_launch)
return;
@@ -63,7 +64,10 @@ agl_shell_desktop_advertise_application_id(struct ivi_compositor *ivi,
const char *app_id =
weston_desktop_surface_get_app_id(surface->dsurface);
if (app_id == NULL) {
- weston_log("WARNING app_is is null, unable to advertise\n");
+ if (!display_adv) {
+ weston_log("WARNING app_is is null, unable to advertise\n");
+ display_adv = true;
+ }
return;
}
agl_shell_desktop_send_application(dclient->resource, app_id);