I have problem with embedding urxvt terminal within QT application. Below is simplified code example. When i create a QT window and embed urxvt terminal inside(by using -embed parameter), i have a problem with focus. When the window is created, the first click into window make focus on embedded terminal -> everything ok, But when i click into the window second time, the terminal seems to loose the focus, though normal keyboard and mouse input is still working. But the terminal itself seems to think, it has no focus. It seems, like events are still sent to the embed window, though it has no focus. Same problem appears when using C++ QT bindings.
It is nicely visible when add setting to .Xdefaults(and running necessary xrdb -load .Xdefaults): URxvt*fading: -40
Here is simplified example:
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class embterminal(QWidget):
def __init__(self):
QWidget.__init__(self)
self.setGeometry(1,1,600,400)
self.process = QProcess(self)
self.terminal = QX11EmbedContainer(self)
layout = QVBoxLayout(self)
layout.addWidget(self.terminal)
self.terminal.showMaximized();
self.process.start('urxvt',['-embed', str(self.terminal.winId())])
if __name__ == "__main__":
app = QApplication(sys.argv)
main = embterminal()
main.show()
sys.exit(app.exec_())`
From the docs for QX11EmbedContainer:
So perhaps urxvt (or your version of it) does not support all the necessary features of the XEmbed Protocol.
A web search turned up this comment: