@@ -79,7 +79,7 @@ void window_size_allocate_signal(GtkWidget* widget, GtkAllocation *alloc,
79
79
if (!xid) {
80
80
return ;
81
81
}
82
- ::Window xchild = find_child_browser (cef_get_xdisplay (), xid);
82
+ ::Window xchild = find_child_browser (xid);
83
83
// LOG(INFO) << "window_size_allocate_signal() xchild=" << xchild;
84
84
if (!xchild) {
85
85
return ;
@@ -97,7 +97,7 @@ void window_focus_in_signal(GtkWidget* widget, gpointer data) {
97
97
// LOG(INFO) << "window_focus_in_signal";
98
98
ClientHandler *handler = ClientHandler::GetInstance ();
99
99
::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);
101
101
CefRefPtr<CefBrowser> browser = handler->FindBrowserByXid (browser_xid);
102
102
if (browser_xid && browser.get ()) {
103
103
// LOG(INFO) << "window_focus_in_signal: Focus browser";
@@ -109,7 +109,7 @@ void window_focus_out_signal(GtkWidget* widget, gpointer data) {
109
109
// LOG(INFO) << "window_focus_out_signal";
110
110
ClientHandler *handler = ClientHandler::GetInstance ();
111
111
::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);
113
113
CefRefPtr<CefBrowser> browser = handler->FindBrowserByXid (browser_xid);
114
114
if (browser_xid && browser.get ()) {
115
115
// LOG(INFO) << "window_focus_out_signal: Unfocus browser";
@@ -144,13 +144,14 @@ void set_window_icon(GtkWindow* window, const char* icon) {
144
144
}
145
145
}
146
146
147
- ::Window find_child_browser (::Display* display, :: Window window) {
147
+ ::Window find_child_browser (::Window window) {
148
148
::Window root;
149
149
::Window parent;
150
150
::Window* children;
151
151
::Window child_window = 0L ;
152
152
unsigned int nchildren;
153
- if (XQueryTree (display, window, &root, &parent, &children, &nchildren)) {
153
+ if (XQueryTree (cef_get_xdisplay (), window, &root, &parent, &children,
154
+ &nchildren)) {
154
155
if (children && nchildren > 1 ) {
155
156
child_window = children[1 ]; // sic!
156
157
XFree (children);
0 commit comments