Compositor API#

This API handles communication with the display server. If possible it is recommended to use use libblight instead

Name

Specification

Description

pid

INT32 property (read)

Get the PID of the display server process.

clipboard

ARRAY BYTE property (read)

Get the contents of the clipboard

selection

ARRAY BYTE property (read)

Get the contents of the primary selection

secondary

ARRAY BYTE property (read)

Get the contents of the secondary selection

clipboardChanged

signal

  • (out) ARRAY BYTE

The clipboard contents changed

selectionChanged

signal

  • (out) ARRAY BYTE

The primary selection contents changed

secondaryChanged

signal

  • (out) ARRAY BYTE

The secondary selection contents changed

open

method

  • (out) UNIX_FD

Get the socket descriptor for the current process’ display server connection

openInput

method

  • (out) UNIX_FD

Get the socket descriptor for the current process’ input event stream

addSurface

method

  • (out) UINT16

  • (in) fd UNIX_FD

  • (in) x INT32

  • (in) y INT32

  • (in) width INT32

  • (in) height INT32

  • (in) stride INT32

  • (in) format INT32

Add a surface to the display server

repaint

method

  • (in) STRING

Repaint a surface or all the surfaces for a connection.

getSurface

method

  • (in) identifier

    UINT16

  • (out) UINT16

Get the file descriptor for the buffer of a surface

setFlags

method

  • (in) identifier

    STRING

  • (in) flags STRING ARRAY

Set flags on a surface or connection

getSurfaces

method

  • (out) STRING ARRAY

Get a list of all surfaces currently on the display server

frameBuffer

method

  • (out) UNIX_FD

Get the file descriptor of the device frame buffer

lower

method

  • (in) STRING

Lower a surface or all the surfaces for a connection.

raise

method

  • (in) STRING

Raise a surface or all the surfaces for a connection.

focus

method

  • (in) STRING

Focus a connection so that it recieves input events

focus

method

Focus a connection so that it

waitForNoRepaints

method

Wait for all pending repaints to complete

enterExclusiveMode

method

Enter exlcusive mode

exitExclusiveMode

method

Exit exclusive move

exlusiveModeRepaint

method

Repaint the framebuffer

Example Usage#

#include <QDebug>
#include <liboxide/dbus.h>

using namespace codes::eeems::blight1;

int main(int argc, char* argv[]){
    auto bus = QDBusConnection::systemBus();
    Compositor compositor(BLIGHT_SERVICE, "/", bus);
    qDebug() << "Display server PID:" << compositor.pid();
    return EXIT_SUCCESS;
}
#!/bin/bash
echo "Display server PID: $(rot compositor get pid)"
echo "Display server surfaces:"
rot compositor call getSurfaces | jq -r '.[]'