display: ignore touch event occurred during turnig off the display 42/91442/1 accepted/tizen/common/20161007.173324 accepted/tizen/ivi/20161010.082707 accepted/tizen/mobile/20161010.082614 accepted/tizen/tv/20161010.082633 accepted/tizen/wearable/20161010.082647 submit/tizen/20161007.120252
authortaeyoung <ty317.kim@samsung.com>
Fri, 7 Oct 2016 11:22:51 +0000 (20:22 +0900)
committertaeyoung <ty317.kim@samsung.com>
Fri, 7 Oct 2016 11:22:51 +0000 (20:22 +0900)
- Previously, touchscreen was disabled after turning off the display.
  Thus the touch events occurred at the moment between turning off
  the display and disabling the touchscreen tried to turn on the
  display again. The events were queued for the main loop, and thus
  they could not be avoided.

- Now, a flag touch_event_blocked is set before turning off the display.
  Thus the touch events can be ignored according to the value of the flag.

Change-Id: Ic49fba662376e4e122a5785854f1adc82ffe4ec0
Signed-off-by: taeyoung <ty317.kim@samsung.com>
src/display/core.c
src/display/core.h
src/display/input.c

index 17298fb..e04ea8b 100644 (file)
@@ -100,6 +100,8 @@ static int stay_touchscreen_off = false;
 static dd_list *lcdon_ops;
 static bool lcdon_broadcast = false;
 
+static bool touch_blocked = false;
+
 /* default transition, action fuctions */
 static int default_trans(int evt);
 static int default_action(int timeout);
@@ -351,6 +353,11 @@ static unsigned long get_lcd_on_flags(void)
        return flags;
 }
 
+bool touch_event_blocked(void)
+{
+       return touch_blocked;
+}
+
 void lcd_on_procedure(int state, enum device_flags flag)
 {
        dd_list *l = NULL;
@@ -379,6 +386,8 @@ void lcd_on_procedure(int state, enum device_flags flag)
 
        if (CHECK_OPS(keyfilter_ops, backlight_enable))
                keyfilter_ops->backlight_enable(true);
+
+       touch_blocked = false;
 }
 
 inline void lcd_off_procedure(enum device_flags flag)
@@ -388,6 +397,8 @@ inline void lcd_off_procedure(enum device_flags flag)
        unsigned long flags = NORMAL_MODE;
        flags |= flag;
 
+       touch_blocked = true;
+
        if (lcdon_broadcast) {
                broadcast_lcd_off(SIGNAL_PRE, flags);
                lcdon_broadcast = false;
index b76739f..45e96d6 100644 (file)
@@ -193,6 +193,7 @@ void set_lcd_paneloff_mode(int val);
 void lcd_on_direct(enum device_flags flags);
 void lcd_off_procedure(enum device_flags flag);
 int check_holdkey_block(enum state_t state);
+bool touch_event_blocked(void);
 
 /* poll.c */
 int check_dimstay(int next_state, int flag);
index 023294e..a65e5f4 100644 (file)
@@ -102,6 +102,8 @@ static inline void process_event(struct libinput_event *ev)
        case LIBINPUT_EVENT_TOUCH_UP:
        case LIBINPUT_EVENT_TOUCH_MOTION:
        case LIBINPUT_EVENT_TOUCH_FRAME:
+               if (touch_event_blocked())
+                       return ;
                break;
        default:
                break;