Git Product home page Git Product logo

Comments (15)

kapouer avatar kapouer commented on May 26, 2024

Not at the moment.
However there are DOM-level window methods:

  • moveTo / moveBy
  • resizeTo / resizeBy

They are not doing anything right now, but if enabling them is easy, i'd add that option to this module.

from node-webkitgtk.

kapouer avatar kapouer commented on May 26, 2024

I think i found the code in epiphany to make it work ! Trying...

from node-webkitgtk.

kapouer avatar kapouer commented on May 26, 2024

I added support in version 4.8.0. If you could test it before i publish, it would be awesome.
Here only "resizeTo" works but not perfectly. I suspect gnome-shell or wayland ignores gtk_window_move calls.

from node-webkitgtk.

 avatar commented on May 26, 2024

i think i can't test it cuz i'm using wayland

from node-webkitgtk.

 avatar commented on May 26, 2024

which branch ? i'll try to boot to my other OS that using X

from node-webkitgtk.

kapouer avatar kapouer commented on May 26, 2024

You can use master branch, npm install kapouer/node-webkitgtk should do it.

from node-webkitgtk.

 avatar commented on May 26, 2024

it work, now my problem is how to expose an api to this webview, so that the running javascript can access it, is it using webkit2gtk-web-extension ?

from node-webkitgtk.

kapouer avatar kapouer commented on May 26, 2024

If you want to place the window from the node module, you can execute a js function inside the web page using

var dims = {
  height: 400
};
webview.run(function(dims, done) {
  window.moveTo(0, window.screen.height - dims.height);
  window.resizeTo(window.screen.width, dims.height);
  done();
}, dims, function(err) {

});

from node-webkitgtk.

kapouer avatar kapouer commented on May 26, 2024

You can also pass parameters to caller (like in this example) and the callee can return parameters, see README.md.

from node-webkitgtk.

 avatar commented on May 26, 2024

okay thanks, btw how i can get the window id ?
i'm trying to use this library with node-x11 but i don't know how to get the window id, any clue ?

from node-webkitgtk.

kapouer avatar kapouer commented on May 26, 2024

I'm not sure i understand what's a window id. Could you find the relevant gtk doc ?

from node-webkitgtk.

 avatar commented on May 26, 2024

some reference i've found:

from node-webkitgtk.

kapouer avatar kapouer commented on May 26, 2024

FYI i've released (node-webkitgtk version 4.8.1 with resizeTo/moveTo support.

from node-webkitgtk.

 avatar commented on May 26, 2024

@kapouer thx man but i have made my own based on your code, cuz i need xid from gdk-x11.
and i think there is some issue with the window where i can't have window size lower than 200,
so i made some adjustment using input region.
If you are interested i can do a pull request, you can check my code here.
you can read the ISSUES file to know some common issues that i found.

from node-webkitgtk.

kapouer avatar kapouer commented on May 26, 2024

Interesting. I suppose several of these issues are libwebkitgtk-related.
Did you try the (updated) example here ?

from node-webkitgtk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.