http://bugs.winehq.org/show_bug.cgi?id=59740 Bug ID: 59740 Summary: Programs running under Wayland do not notice when they lose focus Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: winewayland Assignee: wine-bugs@list.winehq.org Reporter: winezilla@xobs.io Distribution: --- When running under X11, programs can use `GetForegroundWindow()` to detect if they have focus or not. This gets updated as part of `X11DRV_FocusIn()` and `focus_out()` (which is called by `X11DRV_FocusOut()`. The X11 code works by setting the foreground window to the desktop when this happens: /* Abey : 6-Oct-99. Check again if the focus out window is the Foreground window, because in most cases the messages sent above must have already changed the foreground window, in which case we don't have to change the foreground window to 0 */ if (hwnd == NtUserGetForegroundWindow()) { TRACE( "lost focus, setting fg to desktop\n" ); NtUserSetForegroundWindowInternal( NtUserGetDesktopWindow() ); } The Wayland driver has no such check, and as a result programs don't notice they are not the foreground window any more. Instead, the function `keyboard_handle_leave()` has this comment: /* FIXME: update foreground window as well */ -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.