Skip to content
Snippets Groups Projects
Commit 1a05f46a authored by Ali Abdallah's avatar Ali Abdallah
Browse files

Fix brightness notification feedback level.

parent e58f1477
No related branches found
No related tags found
No related merge requests found
...@@ -124,7 +124,6 @@ xfpm_backlight_show_notification (XfpmBacklight *backlight, gint level, gint max ...@@ -124,7 +124,6 @@ xfpm_backlight_show_notification (XfpmBacklight *backlight, gint level, gint max
{ {
gint i; gint i;
gfloat value = 0; gfloat value = 0;
NotifyNotification *n;
static const char *display_icon_name[] = static const char *display_icon_name[] =
{ {
...@@ -136,36 +135,38 @@ xfpm_backlight_show_notification (XfpmBacklight *backlight, gint level, gint max ...@@ -136,36 +135,38 @@ xfpm_backlight_show_notification (XfpmBacklight *backlight, gint level, gint max
NULL NULL
}; };
if ( !backlight->priv->n ) if ( backlight->priv->n == NULL )
{ {
n = xfpm_notify_new_notification (backlight->priv->notify, backlight->priv->n = xfpm_notify_new_notification (backlight->priv->notify,
NULL, " ",
NULL, "",
NULL, NULL,
0, 0,
XFPM_NOTIFY_NORMAL, XFPM_NOTIFY_NORMAL,
NULL); NULL);
} }
value = (gfloat) 100 * level / max_level; value = (gfloat) 100 * level / max_level;
i = (gint)value / 25; i = (gint)value / 25;
notify_notification_set_hint_int32 (n, if ( i > 4 || i < 0 )
return;
notify_notification_set_hint_int32 (backlight->priv->n,
"value", "value",
value); value);
notify_notification_set_hint_string (n, notify_notification_set_hint_string (backlight->priv->n,
"x-canonical-private-synchronous", "x-canonical-private-synchronous",
"brightness"); "brightness");
notify_notification_update (n, notify_notification_update (backlight->priv->n,
" ", " ",
"", "",
display_icon_name[i]); display_icon_name[i]);
notify_notification_show (n, NULL); notify_notification_show (backlight->priv->n, NULL);
backlight->priv->n = n;
} }
static gboolean static gboolean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment