arch DJ
arch DJ

Reputation: 115

Can't get xid of GtkDrawingArea widget

I am trying to create a GUI application using python-vlc and Gtk in Python 3.6. But when I try to access the xid of my GtkDrawingArea widget (to bind it with my player's screen), I get an error message

AttributeError: 'GdkWaylandWindow' object has no attribute 'get_xid'

Here is the part of code where I'm trying to fetch the xid of GtkDrawingArea widget:

def vlc_realize_handler(self, widget, data=None):
    self.win_id = widget.get_property('window').get_xid()
    self.player.set_xwindow(self.win_id)

So, how do I bind my player with this widget?

PS - I'm using Ubuntu 17.10 as my Operating System which uses Gnome shell by default.

Upvotes: 1

Views: 1510

Answers (1)

Phoenix87
Phoenix87

Reputation: 1149

I think this is caused by the fact that Gtk+ 3.0 applications will run through Wayland directly by default. To force the app to go through XWayland (an X Client over Wayland), start your app with

GDK_BACKEND=x11 your-app

I guess this is how many X11 apps can be used on Wayland.

Upvotes: 1

Related Questions