|
24 | 24 | #include <string.h>
|
25 | 25 | #include <stdlib.h>
|
26 | 26 | #include <stdint.h>
|
| 27 | +#include "cairo.h" |
27 | 28 | #include "main.h"
|
28 | 29 | #include "input.h"
|
29 | 30 | #include "callbacks.h"
|
@@ -157,7 +158,6 @@ void on_monitors_changed ( GdkScreen *screen,
|
157 | 158 | }
|
158 | 159 |
|
159 | 160 |
|
160 |
| - |
161 | 161 | void on_composited_changed ( GdkScreen *screen,
|
162 | 162 | gpointer user_data)
|
163 | 163 | {
|
@@ -192,7 +192,6 @@ void on_composited_changed ( GdkScreen *screen,
|
192 | 192 | }
|
193 | 193 |
|
194 | 194 |
|
195 |
| - |
196 | 195 | void on_clientapp_selection_get (GtkWidget *widget,
|
197 | 196 | GtkSelectionData *selection_data,
|
198 | 197 | guint info,
|
@@ -399,9 +398,8 @@ gboolean on_buttonrelease (GtkWidget *win,
|
399 | 398 |
|
400 | 399 | gfloat direction = 0;
|
401 | 400 | gint width = 0;
|
402 |
| - if(devdata->cur_context) |
| 401 | + if (devdata->cur_context) |
403 | 402 | width = devdata->cur_context->arrowsize * devdata->cur_context->width / 2;
|
404 |
| - |
405 | 403 |
|
406 | 404 | if ((ev->x != devdata->lastx) ||
|
407 | 405 | (ev->y != devdata->lasty))
|
@@ -466,7 +464,6 @@ void on_mainapp_selection_get (GtkWidget *widget,
|
466 | 464 | else
|
467 | 465 | uri = "NOK";
|
468 | 466 |
|
469 |
| - |
470 | 467 | gtk_selection_data_set (selection_data,
|
471 | 468 | gtk_selection_data_get_target(selection_data),
|
472 | 469 | 8, (guchar*)uri, strlen (uri));
|
@@ -549,7 +546,9 @@ void on_mainapp_selection_received (GtkWidget *widget,
|
549 | 546 | g_printerr ("Unable to parse color. "
|
550 | 547 | "Keeping default.\n");
|
551 | 548 | }
|
552 |
| - GromitPaintContext* line_ctx = paint_context_new(data, GROMIT_PEN, fg_color, thickness, 0, thickness, thickness); |
| 549 | + GromitPaintContext* line_ctx = |
| 550 | + paint_context_new(data, GROMIT_PEN, fg_color, |
| 551 | + thickness, 0, thickness, thickness); |
553 | 552 |
|
554 | 553 | GdkRectangle rect;
|
555 | 554 | rect.x = MIN (startX,endX) - thickness / 2;
|
@@ -624,6 +623,7 @@ void on_mainapp_selection_received (GtkWidget *widget,
|
624 | 623 | style.width, style.arrowsize,
|
625 | 624 | style.minwidth, style.maxwidth);
|
626 | 625 |
|
| 626 | + cairo_destroy(context->paint_ctx); |
627 | 627 | g_free(context->paint_color);
|
628 | 628 | *context = *new_context;
|
629 | 629 | g_free(new_context);
|
@@ -672,7 +672,6 @@ void on_device_added (GdkDeviceManager *device_manager,
|
672 | 672 | }
|
673 | 673 |
|
674 | 674 |
|
675 |
| - |
676 | 675 | gboolean on_toggle_paint(GtkWidget *widget,
|
677 | 676 | GdkEventButton *ev,
|
678 | 677 | gpointer user_data)
|
|
0 commit comments