Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set the _NET_WM_WINDOW_TYPE property? #106

Open
IonicaBizau opened this issue Oct 1, 2015 · 8 comments
Open

How to set the _NET_WM_WINDOW_TYPE property? #106

IonicaBizau opened this issue Oct 1, 2015 · 8 comments

Comments

@IonicaBizau
Copy link

Here is a related question–maybe some of you have better ideas.

In the meantime I want to try setting the _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DESKTOP property, having the window id. How can I do that?

@sidorares
Copy link
Owner

have you looked at https://github.com/santigimeno/node-ewmh ?

@IonicaBizau
Copy link
Author

@sidorares Nope! Looking at it. Is there any example on setting such properties?

@sidorares
Copy link
Owner

ChangeProperty example - https://github.com/sidorares/node-x11/blob/master/examples/smoketest/changeprop.js#L16

You'll need to do InternAtom to get id for _NET_WM_WINDOW_TYPE and _NET_WM_WINDOW_TYPE_DESKTOP, example - https://github.com/sidorares/node-x11/blob/master/examples/smoketest/atoms.js#L5

@sidorares
Copy link
Owner

Oh, there are some nice helpers in https://github.com/santigimeno/node-x11-prop as well

@IonicaBizau
Copy link
Author

InternAtom(true, "_SET_WM_WINDOW_TYPE", function (err, atomId) { 
   /* ... */
});

The atomId is 0–is it fine?

@IonicaBizau
Copy link
Author

Hmm, here is what I did:

var x11 = require('x11');

var PointerMotion = x11.eventMask.PointerMotion;
x11.createClient(function(err, display) {
    var X = display.client;
    var root = display.screen[0].root;

    // mode: 0 replace, 1 prepend, 2 append
    // mode, wid, name, type, format, data
    X.InternAtom(true, "_NET_WM_WINDOW_TYPE", function (err, atomId) { // 332
        X.InternAtom(true, "_NET_WM_WINDOW_TYPE_DESKTOP", function (err, desktop) { // 337
debugger
            X.ChangeProperty(0, Number(process.argv[2]), atomId, X.atoms.ATOM, 8, desktop);
        });
    });
});

I don't know what's wrong, but the window doesn't become most bottom.... 😢

@sidorares
Copy link
Owner

what window manager are you using?

@IonicaBizau
Copy link
Author

@sidorares openbox, on Ubuntu Server 14.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants