Skip to content

Commit

Permalink
Fix lock ui handling and display blanking for nemo
Browse files Browse the repository at this point in the history
The Nemo mobile UI doesn't correctly (re-)draw when the display is
unblanked. That leaves the user with a black screen until the screen is
touched in an area that causes a re-draw.

This patch fixes that with:
1. Enables autolock so that lock UI is enabled whenever display blanks
2. Changes call sequence so that systemui (lock ui) is notified only
   after display is unblanked so that it (re-)draws correctly.

Signed-off-by: Markus Lehtonen <markus.lehtonen@iki.fi>
  • Loading branch information
Markus Lehtonen authored and Kalle Jokiniemi committed Oct 2, 2012
1 parent bbd2239 commit 8e293fb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion mce.ini
Expand Up @@ -147,7 +147,7 @@ DisableKPImmediately=2
#
# 1 - allow autolock when the keyboard slide is open
# 0 - inhibit autolock when the keyboard slide is open
AutolockWhenSlideOpen=0
AutolockWhenSlideOpen=1

# Inhibit proximity sensor based locking during calls
# when keyboard slide is open
Expand Down
2 changes: 2 additions & 0 deletions modules/display.c
Expand Up @@ -113,6 +113,7 @@
* append_output_trigger_to_datapipe(),
* remove_output_trigger_from_datapipe()
*/
#include "tklock.h"

/* These defines are taken from devicelock.h, but slightly modified */
#ifndef DEVICELOCK_H
Expand Down Expand Up @@ -2636,6 +2637,7 @@ static void display_state_trigger(gconstpointer data)
case MCE_DISPLAY_ON:
default:
display_unblank();
mce_tklock_show_tklock_ui();
break;
}

Expand Down
26 changes: 15 additions & 11 deletions tklock.c
Expand Up @@ -2590,15 +2590,6 @@ static void display_state_trigger(gconstpointer data)
(old_display_state == MCE_DISPLAY_LPM_OFF) ||
(old_display_state == MCE_DISPLAY_LPM_ON)) {
ts_kp_enable_policy();

/* If visual tklock is enabled, reset the timeout,
* and open the visual tklock
*/
if (is_visual_tklock_enabled() == TRUE) {
open_tklock_ui(TKLOCK_ENABLE_VISUAL);
saved_tklock_state = MCE_TKLOCK_VISUAL_STATE;
setup_tklock_visual_blank_timeout();
}
}

cancel_pocket_mode_timeout();
Expand All @@ -2614,6 +2605,18 @@ static void display_state_trigger(gconstpointer data)
return;
}

void mce_tklock_show_tklock_ui(void)
{
/* If visual tklock is enabled, reset the timeout,
* and open the visual tklock
*/
if (is_visual_tklock_enabled() == TRUE) {
open_tklock_ui(TKLOCK_ENABLE_VISUAL);
saved_tklock_state = MCE_TKLOCK_VISUAL_STATE;
setup_tklock_visual_blank_timeout();
}
}

/**
* Handle alarm UI state change
*
Expand Down Expand Up @@ -3183,8 +3186,9 @@ gboolean mce_tklock_init(void)

/* Touchscreen/keypad autolock */
/* Since we've set a default, error handling is unnecessary */
(void)mce_gconf_get_bool(MCE_GCONF_TK_AUTOLOCK_ENABLED_PATH,
&tk_autolock_enabled);
/*(void)mce_gconf_get_bool(MCE_GCONF_TK_AUTOLOCK_ENABLED_PATH,
&tk_autolock_enabled);*/
tk_autolock_enabled = TRUE;

/* Touchscreen/keypad autolock enabled/disabled */
if (mce_gconf_notifier_add(MCE_GCONF_LOCK_PATH,
Expand Down
2 changes: 2 additions & 0 deletions tklock.h
Expand Up @@ -181,4 +181,6 @@
gboolean mce_tklock_init(void);
void mce_tklock_exit(void);

void mce_tklock_show_tklock_ui(void);

#endif /* _TKLOCK_H_ */

0 comments on commit 8e293fb

Please sign in to comment.