gboolean WindowConfigure(GtkWidget* widget,
GdkEventConfigure* event,
gpointer user_data) {
if (g_handler) {
CefRefPtr<CefBrowser> browser = g_handler->GetBrowser();
if (browser && !browser->GetHost()->IsWindowRenderingDisabled()) {
::Display* xdisplay = cef_get_xdisplay();
::Window xwindow = browser->GetHost()->GetWindowHandle();
XWindowChanges changes = {0};
changes.x = 0;
changes.y = g_toolbar_height + g_menubar_height;
changes.width = event->width;
changes.height = event->height -
(g_toolbar_height + g_menubar_height);
XConfigureWindow(xdisplay, xwindow, CWX | CWY | CWHeight | CWWidth,
&changes);
}
}
return FALSE;
}
Mayhew wrote:The last issue is that when CefWindowX11 is a child window, ConfigureNotify is only called on a main window resize. Moving the apps main window doesn't trigger that event so the coordinates will get out of whack if you simply move the window. This may require changing the client to call XConfigureWindow on a window move, from a configure-event signal handler. Working on that now. If that works I should have a patch on Monday.
Mayhew wrote:One solution seems to be to update the screen bounds of Window Tree Host in the CefWindowX11's FocusIn handler. This event is sent at the end of every resize and every window move. Since this set_screen_bounds() only sets the screen bounds member I don't think this would be a bad solution.
magreenblatt wrote:Mayhew wrote:One solution seems to be to update the screen bounds of Window Tree Host in the CefWindowX11's FocusIn handler. This event is sent at the end of every resize and every window move. Since this set_screen_bounds() only sets the screen bounds member I don't think this would be a bad solution.
Are you sure FocusIn will always be sent on resize and window move? For example, what if there's some other control like a text area that has and keeps the focus? If the CEF window receives FocusIn even when the URL text field has focus that might be a bug in the GTK integration and not intended behavior.
Users browsing this forum: No registered users and 39 guests