PhoshLayerSurface

PhoshLayerSurface — A GtkWindow rendered as a LayerSurface by the compositor

Functions

Properties

guint anchor Read / Write / Construct Only
guint configured-height Read
guint configured-width Read
gint exclusive-zone Read / Write
guint height Read / Write
gboolean kbd-interactivity Read / Write
guint layer Read / Write / Construct Only
gpointer layer-shell Read / Write / Construct Only
gint margin-bottom Read / Write
gint margin-left Read / Write
gint margin-right Read / Write
gint margin-top Read / Write
gchar * namespace Read / Write / Construct Only
guint width Read / Write
gpointer wl-output Read / Write / Construct Only

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBin
                    ╰── GtkWindow
                        ╰── PhoshLayerSurface
                            ├── PhoshBackground
                            ├── PhoshFader
                            ├── PhoshHome
                            ├── PhoshLockscreen
                            ├── PhoshLockshield
                            ├── PhoshNetworkAuthPrompt
                            ├── PhoshNotificationBanner
                            ├── PhoshPanel
                            ├── PhoshPolkitAuthPrompt
                            ╰── PhoshSystemPrompt

Implemented Interfaces

PhoshLayerSurface implements AtkImplementorIface and GtkBuildable.

Description

PhoshLayerSurface allows to use a Wayland surface backed by the layer-shell protocol as GtkWindow. This allows to render e.g. panels and backgrounds using GTK.

Functions

phosh_layer_surface_new ()

GtkWidget *
phosh_layer_surface_new (gpointer layer_shell,
                         gpointer wl_output);

phosh_layer_surface_get_layer_surface ()

struct     zwlr_layer_surface_v1 *
phosh_layer_surface_get_layer_surface (PhoshLayerSurface *self);

phosh_layer_surface_get_wl_surface ()

struct     wl_surface *
phosh_layer_surface_get_wl_surface (PhoshLayerSurface *self);

Get the layer wayland surface or NULL if the window is not yet realized.

Parameters

self

The PhoshLayerSurface

 

phosh_layer_surface_set_size ()

void
phosh_layer_surface_set_size (PhoshLayerSurface *self,
                              int width,
                              int height);

Set the size of a layer surface. A value of '-1' indicates 'use old value'

Parameters

self

The PhoshLayerSurface

 

width

the height in pixels

 

height

the width in pixels

 

phosh_layer_surface_set_margins ()

void
phosh_layer_surface_set_margins (PhoshLayerSurface *self,
                                 int top,
                                 int right,
                                 int bottom,
                                 int left);

Set anchor margins of a layer surface.

Parameters

self

The PhoshLayerSurface

 

top

the top margin in pixels

 

right

the right margin in pixels

 

bottom

the bottom margin in pixels

 

left

the left margin in pixels

 

phosh_layer_surface_set_exclusive_zone ()

void
phosh_layer_surface_set_exclusive_zone
                               (PhoshLayerSurface *self,
                                int zone);

Set exclusive zone of a layer surface.

Parameters

self

The PhoshLayerSurface

 

zone

Size of the exclusive zone.

 

phosh_layer_surface_set_kbd_interactivity ()

void
phosh_layer_surface_set_kbd_interactivity
                               (PhoshLayerSurface *self,
                                gboolean interactivity);

phosh_layer_surface_wl_surface_commit ()

void
phosh_layer_surface_wl_surface_commit (PhoshLayerSurface *self);

Forces a commit of layer surface's state.

Parameters

self

The PhoshLayerSurface

 

Types and Values

PHOSH_TYPE_LAYER_SURFACE

#define PHOSH_TYPE_LAYER_SURFACE                 (phosh_layer_surface_get_type ())

struct PhoshLayerSurfaceClass

struct PhoshLayerSurfaceClass {
  GtkWindowClass parent_class;

  /* Signals
   */
  void (*configured)   (PhoshLayerSurface    *self);
};

Members

configured ()

invoked when layer surface is configured

 

PhoshLayerSurface

typedef struct _PhoshLayerSurface PhoshLayerSurface;

Property Details

The “anchor” property

  “anchor”                   guint

The edges to anchor the surface to.

Flags: Read / Write / Construct Only

Default value: 0


The “configured-height” property

  “configured-height”        guint

The height of the layer surface set by the compositor.

Flags: Read

Default value: 0


The “configured-width” property

  “configured-width”         guint

The width of the layer surface set by the compositor.

Flags: Read

Default value: 0


The “exclusive-zone” property

  “exclusive-zone”           gint

Set area that is not occluded with other surfaces.

Flags: Read / Write

Allowed values: >= -1

Default value: 0


The “height” property

  “height”                   guint

The height of the layer surface.

Flags: Read / Write

Default value: 0


The “kbd-interactivity” property

  “kbd-interactivity”        gboolean

Whether the surface interacts with the keyboard.

Flags: Read / Write

Default value: FALSE


The “layer” property

  “layer”                    guint

The layer the surface should be attached to.

Flags: Read / Write / Construct Only

Default value: 0


The “layer-shell” property

  “layer-shell”              gpointer

The layer shell wayland global.

Flags: Read / Write / Construct Only


The “margin-bottom” property

  “margin-bottom”            gint

Distance away from the bottom anchor point.

Flags: Read / Write

Default value: 0


The “margin-left” property

  “margin-left”              gint

Distance away from the left anchor point.

Flags: Read / Write

Default value: 0


The “margin-right” property

  “margin-right”             gint

Distance away from the right anchor point.

Flags: Read / Write

Default value: 0


The “margin-top” property

  “margin-top”               gint

Distance away from the top anchor point.

Flags: Read / Write

Default value: 0


The “namespace” property

  “namespace”                gchar *

Namespace of the layer surface.

Flags: Read / Write / Construct Only

Default value: ""


The “width” property

  “width”                    guint

The width of the layer surface.

Flags: Read / Write

Default value: 0


The “wl-output” property

  “wl-output”                gpointer

The wl_output associated with this surface.

Flags: Read / Write / Construct Only

Signal Details

The “configured” signal

void
user_function (PhoshLayerSurface *self,
               gpointer           user_data)

This signal is emitted once we received the configure event from the compositor.

Parameters

self

The PhoshLayerSurface instance.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last