mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 20:40:11 +02:00
Explicitly handle no and pointer root input focus
This will never happen under normal X11. Apparently Crostini isn't normal X11. See #167.
This commit is contained in:
@@ -34,6 +34,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
If you try to process audio from the...audio thread, then they will produce
|
||||
silence and hang afterwards (which a fix in yabridge 3.7.0 previously
|
||||
addressed).
|
||||
- Fixed crashes when opening plugin editors under **Crostini** on ChromeOS due
|
||||
to non-standard X11 implementations.
|
||||
- Worked around a bug in the _RandARP_ VST2 plugin where the plugin would report
|
||||
that its editor window is 0 by 0 pixels.
|
||||
- Fixed building under (the currently upcoming) Wine 7.2 because of definition
|
||||
|
||||
@@ -839,10 +839,18 @@ void Editor::set_input_focus(bool grab) const {
|
||||
// we don't just check whether `current_focus` and `focus_target` are the
|
||||
// same window but we'll also allow `current_focus` to be a child of
|
||||
// `focus_target`.
|
||||
// NOTE: To make matters even more complicated, the focused window can also
|
||||
// be `None` or `PoointerRoot`. In a normal Xorg setup this will never
|
||||
// happen, but apparently Crostini does some strange things and it can
|
||||
// happen there. Since those flags aren't valid windows, we must avoid
|
||||
// calling `is_child_window_or_same()` in those cases.
|
||||
// https://github.com/robbert-vdh/yabridge/issues/167
|
||||
const xcb_window_t current_focus = focus_reply->focus;
|
||||
if (current_focus == focus_target ||
|
||||
(grab && is_child_window_or_same(*x11_connection_, current_focus,
|
||||
focus_target))) {
|
||||
(grab && current_focus != XCB_INPUT_FOCUS_NONE &&
|
||||
current_focus != XCB_INPUT_FOCUS_POINTER_ROOT &&
|
||||
is_child_window_or_same(*x11_connection_, current_focus,
|
||||
focus_target))) {
|
||||
logger_.log_editor_trace([&]() {
|
||||
std::string reason = "unknown reason";
|
||||
if (current_focus == focus_target) {
|
||||
|
||||
Reference in New Issue
Block a user