< prev index next >

src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c

Print this page
rev 16167 : 8170525: Fix minor issues in AWT/ECC/PKCS11 coding
Reviewed-by: vinnie, clanger, prr, ssadetsky

@@ -2012,13 +2012,11 @@
 
 /*************************************************/
 static guint8 recode_color(gdouble channel)
 {
     guint16 result = (guint16)(channel * 65535);
-    if (result < 0) {
-        result = 0;
-    } else if (result > 65535) {
+    if (result > 65535) {
         result = 65535;
     }
     return (guint8)( result >> 8);
 }
 

@@ -2216,10 +2214,11 @@
 }
 
 static GdkRGBA gtk3_get_color_for_flags(GtkStyleContext* context,
                                   GtkStateFlags flags, ColorType color_type) {
     GdkRGBA c, color;
+    color.alpha = 1;
 
     switch (color_type)
     {
         case FOREGROUND:
         case TEXT_FOREGROUND:

@@ -2264,11 +2263,10 @@
 static gint gtk3_get_color_for_state(JNIEnv *env, WidgetType widget_type,
                               GtkStateType state_type, ColorType color_type)
 {
 
     gint result = 0;
-    GdkRGBA color;
 
     GtkStateFlags flags = gtk3_get_state_flags(state_type);
 
     init_containers();
 

@@ -2283,11 +2281,11 @@
      || widget_type == RADIO_BUTTON_MENU_ITEM) {
         flags &= GTK_STATE_FLAG_NORMAL | GTK_STATE_FLAG_SELECTED
                   | GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_FOCUSED;
     }
 
-    color = gtk3_get_color_for_flags(context, flags, color_type);
+    GdkRGBA color = gtk3_get_color_for_flags(context, flags, color_type);
 
     if (recode_color(color.alpha) == 0) {
         color = gtk3_get_color_for_flags(
         fp_gtk_widget_get_style_context(gtk3_get_widget(INTERNAL_FRAME)),
         0, BACKGROUND);
< prev index next >