-
-
Notifications
You must be signed in to change notification settings - Fork 875
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
Xwayland doesn't unfocus when switching to wayland client #7698
Comments
niri has this problem too, but imepopup works fine in xwayland. |
Agreed as this is a regression, but not from Hyprland itself? Simplest target is Aquamarine but I haven't bisected it yet to be able to fully pinpoint the problem. Confirmed not by Hyprland by testing #7458 which I've seen handle this case specifically. |
Hi @Trimutex. May I ask why // In activateSurface()
if (!surf || (!activate && g_pCompositor->m_pLastWindow && !g_pCompositor->m_pLastWindow->m_bIsX11)) { Because, I think it directly clashes with unfocusing part(when switching focus from xwayland to wayland) here if (g_pCompositor->m_pLastFocus && g_pCompositor->m_pLastWindow->m_bIsX11)
activateSurface(g_pCompositor->m_pLastFocus.lock(), false); |
Yeah so the naming gets a bit messy when working with the focus function here. If the last surface (current one we are trying to focus) is not x11, but the old focus (before function call) is, we want to focus nothing in xwayland. |
I think it's probably the same issue: |
In here void CXWM::activateSurface(SP<CXWaylandSurface> surf, bool activate) {
if ((surf == focusedSurface && activate) || (surf && surf->overrideRedirect))
return;
if (!surf || (!activate && g_pCompositor->m_pLastWindow && !g_pCompositor->m_pLastWindow->m_bIsX11)) {
setActiveWindow((uint32_t)XCB_WINDOW_NONE);
focusWindow(nullptr);
} else {
setActiveWindow(surf ? surf->xID : (uint32_t)XCB_WINDOW_NONE);
focusWindow(surf);
}
xcb_flush(connection);
} Doesn't this If // In CHyprXWaylandManager::activateSurface()
if (g_pCompositor->m_pLastFocus && g_pCompositor->m_pLastWindow->m_bIsX11)
activateSurface(g_pCompositor->m_pLastFocus.lock(), false); Am I understanding it right? |
Feel free to test and PR if you find this to be the issue though or have a better method. |
Going to give bisecting Aquamarine a go. Will update |
Interestingly it seems to have never actually unfocused when going back on these commits when downgrading other pieces? I recall testing it and confirming it unfocused when I made the commit but I can't reproduce it anymore. Anyway, you were on the right track with the troublesome code piece. The test should have been for the focus's window, not the last global window. On a second look this piece brings the XWM focus back to that surface. Putting up a PR now :) |
Regression?
Yes
System Info and Version
System/Version info
Description
When switching to wayland from xwayland client, xwayland client doesn't unfocus.
This makes IME not being able to be activated when on the wayland client under these conditions.
Will do bisect when I have time.
How to reproduce
Cursor in xwayland client is still blinking even though the focus is in wayland client.
Crash reports, logs, images, videos
No response
The text was updated successfully, but these errors were encountered: