<div dir="ltr"><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Hi!, i have a question about how to emebed libreoffice into gtk3 <span style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-weight:normal;text-align:left">GtkWidget in Linux.</span></div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">code is here:</div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">// create a gtk3 GtkWidget</div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-weight:normal;text-align:left">GtkWidget</span>* pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);</div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="background-color:inherit">gtk_window_set_default_size(GTK_WINDOW(m_pWindow), 1024, 768);</div><div style="background-color:inherit">gtk_container_set_border_width(GTK_CONTAINER(m_pWindow), 0);</div><div style="background-color:inherit">gtk_window_set_position(GTK_WINDOW(m_pWindow), GTK_WIN_POS_CENTER);</div></div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="background-color:inherit"></div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="background-color:inherit">m_socketWnd = gtk_socket_new();</div></div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="background-color:inherit">m_nSocketWndId = gtk_socket_get_id(GTK_SOCKET(m_socketWnd));</div></div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="background-color:inherit"></div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">//then create libreoffice window</div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="background-color:inherit">uno::Sequence<beans::NamedValue> aProps(2);</div><div style="background-color:inherit">aProps[0].Name = OUString("WINDOW");</div><div style="background-color:inherit">aProps[0].Value = uno::Any(<span style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-weight:normal;text-align:left">m_nSocketWndId </span>);</div><div style="background-color:inherit">aProps[1].Name = OUString("XEMBED");</div><div style="background-color:inherit">aProps[1].Value = uno::Any(true);</div><div style="background-color:inherit"><br style="background-color:inherit"></div><div style="background-color:inherit">uno::Reference<awt::XWindowPeer> xPeer = uno::Reference<awt::XWindowPeer>(xSystemChildFactory->createSystemChild(</div><div style="background-color:inherit">uno::Any(aProps), uno::Sequence<sal_Int8>(4), SYSTEM_XWINDOW), uno::UNO_QUERY);</div></div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">...</div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="background-color:inherit"></div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">the problem is <span style="background-color:inherit;line-height:1.5">libreoffice can't capture keypress but event, when i embed it into gtk3 GtkWidget. <br></span></div><div style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软雅黑;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="background-color:inherit;line-height:1.5">waiting for your help thankyou!<br></span></div></div>