Gdk.Surface
Description: Reference for Gdk.Surface

### Class

# GdkSurface

since: 4.0

#### Description [src]

    abstract class Gdk.Surface : GObject.Object
    {
      /* No available fields */
    }

A `GdkSurface` is a rectangular region on the screen.

It’s a low-level object, used to implement high-level objects such as GtkWindow.

The surfaces you see in practice are either `GdkToplevel` or `GdkPopup`, and those interfaces provide much of the required API to interact with these surfaces. Other, more specialized surface types exist, but you will rarely interact with them directly.

Available since: 4.0

#### Ancestors

- GObject

#### Constructors

###### gdk_surface_new_popup

Create a new popup surface.

since: 4.0

###### gdk_surface_new_toplevel

Creates a new toplevel surface.

since: 4.0

#### Instance methods

###### gdk_surface_beep

Emits a short beep associated to `surface`.

since: 4.0

###### gdk_surface_create_cairo_context

Creates a new `GdkCairoContext` for rendering on `surface`.

since: 4.0

###### gdk_surface_create_gl_context

Creates a new `GdkGLContext` for the `GdkSurface`.

since: 4.0

###### gdk_surface_create_similar_surface

Create a new Cairo surface that is as compatible as possible with the given `surface`.

deprecated: 4.12 since: 4.0

###### gdk_surface_create_vulkan_context

Creates a new `GdkVulkanContext` for rendering on `surface`.

since: 4.0

###### gdk_surface_destroy

Destroys the window system resources associated with `surface` and decrements `surface`‘s reference count.

since: 4.0

###### gdk_surface_get_cursor

Retrieves a `GdkCursor` pointer for the cursor currently set on the `GdkSurface`.

since: 4.0

###### gdk_surface_get_device_cursor

Retrieves a `GdkCursor` pointer for the `device` currently set on the specified `GdkSurface`.

since: 4.0

###### gdk_surface_get_device_position

Obtains the current device position and modifier state.

since: 4.0

###### gdk_surface_get_display

Gets the `GdkDisplay` associated with a `GdkSurface`.

since: 4.0

###### gdk_surface_get_frame_clock

Gets the frame clock for the surface.

since: 4.0

###### gdk_surface_get_height

Returns the height of the given `surface`.

since: 4.0

###### gdk_surface_get_mapped

Checks whether the surface has been mapped.

since: 4.0

###### gdk_surface_get_scale

Returns the internal scale that maps from surface coordinates to the actual device pixels.

since: 4.12

###### gdk_surface_get_scale_factor

Returns the internal scale factor that maps from surface coordinates to the actual device pixels.

since: 4.0

###### gdk_surface_get_width

Returns the width of the given `surface`.

since: 4.0

###### gdk_surface_hide

Hide the surface.

since: 4.0

###### gdk_surface_is_destroyed

Check to see if a surface is destroyed.

since: 4.0

###### gdk_surface_queue_render

Forces a `GdkSurface::render` signal emission for `surface` to be scheduled.

since: 4.0

###### gdk_surface_request_layout

Request a layout phase from the surface’s frame clock.

since: 4.0

###### gdk_surface_set_cursor

Sets the default mouse pointer for a `GdkSurface`.

since: 4.0

###### gdk_surface_set_device_cursor

Sets a specific `GdkCursor` for a given device when it gets inside `surface`.

since: 4.0

###### gdk_surface_set_input_region

Apply the region to the surface for the purpose of event handling.

since: 4.0

###### gdk_surface_set_opaque_region

Marks a region of the `GdkSurface` as opaque.

since: 4.0

###### gdk_surface_translate_coordinates

Translates coordinates between two surfaces.

since: 4.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gdk.Surface:cursor

The mouse pointer for the `GdkSurface`.

since: 4.0

###### Gdk.Surface:display

The `GdkDisplay` connection of the surface.

since: 4.0

###### Gdk.Surface:frame-clock

The `GdkFrameClock` of the surface.

since: 4.0

###### Gdk.Surface:height

The height of the surface, in pixels.

since: 4.0

###### Gdk.Surface:mapped

Whether the surface is mapped.

since: 4.0

###### Gdk.Surface:scale

The scale of the surface.

since: 4.12

###### Gdk.Surface:scale-factor

The scale factor of the surface.

since: 4.0

###### Gdk.Surface:width

The width of the surface in pixels.

since: 4.0

#### Signals

###### Gdk.Surface::enter-monitor

Emitted when `surface` starts being present on the monitor.

since: 4.0

###### Gdk.Surface::event

Emitted when GDK receives an input event for `surface`.

since: 4.0

###### Gdk.Surface::layout

Emitted when the size of `surface` is changed, or when relayout should be performed.

since: 4.0

###### Gdk.Surface::leave-monitor

Emitted when `surface` stops being present on the monitor.

since: 4.0

###### Gdk.Surface::render

Emitted when part of the surface needs to be redrawn.

since: 4.0

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

since: 2.0

#### Class structure

    struct GdkSurfaceClass {
      /* no available fields */
    }

No description available.