diff options
author | Eugen Friedrich <efriedrich@de.adit-jv.com> | 2020-01-09 16:00:19 +0100 |
---|---|---|
committer | Eugen Friedrich <efriedrich@de.adit-jv.com> | 2020-01-09 16:00:19 +0100 |
commit | 9ba992bed3fd1eef39bacf64ed94fa7ae5467d73 (patch) | |
tree | 3befac3cf814b9b61ebcc294a0cfed0f4e87bc5e | |
parent | 0cc3904b8f27775cb1d0900c6355e0f5dbd06ec1 (diff) | |
parent | 7f11e0f503a36855c1bf783f06b26bf893592604 (diff) | |
download | wayland-ivi-extension-9ba992bed3fd1eef39bacf64ed94fa7ae5467d73.tar.gz |
Merge remote-tracking branch 'upstream/pull/111'
* upstream/pull/111
simple-weston-client: add cursor enable option
ivi-controller: add cursor enable option
Reviewed-by: Eugen Friedrich <efriedrich@de.adit-jv.com>
Tested-by: Eugen Friedrich <efriedrich@de.adit-jv.com>
-rw-r--r-- | ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c | 20 | ||||
-rw-r--r-- | weston-ivi-shell/src/ivi-controller.c | 9 | ||||
-rw-r--r-- | weston-ivi-shell/src/ivi-controller.h | 1 |
3 files changed, 25 insertions, 5 deletions
diff --git a/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c b/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c index 4093cf2..bf67075 100644 --- a/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c +++ b/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c @@ -88,6 +88,7 @@ typedef struct _WaylandContext { pthread_t dlt_ctx_thread; int pipefd[2]; #endif + uint8_t enable_cursor; }WaylandContextStruct; struct debug_stream { @@ -105,12 +106,18 @@ static const char *left_ptrs[] = { }; static BkGndSettingsStruct* -get_bkgnd_settings(void) +get_bkgnd_settings_cursor_info(WaylandContextStruct* wlcontext) { BkGndSettingsStruct* bkgnd_settings; char *option; char *end; + option = getenv("IVI_CLIENT_ENABLE_CURSOR"); + if(option) + wlcontext->enable_cursor = (uint8_t)strtol(option, &end, 0); + else + wlcontext->enable_cursor = 0; + bkgnd_settings = (BkGndSettingsStruct*)calloc(1, sizeof(BkGndSettingsStruct)); @@ -470,9 +477,11 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, &ivi_application_interface, 1); } else if (!strcmp(interface, "wl_seat")) { - wlcontext->wl_seat = + if (wlcontext->enable_cursor) { + wlcontext->wl_seat = wl_registry_bind(registry, name, &wl_seat_interface, 1); - wl_seat_add_listener(wlcontext->wl_seat, &seat_Listener, data); + wl_seat_add_listener(wlcontext->wl_seat, &seat_Listener, data); + } } #ifdef LIBWESTON_DEBUG_PROTOCOL else if (!strcmp(interface, weston_debug_v1_interface.name)) { @@ -812,11 +821,12 @@ int main (int argc, const char * argv[]) sigaction(SIGTERM, &sigint, NULL); sigaction(SIGSEGV, &sigint, NULL); + wlcontext = (WaylandContextStruct*)calloc(1, sizeof(WaylandContextStruct)); + /*get bkgnd settings and create shm-surface*/ - bkgnd_settings = get_bkgnd_settings(); + bkgnd_settings = get_bkgnd_settings_cursor_info(wlcontext); /*init wayland context*/ - wlcontext = (WaylandContextStruct*)calloc(1, sizeof(WaylandContextStruct)); wlcontext->bkgnd_settings = bkgnd_settings; #ifdef LIBWESTON_DEBUG_PROTOCOL diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c index 5a5e17c..87ebd2e 100644 --- a/weston-ivi-shell/src/ivi-controller.c +++ b/weston-ivi-shell/src/ivi-controller.c @@ -43,6 +43,7 @@ #define IVI_CLIENT_SURFACE_ID_ENV_NAME "IVI_CLIENT_SURFACE_ID" #define IVI_CLIENT_DEBUG_SCOPES_ENV_NAME "IVI_CLIENT_DEBUG_STREAM_NAMES" +#define IVI_CLIENT_ENABLE_CURSOR_ENV_NAME "IVI_CLIENT_ENABLE_CURSOR" struct ivilayer; struct iviscreen; @@ -1985,6 +1986,10 @@ get_config(struct weston_compositor *compositor, struct ivishell *shell) "bkgnd-color", &shell->bkgnd_color, 0xFF000000); + weston_config_section_get_bool(section, + "enable-cursor", + &shell->enable_cursor, 0); + wl_array_init(&shell->screen_ids); while (weston_config_next_section(config, §ion, &name)) { @@ -2172,6 +2177,10 @@ launch_client_process(void *data) setenv(IVI_CLIENT_DEBUG_SCOPES_ENV_NAME, shell->debug_scopes, 0x1); free(shell->debug_scopes); } + if(shell->enable_cursor) { + sprintf(option, "%d", shell->enable_cursor); + setenv(IVI_CLIENT_ENABLE_CURSOR_ENV_NAME, option, 0x1); + } shell->client = weston_client_start(shell->compositor, shell->ivi_client_name); diff --git a/weston-ivi-shell/src/ivi-controller.h b/weston-ivi-shell/src/ivi-controller.h index c279146..aeaba03 100644 --- a/weston-ivi-shell/src/ivi-controller.h +++ b/weston-ivi-shell/src/ivi-controller.h @@ -85,6 +85,7 @@ struct ivishell { int32_t bkgnd_surface_id; uint32_t bkgnd_color; + uint8_t enable_cursor; struct ivisurface *bkgnd_surface; struct weston_layer bkgnd_layer; struct weston_view *bkgnd_view; |