Added vertical scrolling using hw keys (Fixes NB#133627)
[modest] / src / hildon2 / modest-platform.c
index ea4b9e8..f8554c1 100644 (file)
 #define MODEST_ALARMD_APPID PACKAGE_NAME
 
 static ca_context *ca_con = NULL;
+static gboolean ca_con_opened = FALSE;
 
 
 static void modest_platform_play_email_tone (void);
@@ -1605,10 +1606,12 @@ modest_platform_on_new_headers_received (GList *URI_list,
        app_in_foreground = hildon_program_get_is_topmost (hildon_program_get_instance ());
        screen_on = modest_window_mgr_screen_is_on (modest_runtime_get_window_mgr ());
 
-       /* If the screen is on and the app is in the
-          foreground we don't show anything */
-       if (screen_on && app_in_foreground)
+       /* If the screen is on and the app is in the foreground we
+          don't show anything, just play a chime */
+       if (screen_on && app_in_foreground) {
+               modest_platform_play_email_tone ();
                return;
+       }
 
        if (g_list_length (URI_list) == 0)
                return;
@@ -2661,9 +2664,13 @@ modest_platform_play_email_tone (void)
                        }
                }
 
-               if ((ret = ca_context_open(ca_con)) != CA_SUCCESS) {
-                       g_warning("ca_context_open: %s\n", ca_strerror(ret));
-                       return;
+               if (!ca_con_opened) {
+                       if ((ret = ca_context_open(ca_con)) != CA_SUCCESS) {
+                               g_warning("ca_context_open: %s\n", ca_strerror(ret));
+                               return;
+                       } else {
+                               ca_con_opened = TRUE;
+                       }
                }
 
                ca_proplist_create(&pl);