### Class

# GdkSurface

#### 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.

#### Hierarchy

#### Ancestors

- GObject

#### Constructors

###### gdk_surface_new_popup

Create a new popup surface.

###### gdk_surface_new_toplevel

Creates a new toplevel surface.

#### Instance methods

###### gdk_surface_beep

Emits a short beep associated to `surface`.

###### gdk_surface_create_cairo_context

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

###### gdk_surface_create_gl_context

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

###### gdk_surface_create_similar_surface

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

deprecated: 4.12

###### gdk_surface_create_vulkan_context

Sets an error and returns `NULL`.

deprecated: 4.14

###### gdk_surface_destroy

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

###### gdk_surface_get_cursor

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

###### gdk_surface_get_device_cursor

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

###### gdk_surface_get_device_position

Obtains the current device position and modifier state.

###### gdk_surface_get_display

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

###### gdk_surface_get_frame_clock

Gets the frame clock for the surface.

###### gdk_surface_get_height

Returns the height of the given `surface`.

###### gdk_surface_get_mapped

Checks whether the surface has been mapped.

###### 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.

###### gdk_surface_get_width

Returns the width of the given `surface`.

###### gdk_surface_hide

Hide the surface.

###### gdk_surface_is_destroyed

Check to see if a surface is destroyed.

###### gdk_surface_queue_render

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

###### gdk_surface_request_layout

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

###### gdk_surface_set_cursor

Sets the default mouse pointer for a `GdkSurface`.

###### gdk_surface_set_device_cursor

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

###### gdk_surface_set_input_region

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

###### gdk_surface_set_opaque_region

Marks a region of the `GdkSurface` as opaque.

###### gdk_surface_translate_coordinates

Translates coordinates between two surfaces.

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

Please see GObject for a full list of methods.

#### Properties

###### Gdk.Surface:cursor

The mouse pointer for the `GdkSurface`.

###### Gdk.Surface:display

The `GdkDisplay` connection of the surface.

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

The `GdkFrameClock` of the surface.

###### Gdk.Surface:height

The height of the surface, in pixels.

###### Gdk.Surface:mapped

Whether the surface is mapped.

###### Gdk.Surface:scale

The scale of the surface.

since: 4.12

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

The scale factor of the surface.

###### Gdk.Surface:width

The width of the surface in pixels.

#### Signals

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

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

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

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

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

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

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

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

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

Emitted when part of the surface needs to be redrawn.

##### 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.

#### Class structure

    struct GdkSurfaceClass {
      /* no available fields */
    }

No description available.