The server implementation needs to display popup windows in the UI.
This change will add a build time configuration option to build
for either X or wayland, with the default support set for X.
In addition to this, the dbus service files were being installed
in the wrong location and we now need a dbus confg file in order
to have permission to publish the service on the system bus.
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/comm )
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED security-server dlog elementary evas ecore appcore-efl ecore-x ail ecore-file pkgmgr-info iniparser)
+
+OPTION(X11_SUPPORT "Enable X support" ON)
+IF(X11_SUPPORT)
+ ADD_DEFINITIONS("-DHAVE_X11")
+ pkg_check_modules(pkgs REQUIRED security-server dlog elementary evas ecore appcore-efl ecore-x ail ecore-file pkgmgr-info iniparser)
+ELSE()
+ pkg_check_modules(pkgs REQUIRED security-server dlog elementary evas ecore appcore-efl ecore-wayland ail ecore-file pkgmgr-info iniparser)
+ENDIF(X11_SUPPORT)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
CONFIGURE_FILE(pkgmgr.pc.in pkgmgr.pc @ONLY)
configure_file(org.tizen.slp.pkgmgr.service.in org.tizen.slp.pkgmgr.service @ONLY)
+configure_file(org.tizen.slp.pkgmgr.conf.in org.tizen.slp.pkgmgr.conf @ONLY)
configure_file(pkg_path.conf.in pkg_path.conf @ONLY)
configure_file(pkgmgr.patch.sh.in pkgmgr.patch.sh @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgmgr.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/client/include/package-manager.h DESTINATION include)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/client/include/pkgmgr-dbinfo.h DESTINATION include)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tizen.slp.pkgmgr.service DESTINATION ${PREFIX}/share/dbus-1/services/)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tizen.slp.pkgmgr.service DESTINATION ${PREFIX}/share/dbus-1/system-services/)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.tizen.slp.pkgmgr.conf DESTINATION ${SYSCONFDIR}/dbus-1/system.d/)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkg_path.conf DESTINATION ${SYSCONFDIR}/package-manager/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/queue_status DESTINATION ${SYSCONFDIR}/package-manager/server/)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pkgmgr.patch.sh DESTINATION ${SYSCONFDIR}/opt/upgrade/)
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+
+<busconfig>
+ <policy user="root">
+ <allow own="org.tizen.slp.pkgmgr"/>
+ <allow own="org.tizen.slp.pkgmgr_status"/>
+ <allow receive_sender="org.tizen.slp.pkgmgr"/>
+ <allow send_destination="org.tizen.slp.pkgmgr"/>
+ </policy>
+ <policy context="default">
+ <allow receive_sender="org.tizen.slp.pkgmgr"/>
+ <allow send_destination="org.tizen.slp.pkgmgr"/>
+ </policy>
+</busconfig>
[D-BUS Service]
User=root
Name=org.tizen.slp.pkgmgr
-Exec=@PREFIX@/bin/env DISPLAY=:0 @PREFIX@/bin/pkgmgr-server
+Exec=@PREFIX@/bin/pkgmgr-server
+%bcond_with wayland
+
Name: pkgmgr
Summary: Packager Manager client library package
Version: 0.2.89
cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} %{SOURCE1005} %{SOURCE1006} %{SOURCE1007} .
%build
-%cmake .
+%cmake . \
+%if %{with wayland}
+ -DX11_SUPPORT=Off
+%else
+ -DX11_SUPPORT=On
+%endif
+
make %{?jobs:-j%jobs}
%install
%files server -f package-manager.lang
%manifest %{name}-server.manifest
%defattr(-,root,root,-)
-%{_datadir}/dbus-1/services/org.tizen.slp.pkgmgr.service
+%{_datadir}/dbus-1/system-services/org.tizen.slp.pkgmgr.service
+%{_sysconfdir}/dbus-1/system.d/org.tizen.slp.pkgmgr.conf
%{_bindir}/pkgmgr-server
%{_sysconfdir}/package-manager/server
#include <signal.h>
#include <Elementary.h>
#include <appcore-efl.h>
+#ifdef HAVE_X11
#include <Ecore_X.h>
+#endif
#include <Ecore_File.h>
#include <ail.h>
#include <pkgmgr-info.h>
}
#endif
+#ifdef HAVE_X11
static int __X_rotate_disable_focus(Display *dpy, Window win)
{
XWMHints *hints;
return ECORE_CALLBACK_RENEW;
}
+#endif // HAVE_X11
static
int create_popup(struct appdata *ad)
int y;
unsigned char *prop_data = NULL;
int count;
+ int ret;
+
+#ifdef HAVE_X11
ecore_x_window_geometry_get(ecore_x_window_root_get(
ecore_x_window_focus_get()),
&x, &y, &w, &h);
- int ret =
+ ret =
ecore_x_window_prop_property_get(ecore_x_window_root_get
(ecore_x_window_focus_get()),
ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE,
ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
__X_rotate_cb, ad->win);
+#endif // HAVE_X11
double s;
s = w / DESKTOP_W;
backend_info *ptr = NULL;
int r;
+#ifdef HAVE_X11
+ // If DISPLAY is not set then let it default to :0
+ // so we can remove hacks in the service file
+ // to set the env variable (which will blow up wayland)
+ //
+ // Passing overwrite as zero so it will not clobber an
+ // existing value
+ setenv("DISPLAY", ":0", 0);
+#endif
+
ecore_init();
DBG("server start");