SET(APPCORE_COMMON "appcore-common")
SET(SRCS_common src/appcore.c src/appcore-i18n.c src/appcore-measure.c
# src/appcore-noti.c src/appcore-pmcontrol.c
- src/appcore-rotation.c)
+ src/appcore-rotation.c
+ src/appcore-wayland.c)
SET(HEADERS_common appcore-common.h)
INCLUDE(FindPkgConfig)
#pkg_check_modules(pkg_common REQUIRED pmapi vconf sensor aul rua dlog)
-pkg_check_modules(pkg_common REQUIRED vconf sensor aul dlog)
+pkg_check_modules(pkg_common REQUIRED vconf sensor aul dlog ecore-wayland)
FOREACH(flag ${pkg_common_CFLAGS})
SET(EXTRA_CFLAGS_common "${EXTRA_CFLAGS_common} ${flag}")
ENDFOREACH(flag)
SET(HEADERS_efl appcore-efl.h)
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkg_efl REQUIRED elementary dlog sysman ecore ecore-x gobject-2.0 glib-2.0)
+pkg_check_modules(pkg_efl REQUIRED elementary dlog sysman ecore ecore-wayland gobject-2.0 glib-2.0)
FOREACH(flag ${pkg_efl_CFLAGS})
SET(EXTRA_CFLAGS_efl "${EXTRA_CFLAGS_efl} ${flag}")
ENDFOREACH(flag)
BuildRequires: pkgconfig(sysman)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(ecore)
-BuildRequires: pkgconfig(ecore-x)
+BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: cmake
--- /dev/null
+/*
+ * app-core
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+
+#include <Ecore.h>
+#include <Ecore_Wayland.h>
+
+#include "appcore-internal.h"
+
+/*
+ * Porting of x_raise_win(pid_t pid) in appcore-X.c
+ * to wayland equivalent.
+ *
+ * Require patched wayland/weston/ecore
+ * to support shell_surface_raise request
+ */
+
+/*
+ * the window id of an EFL app in wayland is always 1
+ */
+#define DEFAULT_WIN_ID 1
+
+int wayland_raise_win(pid_t pid)
+{
+
+ int r;
+ int found;
+ struct wl_display *d;
+ Ecore_Wl_Window *win;
+
+ if (pid < 1) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ _DBG("pid > -1: %d", pid);
+
+ r = kill(pid, 0);
+ if (r == -1) {
+ errno = ESRCH; /* No such process */
+ return -1;
+ }
+
+ _DBG("wayland get display:");
+ d = ecore_wl_display_get();
+ _retv_if(d == NULL, -1);
+
+ win = ecore_wl_window_find(DEFAULT_WIN_ID);
+
+ _DBG("window %d:", win);
+ if (!win) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ ecore_wl_window_shell_surface_raise(win);
+
+ return 0;
+}