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

Wayland focus doesn't seem to trigger xwayland focus #98

Open
ToxicMushroom opened this issue Jan 25, 2025 · 4 comments
Open

Wayland focus doesn't seem to trigger xwayland focus #98

ToxicMushroom opened this issue Jan 25, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@ToxicMushroom
Copy link

When using focus-follows-mouse or switching window focus with keybinds, xwayland apps don't seem notice that they're focused.
Indicated by:

  • Can't type in new window popups that get focus
  • Can't type in windows after moving mouse back over the window to grab focus
  • Games stay running in low background fps when focused, sound is muted because it thinks its in the background
  • Clicking once on the xwayland window fixes it

Using Niri and xwayland-satellite

@Supreeeme
Copy link
Owner

Can you give specific examples? I exclusively use focus-follows-mouse and have not seen focus issues. Did you try with the latest commit?

@ToxicMushroom
Copy link
Author

Hmm it might be for child processes that spawn windows like:

  • intellij-idea popup boxes
  • ffxiv launched by xivlauncher-core
    I'll see if I can get more examples

@Supreeeme
Copy link
Owner

Supreeeme commented Jan 25, 2025

Could you provide some logs as well? Run satellite with RUST_LOG=debug set.

@ToxicMushroom
Copy link
Author

 2025-01-25T23:46:46.680Z DEBUG xwayland_satellite::xstate            > new window: CreateNotifyEvent { response_type: 16, pad: 1, sequence: 543, parent: Window { res_id: 1075 }, window: Window { res_id: 4195050 }, x: 0, y: 0, width: 948, height: 1022, border_width: 0, override_redirect: false, pad: 1 }
 2025-01-25T23:46:46.681Z WARN  xwayland_satellite::xstate            > unrecognized message: Atom { res_id: 279 }
 2025-01-25T23:46:46.711Z DEBUG xwayland_satellite::xstate            > Window { res_id: 4195050 } request: X | Y | WIDTH | HEIGHT
 2025-01-25T23:46:46.711Z DEBUG xwayland_satellite::server            > Reconfiguring WindowData { window: Window { res_id: 4195050 }, surface_serial: None, surface_key: None, mapped: false, attrs: WindowAttributes { override_redirect: false, popup_for: None, dims: WindowDims { x: 0, y: 0, width: 948, height: 1022 }, size_hints: None, title: None, class: None, group: None }, output_offset: WindowOutputOffset { x: 0, y: 0 }, output_key: None } WindowDims { x: 0, y: 0, width: 496, height: 576 }
 2025-01-25T23:46:46.722Z DEBUG xwayland_satellite::xstate            > Window { res_id: 4195050 } request: X | Y | WIDTH | HEIGHT
 2025-01-25T23:46:46.722Z DEBUG xwayland_satellite::server            > Reconfiguring WindowData { window: Window { res_id: 4195050 }, surface_serial: None, surface_key: None, mapped: false, attrs: WindowAttributes { override_redirect: false, popup_for: None, dims: WindowDims { x: 0, y: 0, width: 496, height: 576 }, size_hints: None, title: None, class: None, group: None }, output_offset: WindowOutputOffset { x: 0, y: 0 }, output_key: None } WindowDims { x: 0, y: 0, width: 948, height: 1022 }
 2025-01-25T23:46:46.722Z DEBUG xwayland_satellite::xstate            > Window { res_id: 4195050 } request: STACK_MODE
 2025-01-25T23:46:46.722Z DEBUG xwayland_satellite::xstate            > requested to map Window { res_id: 4195050 }
 2025-01-25T23:46:46.723Z DEBUG xwayland_satellite::xstate            > Window { res_id: 4195050 } geometry: GetGeometryReply { response_type: 1, depth: 24, sequence: 554, length: 0, root: Window { res_id: 1075 }, x: 0, y: 0, width: 948, height: 1022, border_width: 0, pad: 2 }
 2025-01-25T23:46:46.723Z DEBUG xwayland_satellite::server            > setting Window { res_id: 4195050 } hints WmNormalHints { min_size: Some(WinSize { width: 496, height: 576 }), max_size: None }
 2025-01-25T23:46:46.723Z DEBUG xwayland_satellite::server            > mapping Window { res_id: 4195050 }
 2025-01-25T23:46:46.723Z DEBUG xwayland_satellite::server::dispatch  > new surface with key ObjectKey(199v3) (Some(200))
 2025-01-25T23:46:46.723Z DEBUG xwayland_satellite::server::dispatch  > associate surface 200 with Window { res_id: 4195050 }
 2025-01-25T23:46:46.723Z DEBUG xwayland_satellite::server            > creating toplevel for Window { res_id: 4195050 }
 2025-01-25T23:46:46.724Z WARN  xwayland_satellite::server::event     > unhandled xdgtoplevel event: ConfigureBounds { width: 1904, height: 1022 }
 2025-01-25T23:46:46.724Z WARN  xwayland_satellite::server::event     > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2025-01-25T23:46:46.724Z DEBUG xwayland_satellite::server::event     > configuring toplevel 948x1022, [5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0]
 2025-01-25T23:46:46.724Z DEBUG xwayland_satellite::server::event     > configuring Window { res_id: 4195050 }: 0x0, 948x1022
 2025-01-25T23:46:46.724Z DEBUG xwayland_satellite::server::event     > wl_surface@200[0] entered wl_output@14[0]
 2025-01-25T23:46:46.724Z DEBUG xwayland_satellite::server            > focusing window Window { res_id: 4195050 }
 2025-01-25T23:46:46.725Z DEBUG xwayland_satellite::xstate            > primary output is already DP-1
 2025-01-25T23:46:46.725Z DEBUG xwayland_satellite::server::event     > configuring toplevel 948x1022, [5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0]
 2025-01-25T23:46:46.725Z DEBUG xwayland_satellite::server::event     > configuring Window { res_id: 4194680 }: 0x0, 948x1022
 2025-01-25T23:46:46.725Z DEBUG xwayland_satellite::server::event     > configuring toplevel 948x1022, [5, 0, 0, 0, 6, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0]
 2025-01-25T23:46:46.725Z DEBUG xwayland_satellite::server::event     > configuring Window { res_id: 4195050 }: 0x0, 948x1022
 2025-01-25T23:46:46.757Z DEBUG xwayland_satellite::server            > setting Window { res_id: 4195050 } hints WmNormalHints { min_size: Some(WinSize { width: 474, height: 286 }), max_size: None }
 2025-01-25T23:46:46.790Z DEBUG xwayland_satellite::server            > setting Window { res_id: 4195050 } hints WmNormalHints { min_size: Some(WinSize { width: 649, height: 286 }), max_size: None }
 2025-01-25T23:46:46.980Z DEBUG xwayland_satellite::server            > setting Window { res_id: 4195050 } hints WmNormalHints { min_size: Some(WinSize { width: 649, height: 302 }), max_size: None }
 2025-01-25T23:46:47.054Z DEBUG xwayland_satellite::server::event     > leaving surface (1093356)
 2025-01-25T23:46:47.054Z DEBUG xwayland_satellite::server::event     > entering surface (1093356)
  1. This is opening the search popup of intellij
  2. It automatically gets focus from niri
  3. I move my mouse into the popup
  4. I click to the popup be able to type (doesn't seem to log anything)

@Supreeeme Supreeeme added the bug Something isn't working label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants