* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
retval = GTK_WIDGET_CLASS (gtk_tray_icon_parent_class)->draw (widget, cr);
focus_child = gtk_container_get_focus_child (GTK_CONTAINER (widget));
- if (focus_child && gtk_widget_has_focus (focus_child))
+ if (focus_child && gtk_widget_has_visible_focus (focus_child))
{
GtkStyleContext *context;
- GtkStateFlags state;
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
context = gtk_widget_get_style_context (widget);
- state = gtk_widget_get_state_flags (widget);
-
- gtk_style_context_save (context);
- gtk_style_context_set_state (context, state);
gtk_render_focus (context, cr, border_width, border_width,
gtk_widget_get_allocated_width (widget) - 2 * border_width,
gtk_widget_get_allocated_height (widget) - 2 * border_width);
-
- gtk_style_context_restore (context);
}
return retval;
gulong nitems;
gulong bytes_after;
int error, result;
- GdkVisual *visual;
- gint red_prec;
- gint green_prec;
- gint blue_prec;
g_assert (icon->priv->manager_window != None);
&bytes_after, &(prop.prop_ch));
error = gdk_error_trap_pop ();
- visual = NULL;
-
if (!error && result == Success &&
type == XA_VISUALID && nitems == 1 && format == 32)
{
- VisualID visual_id = prop.prop[0];
+ VisualID visual_id;
+ GdkVisual *visual;
+ gint red_prec, green_prec, blue_prec;
+
+ visual_id = prop.prop[0];
visual = gdk_x11_screen_lookup_visual (screen, visual_id);
+ gdk_visual_get_red_pixel_details (visual, NULL, NULL, &red_prec);
+ gdk_visual_get_green_pixel_details (visual, NULL, NULL, &green_prec);
+ gdk_visual_get_blue_pixel_details (visual, NULL, NULL, &blue_prec);
+ icon->priv->manager_visual = visual;
+ icon->priv->manager_visual_rgba =
+ (red_prec + blue_prec + green_prec < gdk_visual_get_depth (visual));
+ }
+ else
+ {
+ icon->priv->manager_visual = NULL;
+ icon->priv->manager_visual_rgba = FALSE;
}
- gdk_visual_get_red_pixel_details (visual, NULL, NULL, &red_prec);
- gdk_visual_get_green_pixel_details (visual, NULL, NULL, &green_prec);
- gdk_visual_get_blue_pixel_details (visual, NULL, NULL, &blue_prec);
-
- icon->priv->manager_visual = visual;
- icon->priv->manager_visual_rgba = visual != NULL &&
- (red_prec + blue_prec + green_prec < gdk_visual_get_depth (visual));
-
- /* For the background-relative hack we use when we aren't using a real RGBA
- * visual, we can't be double-buffered */
+ /* For the background-relative hack we use when we aren't
+ * using a real RGBA visual, we can't be double-buffered
+ */
gtk_widget_set_double_buffered (GTK_WIDGET (icon), icon->priv->manager_visual_rgba);
if (type != None)
if (icon->priv->manager_visual_rgba)
{
/* Set a transparent background */
- GdkColor transparent = { 0, 0, 0, 0 }; /* Only pixel=0 matters */
- gdk_window_set_background (window, &transparent);
+ GdkRGBA transparent = { 0.0, 0.0, 0.0, 0.0 };
+ gdk_window_set_background_rgba (window, &transparent);
}
else
{