ecore-drm: implement function to disable ecore drm inputs on vt

switching

Summary:
When vt is released by SIGUSR1, drm_inputs have to be disabled.
For that this revision includes,
    1. Unrefer udev monitor
    2. Remove fd handler for udev monitor
    3. Release dbus device

Reviewers: stefan_schmidt, devilhorns, gwanglim

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1268
This commit is contained in:
MinJeong Kim 2014-08-04 08:47:10 -04:00 committed by Chris Michael
parent 638e72fda4
commit 0e4fd1b4d1
3 changed files with 34 additions and 1 deletions

View File

@ -363,6 +363,18 @@ flag_err:
return -1;
}
static void
_dbus_device_close(const char *path)
{
struct stat st;
int ret;
if ((ret = stat(path, &st)) < 0) return;
if (!S_ISCHR(st.st_mode)) return;
_dbus_device_release(major(st.st_rdev), minor(st.st_rdev));
}
static DBusHandlerResult
_dbus_cb_filter(DBusConnection *conn EINA_UNUSED, DBusMessage *msg, void *data EINA_UNUSED)
{
@ -817,3 +829,9 @@ _ecore_drm_dbus_device_open(const char *device)
{
return _dbus_device_open(device);
}
void
_ecore_drm_dbus_device_close(const char *device)
{
_dbus_device_close(device);
}

View File

@ -228,7 +228,10 @@ ecore_drm_inputs_destroy(Ecore_Drm_Device *dev)
Ecore_Drm_Evdev *edev;
EINA_LIST_FREE(seat->devices, edev)
_ecore_drm_evdev_device_destroy(edev);
{
_ecore_drm_dbus_device_close(edev->path);
_ecore_drm_evdev_device_destroy(edev);
}
}
}
@ -300,4 +303,15 @@ EAPI void
ecore_drm_inputs_disable(Ecore_Drm_Input *input)
{
if (!input) return;
udev_monitor_unref(input->monitor);
input->monitor = NULL;
if (input->hdlr)
{
ecore_main_fd_handler_del(input->hdlr);
input->hdlr = NULL;
}
ecore_drm_inputs_destroy(input->dev);
}

View File

@ -230,6 +230,7 @@ struct _Ecore_Drm_Sprite
Eina_Bool _ecore_drm_dbus_init(const char *session);
void _ecore_drm_dbus_shutdown(void);
int _ecore_drm_dbus_device_open(const char *device);
void _ecore_drm_dbus_device_close(const char *device);
Ecore_Drm_Evdev *_ecore_drm_evdev_device_create(Ecore_Drm_Seat *seat, const char *path, int fd);
void _ecore_drm_evdev_device_destroy(Ecore_Drm_Evdev *evdev);