XEmbed issue when plug created before socket
I don't know who is wrong of me or i3‑wm.
From a regular Ubuntu desktop session:
- I can run a socket then start a plug which embeds it‑self in the socket.
- I can start a plug, then a socket embedding the plug.
From an i3‑wm session:
- I can run a socket then start a plug which embed it‑self in the socket.
- I can start a plug, then a socket, but which (seemingly) cannot embed the plug.
In short, within an i3‑wm session, starting a plug then starting a socket to embed the plug, does not work, while it works from an Ubuntu session.
A sample case
To run this sample case, you will need to have surf
installed (available in Ubuntu packages repository, or else, see there: surf.suckless.org).
The plug is surf
, a browser from Suckless, which is a wrapper around WebKit. The socket application is this sample Python script:
#!/usr/bin/python
import gtk
import sys
def plugged_event(widget):
print(
"I (" +
str(widget) +
") have just had a plug inserted!")
def main():
window = gtk.Window()
socket = gtk.Socket()
window.show()
socket.show()
window.add(socket)
window.connect("destroy", lambda w: gtk.main_quit())
socket.connect("plug-added", plugged_event)
print socket.get_id()
if len(sys.argv) == 2:
socket.add_id(long(sys.argv[1]))
gtk.main()
main()
Doing so will be OK:
./socket.py &
# Copy the window ID which is echoed (not the PID!).
surf -e <past-socket-window-id-here> "http://localhost" &
# The `-e XWINDOW_ID` option tells `surf` to embed it‑self there.
Doing so will fail in i3‑wm (OK from a regular Ubuntu desktop cession):
surf -x "http://localhost" &
# Copy the window ID which is echoed (not the PID!).
# The `-x` option tells `surf` to display its XWindow ID.
./socket.py <past-plug-window-id-here> &
I just get a blank window, with no content at all, while surf
properly displays itself in the socket, when I do the same from an Ubuntu desktop session.
Question
Is this me or i3 which is bugging?