I have made the following changes intended for : CE:MW:Shared / mce Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below.
https://build.pub.meego.com//request/show/7250 Thank You, philippedeswert [This message was auto-generated] --- Request # 7250: Messages from BOSS: State: review at 2012-11-01T21:39:40 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:philippedeswert:branches:CE:MW:Shared / mce -> CE:MW:Shared / mce changes files: -------------- --- mce.changes +++ mce.changes @@ -0,0 +1,3 @@ +* Thu Nov 1 2012 Philippe De Swert <[email protected]> - 1.12.3 +- Fixes NEMO#483: mce wakes up a lot when interacting with touchscreen + old: ---- mce-1.12.2.tar.bz2 new: ---- mce-1.12.3.tar.bz2 spec files: ----------- --- mce.spec +++ mce.spec @@ -1,6 +1,6 @@ Name: mce Summary: Mode Control Entity for Nokia mobile computers -Version: 1.12.2 +Version: 1.12.3 Release: 1 Group: System/System Control License: LGPLv2 other changes: -------------- ++++++ mce-1.12.2.tar.bz2 -> mce-1.12.3.tar.bz2 --- Makefile +++ Makefile @@ -3,7 +3,7 @@ # Written by David Weinehall # Modified by Tuomo Tanskanen -VERSION := 1.12.2 +VERSION := 1.12.3 INSTALL := install --mode=755 INSTALL_DIR := install -d --- debian/changelog +++ debian/changelog @@ -1,3 +1,9 @@ +mce (1.12.3) unstable; urgency=low + + * Fixes NEMO#483: mce wakes up a lot when interacting with touchscreen + + -- Simo Piiroinen <[email protected]> Thu, 01 Nov 2012 13:17:58 +0200 + mce (1.12.2) unstable; urgency=low * Support for locking the touch screen without blanking the display --- event-input.c +++ event-input.c @@ -116,8 +116,6 @@ static void update_inputdevices(const gchar *device, gboolean add); -static time_t prev_handled_touchscreen_activity_seconds = 0; - /** * Enable the specified GPIO key * non-existing or already enabled keys are silently ignored @@ -255,6 +253,27 @@ } /** + * Timeout function for touchscreen I/O monitor reprogramming + * + * @param data Unused + * @return Always returns FALSE, to disable the timeout + */ +static gboolean touchscreen_io_monitor_timeout_cb(gpointer data) +{ + (void)data; + + touchscreen_io_monitor_timeout_cb_id = 0; + + /* Resume I/O monitors */ + if (touchscreen_dev_list != NULL) { + g_slist_foreach(touchscreen_dev_list, + (GFunc)resume_io_monitor, NULL); + } + + return FALSE; +} + +/** * Cancel timeout for touchscreen I/O monitor reprogramming */ static void cancel_touchscreen_io_monitor_timeout(void) @@ -266,6 +285,19 @@ } /** + * Setup timeout for touchscreen I/O monitor reprogramming + */ +static void setup_touchscreen_io_monitor_timeout(void) +{ + cancel_touchscreen_io_monitor_timeout(); + + /* Setup new timeout */ + touchscreen_io_monitor_timeout_cb_id = + g_timeout_add_seconds(MONITORING_DELAY, + touchscreen_io_monitor_timeout_cb, NULL); +} + +/** * I/O monitor callback for the touchscreen * * @param data The new data @@ -275,10 +307,10 @@ */ static gboolean touchscreen_iomon_cb(gpointer data, gsize bytes_read) { + display_state_t display_state = datapipe_get_gint(display_state_pipe); submode_t submode = mce_get_submode_int32(); struct input_event *ev; gboolean flush = FALSE; - time_t time_now; ev = data; @@ -294,22 +326,28 @@ goto EXIT; } - /* ignore all other tousch screen events except the first one happened at same second */ - if ((ev->time.tv_sec - prev_handled_touchscreen_activity_seconds) == 0) { - goto EXIT; - } - prev_handled_touchscreen_activity_seconds = ev->time.tv_sec; - - time(&time_now); - if ((time_now - ev->time.tv_sec) > 2) { - // ignore events that are more than 2 seconds old - goto EXIT; - } - /* Generate activity */ (void)execute_datapipe(&device_inactive_pipe, GINT_TO_POINTER(FALSE), USE_INDATA, CACHE_INDATA); + /* If the display is on/dim and visual tklock is active + * or autorelock isn't active, suspend I/O monitors + */ + if (((display_state == MCE_DISPLAY_ON) || + (display_state == MCE_DISPLAY_DIM)) && + (((submode & MCE_VISUAL_TKLOCK_SUBMODE) != 0) || + ((submode & MCE_AUTORELOCK_SUBMODE) == 0))) { + if (touchscreen_dev_list != NULL) { + g_slist_foreach(touchscreen_dev_list, + (GFunc)suspend_io_monitor, NULL); + } + + /* Setup a timeout I/O monitor reprogramming */ + setup_touchscreen_io_monitor_timeout(); + + flush = TRUE; + } + /* Only send pressure and gesture events */ if (((ev->type != EV_ABS) || (ev->code != ABS_PRESSURE)) && ((ev->type != EV_KEY) || (ev->code != BTN_TOUCH)) &&
