Export ShellClient to Scripting
Open, Needs TriagePublic

sitter added a subscriber: sitter.
sitter added a comment.Nov 7 2016, 2:48 PM

Originally made by graesslin at 2015-06-08 19:41:08 UTC

ScriptingModel is adjusted

romangg renamed this task from [kwin] Export ShellClient to Scripting to Export ShellClient to Scripting.Sep 16 2019, 11:45 AM
romangg edited projects, added KWin; removed Plasma on Wayland.
romangg added subscribers: zzag, romangg.

@zzag You improved the scripting on Wayland, right? Is this task resolved?

zzag added a comment.Sep 16 2019, 12:45 PM

In general, yes.

However, we need to provide scripts some way to differentiate between X11 clients and Wayland clients. There's no concept of managed clients on Wayland, so checking managed property is a bad idea if it's a wayland client.

Perhaps it's worth adding protocol property, e.g.

class Toplevel : public QObject
{
    Q_OBJECT

    Q_PROPERTY(Protocol protocol READ protocol CONSTANT)

public:
    /**
     * This enum blah blah.
     */
    enum class Protocol {
        Internal, ///< The Toplevel represents an internal client.
        Wayland, ///< The Toplevel represents a Wayland client.
        X11, ///< The Topelvel represents an X11 client.
    };
    Q_ENUM(Protocol);

    // lots of code

    virtual Protocol protocol() const = 0;

    // lots of code
};