In this case, gnome-terminal sets an RGBA visual on its window,
and we need to be careful when creating the icon pixmap, to create
the pixmap with the same depth as the visual, or we risk a BadMatch
from XRenderCreatePicture deep inside cairo.
CSS3 defines a somewhat odd syntax for rgba() colors - the rgb values
are integers from 0 to 255 or percentages and the a value is a
float from 0 to 1. To avoid increasing the total amount of confusion
in the world, make gdk_rgb_to_string() and gdk_rgb_parse() follow
this syntax rather than using floats for r, g, and b.
https://bugzilla.gnome.org/show_bug.cgi?id=633762
The core pointer is sort of meaningless in a multidevice environment,
the client pointer is used instead to fake a GdkDevice on events that
don't have one.
This new function takes a GdkRGBA in order to set the background to
an alpha color. Keep in mind that RGBA visuals and a composited environment
are still necessary to have an alpha background displayed.
GdkRGBA is a boxed struct similar to GdkColor, with the difference
that it stores alpha information as well, and colors are stored in
[0..1] doubles, in the cairo spirit.
gdk_cairo_set_source_rgba() has been also added to allow easier handling
of this new type.
Allow -1 for the hotspot coordinates in gdk_cursor_new_from_pixbuf,
if the pixbuf contains the x_hot/y_hot options with appropriate values.
Bug #632140.
Add signal GdkWindow::create-surface which allows to use any
surface type as storage for offscreen windows.
Test the new signal in tests/gdkoffscreenbox.c
1,968 (1,236 direct, 732 indirect) bytes in 1 blocks are definitely lost in loss record 11,816 of 11,947
at 0x4025BDC: malloc (vg_replace_malloc.c:195)
by 0x6950676: _context_get (cairo.c:250)
by 0x6950940: cairo_create (cairo.c:370)
by 0x685CD1E: _gdk_cairo_surface_extents (gdkcairo.c:381)
by 0x685CEDA: gdk_cairo_region_create_from_surface (gdkcairo.c:433)
Signed-off-by: Benjamin Otte <otte@redhat.com>
We subclass GdkWindowImplQuartz into a new GdkRootWindowImplQuartz,
and override the get_context method in order to do this cleanly.
Also made release_context a virtual method, since the root window has
to release its CGContextRef differently compared to normal windows.
The ownership of the return value for gdk_pixbuf_get_from_window() and
gdk_pixbuf_get_from_surface() was determined by the first argument.
Because that is an ugly design and the functions are new to GTK3, we
decided to adapt them.
And that adaptation was quite easy since almost no one passses anything
but NULL as the first argument.