Handling embedded windows in Linux

meilin lgh710681042 at gmail.com
Sat Oct 29 02:12:09 UTC 2016


Hi!, i have a question about how to emebed libreoffice into gtk3 GtkWidget
in Linux.
code is here:
// create a gtk3 GtkWidget
GtkWidget* pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(m_pWindow), 1024, 768);
gtk_container_set_border_width(GTK_CONTAINER(m_pWindow), 0);
gtk_window_set_position(GTK_WINDOW(m_pWindow), GTK_WIN_POS_CENTER);

m_socketWnd = gtk_socket_new();
m_nSocketWndId = gtk_socket_get_id(GTK_SOCKET(m_socketWnd));

//then create libreoffice window
uno::Sequence<beans::NamedValue> aProps(2);
aProps[0].Name = OUString("WINDOW");
aProps[0].Value = uno::Any(m_nSocketWndId );
aProps[1].Name = OUString("XEMBED");
aProps[1].Value = uno::Any(true);

uno::Reference<awt::XWindowPeer> xPeer =
uno::Reference<awt::XWindowPeer>(xSystemChildFactory->createSystemChild(
uno::Any(aProps), uno::Sequence<sal_Int8>(4), SYSTEM_XWINDOW), uno::UNO_QUERY);
...

the problem is libreoffice can't capture keypress but
event, when i embed it into gtk3 GtkWidget.
waiting for your help thankyou!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20161029/75a2f411/attachment.html>


More information about the LibreOffice mailing list