Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedding CEF in GTK application fails when using default GTK X visual #3564

Closed
vadz opened this issue Sep 2, 2023 · 1 comment
Closed
Labels
bug Bug report linux Linux platform

Comments

@vadz
Copy link

vadz commented Sep 2, 2023

This seems to be a pretty old problem as it was discussed in cztomczak/cefcapi#9 ~6 years ago, but I'd like to open this issue because it's still present in CEF 116 with GTK 3.24: when trying to embed CEF into a GTK window, it fails due to the apparent visual mismatch, see the first error in the error log.

Error log excerpt
[0902/222602.771736:ERROR:render_widget_host_view_aura.cc(464)] Not implemented reached in virtual gfx::NativeViewAccessible content::RenderWidgetHostViewAura::GetNativeViewAccessible()
[0902/222602.773079:WARNING:connection.cc(41)] X error received.  Request: CreateWindowRequest, Error: MatchError{.sequence = 238, .bad_value = 10485798, .minor_opcode = 0, .major_opcode = 1}
[0902/222602.773334:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 252, .bad_value = 14680067, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773353:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 253, .bad_value = 14680067, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773367:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 254, .bad_value = 14680067, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773440:WARNING:connection.cc(41)] X error received.  Request: CreateWindowRequest, Error: WindowError{.sequence = 257, .bad_value = 14680067, .minor_opcode = 0, .major_opcode = 1}
[0902/222602.773479:WARNING:connection.cc(41)] X error received.  Request: Input::XISelectEventsRequest, Error: WindowError{.sequence = 259, .bad_value = 14680068, .minor_opcode = 46, .major_opcode = 131}
[0902/222602.773497:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 260, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773510:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 261, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773527:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 262, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773542:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 263, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773555:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 264, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773564:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 265, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773572:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 266, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773579:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 267, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773640:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 268, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773689:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 269, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773704:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 270, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773729:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 272, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.773792:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 277, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.774900:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 278, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.774916:WARNING:connection.cc(41)] X error received.  Request: MapWindowRequest, Error: WindowError{.sequence = 279, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 8}
[0902/222602.774930:WARNING:connection.cc(41)] X error received.  Request: ConfigureWindowRequest, Error: WindowError{.sequence = 285, .bad_value = 14680068, .minor_opcode = 0, .major_opcode = 12}
[0902/222602.774938:WARNING:connection.cc(41)] X error received.  Request: ChangePropertyRequest, Error: WindowError{.sequence = 288, .bad_value = 14680067, .minor_opcode = 0, .major_opcode = 18}
[0902/222602.774943:WARNING:connection.cc(41)] X error received.  Request: MapWindowRequest, Error: WindowError{.sequence = 289, .bad_value = 14680067, .minor_opcode = 0, .major_opcode = 8}

I can work around it using a hack based on the code in this comment, but it doesn't seem right to adapt GTK "owner" to use CEF visual, it would be much better if CEF used the default/current GTK visual instead.

@vadz vadz added the bug Bug report label Sep 2, 2023
@magreenblatt magreenblatt added the linux Linux platform label Sep 4, 2023
vadz added a commit to TcT2k/wxWidgets that referenced this issue Sep 6, 2023
Make browser creation actually work by postponing it until the host
window is realized and so has a valid X11 Window.

Remove unnecessary code manually creating GTK widget and just use the
standard wxGTK wxWindow instead.

Add code for setting the visual compatible with CEF to avoid X11 errors,
see chromiumembedded/cef#3564, with many
thanks to Jiří Janoušek for finding and solving this problem originally.

Adjust the sample to handle wxWebView::Create() failure (not very
gracefully, but still better than just crashing) and to avoid using it
until it is fully created.

Update documentation to mention GTK limitations.
@magreenblatt
Copy link
Collaborator

Related CEF forum thread: https://magpcss.org/ceforum/viewtopic.php?f=6&t=16402

Based on that thread, and comments here, it sounds like changes in Chromium would be required to support your proposal. You're welcome to develop and propose the necessary changes to the Chromium devs, but I think they are unlikely to be accepted (unless they are very obviously beneficial to Chromium as well).

Given that a workaround currently exists for CEF, I'm going to close this issue as WontFix. If/when the necessary changes are made in upstream Chromium we can re-visit this issue.

@magreenblatt magreenblatt closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report linux Linux platform
Projects
None yet
Development

No branches or pull requests

2 participants