summaryrefslogtreecommitdiffstats
path: root/graphics/gpaint/patches/25_fix_color_selection.patch
blob: 7af4eb2ed11f0f2b4b5b8de745cb46bd9ea5fa13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Author: Goedson Teixeira Paixao <goedson@debian.org>
Description: Fix foreground/background color selection
 Fixes the foreground/background color selection by checking the GtkColorButton
 color when the user chooses the color.
Bug-Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/gpaint/+bug/344237
Forwarded: https://savannah.gnu.org/patch/index.php?7028

diff --git a/src/callbacks.h b/src/callbacks.h
index 985dddf..5485329 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -359,18 +359,10 @@ on_fontpicker_font_set                 (GtkFontButton *gnomefontpicker,
 
 void
 on_foreground_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
-                                        guint            arg1,
-                                        guint            arg2,
-                                        guint            arg3,
-                                        guint            arg4,
                                         gpointer         user_data);
 
 void
 on_background_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
-                                        guint            arg1,
-                                        guint            arg2,
-                                        guint            arg3,
-                                        guint            arg4,
                                         gpointer         user_data);
 
 void
diff --git a/src/color_palette.c b/src/color_palette.c
index 9502acc..8c259e7 100644
--- a/src/color_palette.c
+++ b/src/color_palette.c
@@ -338,7 +338,7 @@ change_color(gpaint_color_swatch *swatch, gpaint_color_mode mode)
     g_assert(swatch);
     canvas = canvas_lookup(swatch->widget);
     gdk_gc_get_values(swatch->gc, &gcvalues);
-    
+
     if (mode==FOREGROUND)
     {
         change_foreground_color(canvas, &(gcvalues.foreground));
@@ -362,15 +362,12 @@ change_color(gpaint_color_swatch *swatch, gpaint_color_mode mode)
  */
 void
 on_foreground_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
-                                        guint            arg1,
-                                        guint            arg2,
-                                        guint            arg3,
-                                        guint            arg4,
                                         gpointer         user_data)
 {
-    GdkColor color = {0, arg1, arg2, arg3};
+    GdkColor color;
     gpaint_canvas *canvas = canvas_lookup(GTK_WIDGET(gnomecolorpicker));
     
+    gtk_color_button_get_color(gnomecolorpicker, &color);
     gdk_color_alloc(gdk_colormap_get_system(), &color);
     change_foreground_color(canvas, &color);
 }
@@ -380,15 +377,12 @@ on_foreground_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
  */
 void
 on_background_color_picker_color_set   (GtkColorButton *gnomecolorpicker,
-                                        guint            arg1,
-                                        guint            arg2,
-                                        guint            arg3,
-                                        guint            arg4,
                                         gpointer         user_data)
 {
-    GdkColor color = {0, arg1, arg2, arg3};
+    GdkColor color;
     gpaint_canvas *canvas = canvas_lookup(GTK_WIDGET(gnomecolorpicker));
 
+    gtk_color_button_get_color(gnomecolorpicker, &color);
     gdk_color_alloc(gdk_colormap_get_system(), &color);
     change_background_color(canvas, &color);
 }