@@ -79,7 +79,7 @@ void window_size_allocate_signal(GtkWidget* widget, GtkAllocation *alloc,
7979 if (!xid) {
8080 return ;
8181 }
82- ::Window xchild = find_child_browser (cef_get_xdisplay (), xid);
82+ ::Window xchild = find_child_browser (xid);
8383 // LOG(INFO) << "window_size_allocate_signal() xchild=" << xchild;
8484 if (!xchild) {
8585 return ;
@@ -97,7 +97,7 @@ void window_focus_in_signal(GtkWidget* widget, gpointer data) {
9797 // LOG(INFO) << "window_focus_in_signal";
9898 ClientHandler *handler = ClientHandler::GetInstance ();
9999 ::Window window_xid = get_window_xid (widget);
100- ::Window browser_xid = find_child_browser (cef_get_xdisplay (), window_xid);
100+ ::Window browser_xid = find_child_browser (window_xid);
101101 CefRefPtr<CefBrowser> browser = handler->FindBrowserByXid (browser_xid);
102102 if (browser_xid && browser.get ()) {
103103 // LOG(INFO) << "window_focus_in_signal: Focus browser";
@@ -109,7 +109,7 @@ void window_focus_out_signal(GtkWidget* widget, gpointer data) {
109109 // LOG(INFO) << "window_focus_out_signal";
110110 ClientHandler *handler = ClientHandler::GetInstance ();
111111 ::Window window_xid = get_window_xid (widget);
112- ::Window browser_xid = find_child_browser (cef_get_xdisplay (), window_xid);
112+ ::Window browser_xid = find_child_browser (window_xid);
113113 CefRefPtr<CefBrowser> browser = handler->FindBrowserByXid (browser_xid);
114114 if (browser_xid && browser.get ()) {
115115 // LOG(INFO) << "window_focus_out_signal: Unfocus browser";
@@ -144,13 +144,14 @@ void set_window_icon(GtkWindow* window, const char* icon) {
144144 }
145145}
146146
147- ::Window find_child_browser (::Display* display, :: Window window) {
147+ ::Window find_child_browser (::Window window) {
148148 ::Window root;
149149 ::Window parent;
150150 ::Window* children;
151151 ::Window child_window = 0L ;
152152 unsigned int nchildren;
153- if (XQueryTree (display, window, &root, &parent, &children, &nchildren)) {
153+ if (XQueryTree (cef_get_xdisplay (), window, &root, &parent, &children,
154+ &nchildren)) {
154155 if (children && nchildren > 1 ) {
155156 child_window = children[1 ]; // sic!
156157 XFree (children);
0 commit comments