*** src/themes/ubuntu/theme.c 2007-09-03 18:20:35.000000000 +0100 --- /home/alex/Desktop/theme.c 2007-09-01 22:49:36.000000000 +0100 *************** typedef struct *** 24,29 **** --- 24,32 ---- /* do we have a arrow and where do we point to */ gboolean has_arrow; + + gboolean enable_transparency; + int point_x; int point_y; *************** draw_border(GtkWidget *win, GdkEventExpo *** 232,239 **** bg_color.green/65535.0, bg_color.blue/65535.0); ! draw_rounded_window(cr, 0, 0, w, h, windata); ! cairo_fill(cr); // draw a stripe draw_stripe(win, cr, windata); --- 235,241 ---- bg_color.green/65535.0, bg_color.blue/65535.0); ! cairo_paint (cr); // draw a stripe draw_stripe(win, cr, windata); *************** draw_border(GtkWidget *win, GdkEventExpo *** 243,263 **** 218.0/255.0, 178.0/255.0, 85.0/255.0); ! draw_rounded_window(cr, 0.5, 1.5, w-1, h-3, windata); ! cairo_set_line_width (cr, 1); ! cairo_stroke(cr); ! // clear the mask cairo_set_operator (mask_cr, CAIRO_OPERATOR_CLEAR); cairo_paint (mask_cr); ! // draw a "black" rounded thing ! cairo_set_source_rgba(mask_cr, 1,1,1,1); cairo_set_operator (mask_cr, CAIRO_OPERATOR_OVER); ! ! draw_rounded_window(mask_cr, 0,1,w,h-2, windata); cairo_fill(mask_cr); ! gdk_window_shape_combine_mask (win->window, (GdkBitmap *) mask, 0, 0); return FALSE; } --- 245,278 ---- 218.0/255.0, 178.0/255.0, 85.0/255.0); ! draw_rounded_window (cr, 0, 0, w, h, windata); ! // Stroke the border 2 pixels wide so we get a 1 pixel stroke inside our ! // path (we'll mask the outside half of it later). ! cairo_set_line_width (cr, 2); ! cairo_stroke (cr); ! // Clear the shape mask cairo_set_operator (mask_cr, CAIRO_OPERATOR_CLEAR); cairo_paint (mask_cr); ! // Draw the window shape to the input mask ! cairo_set_source_rgba(mask_cr, 1, 1, 1, 1); cairo_set_operator (mask_cr, CAIRO_OPERATOR_OVER); ! draw_rounded_window(mask_cr, 0, 0, w, h, windata); cairo_fill(mask_cr); ! ! if (windata->enable_transparency) { ! // If transparency is enabled, we can mask the drawing itself and just ! // use the shape mask as an input mask. ! cairo_set_operator (cr, CAIRO_OPERATOR_DEST_IN); ! cairo_set_source_rgb (cr, 0, 0, 0); ! draw_rounded_window (cr, 0, 0, w, h, windata); ! cairo_fill (cr); ! gdk_window_input_shape_combine_mask (win->window, (GdkBitmap *) mask, 0, 0); ! } else { ! // Otherwise, use the shape mask for bilevel visual shaping as well. ! gdk_window_shape_combine_mask (win->window, (GdkBitmap *) mask, 0, 0); ! } return FALSE; } *************** create_notification(UrlClickedCb url_cli *** 305,310 **** --- 320,327 ---- GtkWidget *image; GtkWidget *alignment; WindowData *windata; + GdkColormap *colormap; + GdkScreen *screen; windata = g_new0(WindowData, 1); windata->urgency = URGENCY_NORMAL; *************** create_notification(UrlClickedCb url_cli *** 312,317 **** --- 329,346 ---- win = gtk_window_new(GTK_WINDOW_POPUP); windata->win = win; + + windata->enable_transparency = FALSE; + screen = gtk_window_get_screen(GTK_WINDOW(win)); + colormap = gdk_screen_get_rgba_colormap(screen); + + if (colormap != NULL && gdk_screen_is_composited(screen)) + { + gtk_widget_set_colormap(win, colormap); + windata->enable_transparency = TRUE; + } + + gtk_widget_add_events(win, GDK_BUTTON_RELEASE_MASK); gtk_widget_realize(win); g_object_set_data_full(G_OBJECT(win), "windata", windata,