ecore_drm: initialize dev->window value to -1, meaning unset yet. 29/62029/3
authorDuna Oh <duna.oh@samsung.com>
Mon, 14 Mar 2016 03:06:43 +0000 (12:06 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 15 Mar 2016 06:53:58 +0000 (23:53 -0700)
The window value from ecore_evas could be zero.
So use -1 as a default value.

Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: I4c347e9fd29eee0c0a6f90c81fd53745bfde895e

src/lib/ecore_drm/ecore_drm_device.c
src/lib/ecore_drm/ecore_drm_inputs.c

index 70da017..d0be573 100644 (file)
@@ -273,6 +273,7 @@ cont:
         dev->format = 0;
         dev->use_hw_accel = EINA_FALSE;
         dev->session = NULL;
+        dev->window = -1;
 
         DBG("Using Drm Device: %s", dev->drm.name);
 
index 5e0276e..2d7b89e 100644 (file)
@@ -194,7 +194,7 @@ _device_added(Ecore_Drm_Input *input, struct libinput_device *device)
                    _ecore_drm_event_input_device_add_free,
                    NULL);
 
-   if (input->dev->window != 0)
+   if (input->dev->window != -1) // window id is valid
      _ecore_drm_device_info_send(input->dev->window, edev, EINA_TRUE);
 
    TRACE_INPUT_END();
@@ -232,7 +232,7 @@ _device_removed(Ecore_Drm_Input *input, struct libinput_device *device)
                    _ecore_drm_event_input_device_del_free,
                    NULL);
 
-   if (input->dev->window != 0)
+   if (input->dev->window != -1) // window id is valid
      _ecore_drm_device_info_send(input->dev->window, edev, EINA_FALSE);
 
    /* remove this evdev from the seat's list of devices */