diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-03-05 20:37:51 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-03-05 20:37:51 -0500 |
commit | 41c5c4ee9aa17db870ca772d6a5e511d8fd242dc (patch) | |
tree | 7b3060c6ec84220cc06b968f5cecdfbcb69294bb | |
parent | 65bec2452e5bd1b823ee810e2e48f3607b682e7d (diff) |
desktop-shell: Simplify unlock dialog redraw function
-rw-r--r-- | clients/desktop-shell.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index a181e3bb..15dc7ac3 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -446,17 +446,15 @@ unlock_dialog_redraw_handler(struct widget *widget, void *data) surface = window_get_surface(dialog->window); cr = cairo_create(surface); + widget_get_allocation(dialog->widget, &allocation); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); - cairo_clip(cr); - cairo_push_group(cr); - cairo_translate(cr, allocation.x, allocation.y); - cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0, 0, 0, 0.6); - cairo_paint(cr); + cairo_fill(cr); + cairo_translate(cr, allocation.x, allocation.y); if (dialog->button_focused) f = 1.0; else @@ -470,16 +468,14 @@ unlock_dialog_redraw_handler(struct widget *widget, void *data) cairo_pattern_add_color_stop_rgb(pat, 0.85, 0.2 * f, f, 0.2 * f); cairo_pattern_add_color_stop_rgb(pat, 1.0, 0, 0.86 * f, 0); cairo_set_source(cr, pat); + cairo_pattern_destroy(pat); cairo_arc(cr, cx, cy, r, 0.0, 2.0 * M_PI); cairo_fill(cr); widget_set_allocation(dialog->button, - allocation.x + cx - r, - allocation.y + cy - r, 2 * r, 2 * r); - cairo_pattern_destroy(pat); + allocation.x + cx - r, + allocation.y + cy - r, 2 * r, 2 * r); - cairo_pop_group_to_source(cr); - cairo_paint(cr); cairo_destroy(cr); cairo_surface_destroy(surface); |