Mutter Reference Manual: MetaBarrier

## MetaBarrier MetaBarrier — Pointer barriers |

## Functions

gboolean | meta_barrier_is_active ()
void | meta_barrier_destroy ()
void | meta_barrier_release ()

## Properties

MetaBarrierDirection | directions | Read / Write / Construct Only
MetaDisplay * | display | Read / Write / Construct Only
gint | x1 | Read / Write / Construct Only
gint | x2 | Read / Write / Construct Only
gint | y1 | Read / Write / Construct Only
gint | y2 | Read / Write / Construct Only

## Signals

void | hit | Run First
void | left | Run First

## Types and Values

struct | MetaBarrier
struct | MetaBarrierClass
enum | MetaBarrierDirection
struct | MetaBarrierEvent

## Object Hierarchy

        GBoxed
        ╰── MetaBarrierEvent
        GObject
        ╰── MetaBarrier

## Description

## Functions

### meta_barrier_is_active ()

    gboolean
    meta_barrier_is_active (MetaBarrier *barrier);

### meta_barrier_destroy ()

    void
    meta_barrier_destroy (MetaBarrier *barrier);

### meta_barrier_release ()

    void
    meta_barrier_release (MetaBarrier *barrier,
                          MetaBarrierEvent *event);

In XI2.3, pointer barriers provide a feature where they can be temporarily released so that the pointer goes through them. Pass a MetaBarrierEvent to release the barrier for this event sequence.

#### Parameters

barrier | The barrier to release |
event | The event to release the pointer for |

## Types and Values

### struct MetaBarrier

    struct MetaBarrier;

The MetaBarrier structure contains only private data and should be accessed using the provided API

### struct MetaBarrierClass

    struct MetaBarrierClass {
    };

The MetaBarrierClass structure contains only private data.

### enum MetaBarrierDirection

#### Members

META_BARRIER_DIRECTION_POSITIVE_X | Positive direction in the X axis |
META_BARRIER_DIRECTION_POSITIVE_Y | Positive direction in the Y axis |
META_BARRIER_DIRECTION_NEGATIVE_X | Negative direction in the X axis |
META_BARRIER_DIRECTION_NEGATIVE_Y | Negative direction in the Y axis |

### struct MetaBarrierEvent

    struct MetaBarrierEvent {
      int event_id;
      int dt;
      guint32 time;
      double x;
      double y;
      double dx;
      double dy;
      gboolean released;
      gboolean grabbed;
    };

#### Members

int `event_id`; | A unique integer ID identifying a consecutive series of motions at or along the barrier |
int `dt`; | Server time, in milliseconds, since the last event sent for this barrier |
guint32 `time`; | Server time, in milliseconds |
double `x`; | The cursor X position in screen coordinates |
double `y`; | The cursor Y position in screen coordinates. |
double `dx`; | If the cursor hadn't been constrained, the delta of X movement past the barrier, in screen coordinates |
double `dy`; | If the cursor hadn't been constrained, the delta of X movement past the barrier, in screen coordinates |
gboolean `released`; | A boolean flag, `TRUE` if this event generated by the pointer leaving the barrier as a result of a client calling `meta_barrier_release()` (will be set only for MetaBarrier::leave signals) |
gboolean `grabbed`; | A boolean flag, `TRUE` if the pointer was grabbed at the time this event was sent |

## Property Details

### The `“directions”` property

      “directions”               MetaBarrierDirection

A set of directions to let the pointer through.

Flags: Read / Write / Construct Only

### The `“display”` property

      “display”                  MetaDisplay *

The display to construct the pointer barrier on.

Flags: Read / Write / Construct Only

### The `“x1”` property

      “x1”                       gint

The first X coordinate of the barrier.

Flags: Read / Write / Construct Only

Allowed values: [0,32767]

Default value: 0

### The `“x2”` property

      “x2”                       gint

The second X coordinate of the barrier.

Flags: Read / Write / Construct Only

Allowed values: [0,32767]

Default value: 32767

### The `“y1”` property

      “y1”                       gint

The first Y coordinate of the barrier.

Flags: Read / Write / Construct Only

Allowed values: [0,32767]

Default value: 0

### The `“y2”` property

      “y2”                       gint

The second Y coordinate of the barrier.

Flags: Read / Write / Construct Only

Allowed values: [0,32767]

Default value: 32767

## Signal Details

### The `“hit”` signal

    void
    user_function (MetaBarrier      *barrier,
                   MetaBarrierEvent *event,
                   gpointer          user_data)

When a pointer barrier is hit, this will trigger. This requires an XI2-enabled server.

#### Parameters

barrier | The MetaBarrier that was hit |
event | A MetaBarrierEvent that has the details of how the barrier was hit. |
user_data | user data set when the signal handler was connected. |

Flags: Run First

### The `“left”` signal

    void
    user_function (MetaBarrier      *barrier,
                   MetaBarrierEvent *event,
                   gpointer          user_data)

When a pointer barrier hitbox was left, this will trigger. This requires an XI2-enabled server.

#### Parameters

barrier | The MetaBarrier that was left |
event | A MetaBarrierEvent that has the details of how the barrier was left. |
user_data | user data set when the signal handler was connected. |

Flags: Run First