[PATCH weston 11/12] window: let menu and tooltip redraw use widget size
Pekka Paalanen
ppaalanen at gmail.com
Wed Feb 13 06:17:22 PST 2013
Menu and tooltip redraw functions were using the surface size directly.
For consistency, make them use the widget size instead, it is the same.
Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
---
clients/window.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/clients/window.c b/clients/window.c
index 2260b87..29bfdd2 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1537,15 +1537,14 @@ tooltip_redraw_handler(struct widget *widget, void *data)
const int32_t r = 3;
struct tooltip *tooltip = data;
int32_t width, height;
- struct surface *surface = widget->surface;
- cr = cairo_create(surface->cairo_surface);
+ cr = cairo_create(widget->surface->cairo_surface);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0);
cairo_paint(cr);
- width = surface->allocation.width;
- height = surface->allocation.height;
+ width = widget->allocation.width;
+ height = widget->allocation.height;
rounded_rect(cr, 0, 0, width, height, r);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
@@ -3757,15 +3756,14 @@ menu_redraw_handler(struct widget *widget, void *data)
const int32_t r = 3, margin = 3;
struct menu *menu = data;
int32_t width, height, i;
- struct surface *surface = widget->surface;
- cr = cairo_create(surface->cairo_surface);
+ cr = cairo_create(widget->surface->cairo_surface);
cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0);
cairo_paint(cr);
- width = surface->allocation.width;
- height = surface->allocation.height;
+ width = widget->allocation.width;
+ height = widget->allocation.height;
rounded_rect(cr, 0, 0, width, height, r);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
--
1.7.12.4
More information about the wayland-devel
mailing list