Search code examples
x11valagdk

How to get window xid in Vala using Gdk.X11.Window?


I am using GStreamer in my program, and I need to get window xid to use it. I have working solution now, but it's deprecated (I am using Gdk.X11Window now). How can I do the same but using Gdk.X11.Window so it won't be deprecated?

Here is what I'm doing now, it's working but, according to the compiler it's deprecated.

this.drawingArea.realize.connect(() => {
    this.xid = (uint*)Gdk.X11Window.get_xid(this.drawingArea.get_window());
});

(drawingArea is Gdk.DrawingArea)


Solution

  • ((Gdk.X11.Window) this.drawing_area.get_window()).get_xid ();