summaryrefslogtreecommitdiff
path: root/alarm_widget/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'alarm_widget/src/main.c')
-rwxr-xr-xalarm_widget/src/main.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/alarm_widget/src/main.c b/alarm_widget/src/main.c
index 8fac8d1..0dfb061 100755
--- a/alarm_widget/src/main.c
+++ b/alarm_widget/src/main.c
@@ -27,7 +27,7 @@
#include "widget_log.h"
#define POPUP_DURATION 4.0
-#define IGNORE_MOUSE_MOVE_COUNT 7
+#define IGNORE_MOUSE_MOVE_COUNT 5
#if !defined(APP_CONTROL_DATA_ALARM_WIDGET_ALARM_DB_ID)
#define APP_CONTROL_DATA_ALARM_WIDGET_ALARM_DB_ID "http://tizen.org/appcontrol/data/alarm_widget/db_id"
@@ -43,8 +43,6 @@
#define ALARM_BUNDLE_DB_ID "alarm.bundle.db.id"
-int new_alarm_move = 0;
-
#if !defined(ALARM_APP_ID)
#define ALARM_APP_ID "org.tizen.alarm.app"
@@ -96,23 +94,25 @@ static void _reply_from_alarm(app_control_h request, app_control_h reply, app_co
static void __alm_widget_new_alarm_mouse_up_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up *)event_info;
+ widget_instance_data_s *wid = (widget_instance_data_s *)data;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) {
_D("EVAS_EVENT_FLAG_ON_HOLD - Need to ignore this event");
+ wid->mouse_count = 0;
return;
}
- _D("__alm_widget_new_alarm_mouse_up_cb new_alarm_move:%d", new_alarm_move);
- widget_instance_data_s *wid = (widget_instance_data_s *)data;
+ _D("__alm_widget_new_alarm_mouse_up_cb wid->mouse_count:%d", wid->mouse_count);
ret_if(!wid);
- if (new_alarm_move > IGNORE_MOUSE_MOVE_COUNT) {
- _D("__alm_widget_new_alarm_mouse_up_cb ignore since its a mouse move");
- new_alarm_move = 0;
+ if (wid->mouse_count > IGNORE_MOUSE_MOVE_COUNT) {
+ wid->mouse_count = 0;
return;
}
- new_alarm_move = 0;
+ wid->mouse_count = 0;
- if(wid->db_id == 0) {
+ int ret = 1;
+ ret = read_alarm_details(wid->db_id, &wid->alm_details);
+ if(wid->db_id == 0 || ret) {
elm_object_signal_emit(wid->layout, "clipper.no_alarm.default", "*");
app_control_h app_control;
@@ -147,18 +147,16 @@ static void __alm_widget_new_alarm_mouse_move_cb(void *data, Evas * e, Evas_Obje
widget_instance_data_s *wid = (widget_instance_data_s *)data;
ret_if(!wid);
elm_object_signal_emit(wid->layout, "clipper.no_alarm.default", "*");
-
- new_alarm_move++;
+ wid->mouse_count++;
}
static void __alm_widget_new_alarm_mouse_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
{
_ALM_WIDGET_ENTER_;
widget_instance_data_s *wid = (widget_instance_data_s *)data;
+ wid->mouse_count = 0;
ret_if(!wid);
- new_alarm_move = 0;
-
elm_object_signal_emit(wid->layout, "clipper.no_alarm.pressed", "*");
}