From 9bc7adc3d020c6bf607122acafc27ae9246478ae Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Mon, 19 Jun 2017 12:23:34 +0900 Subject: [PATCH] desktop-shell: add init_xkb() to initialize xkb using pepper xkb Change-Id: Ie46bb37f05a3a69e511dc5e79913e845d7c02238 Signed-off-by: Sung-Jin Park --- configure.ac | 2 ++ packaging/pepper.spec | 1 + src/lib/desktop-shell/desktop-shell-internal.h | 3 +++ src/lib/desktop-shell/shell.c | 9 +++++++++ 4 files changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 30a6054..6b30b21 100644 --- a/configure.ac +++ b/configure.ac @@ -104,7 +104,9 @@ PEPPER_DESKTOP_SHELL_DIR="-I\$(top_srcdir)/src/lib/desktop-shell" PEPPER_DESKTOP_SHELL_LIB="\$(top_srcdir)/src/lib/desktop-shell/libpepper-desktop-shell.la" PEPPER_DESKTOP_SHELL_CFLAGS="$PEPPER_DIR $PEPPER_CFLAGS" +PEPPER_DESKTOP_SHELL_CFLAGS="$PEPPER_XKB_DIR $PEPPER_DESKTOP_SHELL_CFLAGS" PEPPER_DESKTOP_SHELL_LIBS="$PEPPER_LIB" +PEPPER_DESKTOP_SHELL_LIBS="$PEPPER_XKB_LIB $PEPPER_XKB_LIBS $PEPPER_DESKTOP_SHELL_LIBS" AC_SUBST(PEPPER_DESKTOP_SHELL_CFLAGS) AC_SUBST(PEPPER_DESKTOP_SHELL_LIBS) diff --git a/packaging/pepper.spec b/packaging/pepper.spec index 056ffff..5d6a182 100644 --- a/packaging/pepper.spec +++ b/packaging/pepper.spec @@ -115,6 +115,7 @@ This package includes desktop-shell module files. %package desktop-shell-devel Summary: Desktop-shell development module for pepper package Requires: pepper-desktop-shell = %{version}-%{release} +Requires: pepper-xkb = %{version}-%{release} %description desktop-shell-devel This package includes desktop-shell development module files. diff --git a/src/lib/desktop-shell/desktop-shell-internal.h b/src/lib/desktop-shell/desktop-shell-internal.h index d4ebfa3..8c5bbc2 100644 --- a/src/lib/desktop-shell/desktop-shell-internal.h +++ b/src/lib/desktop-shell/desktop-shell-internal.h @@ -29,6 +29,7 @@ #include #include "pepper-desktop-shell.h" #include +#include /* Ping timeout value in ms. */ #define DESKTOP_SHELL_PING_TIMEOUT 200 @@ -73,6 +74,8 @@ struct desktop_shell { /* seat add/remove */ pepper_event_listener_t *seat_add_listener; pepper_event_listener_t *seat_remove_listener; + + pepper_xkb_t *xkb; }; struct shell_client { diff --git a/src/lib/desktop-shell/shell.c b/src/lib/desktop-shell/shell.c index 596a12e..d9bc2e4 100644 --- a/src/lib/desktop-shell/shell.c +++ b/src/lib/desktop-shell/shell.c @@ -243,7 +243,9 @@ keyboard_add_callback(pepper_event_listener_t *listener, void *info, void *data) { pepper_keyboard_t *keyboard = info; + shell_seat_t *shseat = (shell_seat_t *)data; pepper_keyboard_set_grab(keyboard, &default_keyboard_grab, NULL); + pepper_xkb_keyboard_set_keymap(shseat->shell->xkb, keyboard, NULL); } static void @@ -399,6 +401,12 @@ init_input(desktop_shell_t *shell) shell_add_input_device(shell, l->item); } +static void +init_xkb(desktop_shell_t *shell) +{ + shell->xkb = pepper_xkb_create(); +} + static pepper_bool_t launch_shell_client(desktop_shell_t *shell) { @@ -447,6 +455,7 @@ pepper_desktop_shell_init(pepper_compositor_t *compositor) if (!launch_shell_client(shell)) PEPPER_ERROR("shell client launch failed, compositor runs without shell client.\n"); + init_xkb(shell); init_listeners(shell); init_input(shell); -- 2.7.4