since: 3.0


create_surface (
  GdkWindow* self,
  gint width,
  gint height,
  gpointer user_data

Description [src]

The ::create-surface signal is emitted when an offscreen window needs its surface (re)created, which happens either when the window is first drawn to, or when the window is being resized. The first signal handler that returns a non-NULL surface will stop any further signal emission, and its surface will be used.

Note that it is not possible to access the window’s previous surface from within any callback of this signal. Calling gdk_offscreen_window_get_surface() will lead to a crash.

Default handler:

The default handler is called after the handlers added via g_signal_connect().

Available since: 3.0



Type: gint

The width of the offscreen surface to create.


Type: gint

The height of the offscreen surface to create.

Return value

Type: cairo_surface_t

The newly created #cairo_surface_t for the offscreen window.

The caller of the function takes ownership of the data, and is responsible for freeing it.