hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.5k stars 899 forks source link

XWayland game turns black after switching to another XWayland window. #6375

Closed BluewyDiamond closed 3 months ago

BluewyDiamond commented 5 months ago

System Info and Version

System/Version info ```sh Hyprland, built from branch main at commit 9994b73ad0af5c9ba5fc4058234cea77d0a1ddb1 (buffer: track asynchronous buffers and don't release them until unref). Date: Sat Jun 8 17:27:56 2024 Tag: v0.40.0-176-g9994b73a, commits: 4782 flags: (if any) System Information: System name: Linux Node name: CachyOS Release: 6.9.3-4-cachyos-lto Version: #1 SMP PREEMPT_DYNAMIC Sat, 08 Jun 2024 12:42:12 +0000 GPU information: 2f:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] [1002:731f] (rev c1) (prog-if 00 [VGA controller]) os-release: NAME="CachyOS Linux" PRETTY_NAME="CachyOS" ID=cachyos ID_LIKE=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://cachyos.org/" DOCUMENTATION_URL="https://wiki.cachyos.org/" SUPPORT_URL="https://forum.cachyos.org/" BUG_REPORT_URL="https://github.com/cachyos" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=cachyos plugins: ======Config-Start====== Config File: /home/bluewy/.config/hypr/hyprland.conf: Read Succeeded # ----------------------------------------------------- # Monitors # ----------------------------------------------------- source = $HOME/.config/hypr/sections/monitors.conf # ----------------------------------------------------- # Inputs # ----------------------------------------------------- source = $HOME/.config/hypr/sections/inputs.conf # ----------------------------------------------------- # Keybinds # ----------------------------------------------------- source = $HOME/.config/hypr/sections/keybinds.conf # ----------------------------------------------------- # Environment Variables # ----------------------------------------------------- source = $HOME/.config/hypr/sections/env.conf # ----------------------------------------------------- # Window Rules # ----------------------------------------------------- source = $HOME/.config/hypr/sections/window_rules.conf # ----------------------------------------------------- # Behaviour Rules # ----------------------------------------------------- source = $HOME/.config/hypr/sections/behaviours.conf # ----------------------------------------------------- # Tiling Rules # ----------------------------------------------------- source = $HOME/.config/hypr/sections/tiling.conf # ----------------------------------------------------- # Aesthetics # ----------------------------------------------------- source = $HOME/.config/hypr/sections/aesthetics.conf # ----------------------------------------------------- # Autostart # ----------------------------------------------------- source = $HOME/.config/hypr/sections/autostart.conf Config File: /home/bluewy/.config/hypr/sections/monitors.conf: Read Succeeded monitor = DP-2, 1920x1080@239.964, 0x0, 1 misc { vfr = on vrr = 2 } general { allow_tearing = true } Config File: /home/bluewy/.config/hypr/sections/inputs.conf: Read Succeeded # ----------------------------------------------------- # Keyboard # ----------------------------------------------------- input { kb_layout = bluewy kb_options = grp:win_space_toggle } # ----------------------------------------------------- # Mouse # ----------------------------------------------------- device { name = steelseries-steelseries-rival-3 sensitivity = -0.5 accel_profile = flat } Config File: /home/bluewy/.config/hypr/sections/keybinds.conf: Read Succeeded # ----------------------------------------------------- # Main Keybinds # ----------------------------------------------------- bind = SUPER, 1, focusworkspaceoncurrentmonitor, 1 bind = SUPER, 2, focusworkspaceoncurrentmonitor, 2 bind = SUPER, 3, focusworkspaceoncurrentmonitor, 3 bind = SUPER, 4, focusworkspaceoncurrentmonitor, 4 bind = SUPER, 8, focusworkspaceoncurrentmonitor, 8 bind = SUPER, 9, focusworkspaceoncurrentmonitor, 9 bind = SUPER, 0, focusworkspaceoncurrentmonitor, 10 bind = SUPER + SHIFT, 1, movetoworkspace, 1 bind = SUPER + SHIFT, 2, movetoworkspace, 2 bind = SUPER + SHIFT, 3, movetoworkspace, 3 bind = SUPER + SHIFT, 4, movetoworkspace, 4 bind = SUPER + SHIFT, 8, movetoworkspace, 8 bind = SUPER + SHIFT, 9, movetoworkspace, 9 bind = SUPER + SHIFT, 0, movetoworkspace, 10 bind = SUPER, Left, movefocus, l bind = SUPER, Right, movefocus, r bind = SUPER, Up, movefocus, u bind = SUPER, Down, movefocus, d bind = SUPER, N, movefocus, l bind = SUPER, I, movefocus, r bind = SUPER, U, movefocus, u bind = SUPER, E, movefocus, d bind = SUPER + SHIFT, Left, movewindoworgroup, l bind = SUPER + SHIFT, Right, movewindoworgroup, r bind = SUPER + SHIFT, Up, movewindoworgroup, u bind = SUPER + SHIFT, Down, movewindoworgroup, d bind = SUPER + SHIFT, N, movewindoworgroup, l bind = SUPER + SHIFT, I, movewindoworgroup, r bind = SUPER + SHIFT, U, movewindoworgroup, u bind = SUPER + SHIFT, E, movewindoworgroup, d bind = SUPER, B, togglefloating, bind = SUPER, S, togglesplit, bind = SUPER, G, togglegroup bind = SUPER, K, lockgroups, toggle bind = SUPER, period, changegroupactive bind = SUPER, H, changegroupactive, b bind = SUPER, M, fullscreen, 1 bind = SUPER, Q, fakefullscreen bind = SUPER, F, fullscreen bindm = SUPER, mouse:272, movewindow bindm = SUPER, mouse:273, resizewindow bind = SUPER + SHIFT, Escape, exit bind = SUPER, X, killactive # ----------------------------------------------------- # Other Keybinds # ----------------------------------------------------- bind = SUPER, L, exec, wezterm bind = SUPER, Y, exec, fuzzel bind = SUPER, D, exec, nwg-dock-hyprland -mb 16 bind = SUPER, P, exec, grimblast --notify copysave output bind = SUPER, V, exec, cliphist list | fuzzel --dmenu | cliphist decode | wl-copy bind = SUPER, O, exec, $HOME/.config/fuzzel/scripts/hyprland/show_quick_options.fish bind = SUPER, C, exec, $HOME/.config/hypr/scripts/hyprpicker/get_color_hex.fish bind = SUPER, TAB, exec, $HOME/.config/fuzzel/scripts/hyprland/show_available_windows.fish # Make it possible to use with only the left hand side. bind = ALT, TAB, exec, $HOME/.config/fuzzel/scripts/hyprland/show_available_windows.fish # ----------------------------------------------------- # Laptop Specific # ----------------------------------------------------- # screen brightness bind = , XF86MonBrightnessUp, exec, brightnessctl s +5% bind = , XF86MonBrightnessDown, exec, brightnessctl s 5%- # keyboard brightness bind = , xf86KbdBrightnessUp, exec, brightnessctl -d *::kbd_backlight set +33% bind = , xf86KbdBrightnessDown, exec, brightnessctl -d *::kbd_backlight set 33%- # volume and media control bind = , XF86AudioRaiseVolume, exec, pamixer -i 5 bind = , XF86AudioLowerVolume, exec, pamixer -d 5 bind = , XF86AudioMicMute, exec, pamixer --default-source -m bind = , XF86AudioMute, exec, pamixer -t bind = , XF86AudioPlay, exec, playerctl play-pause bind = , XF86AudioPause, exec, playerctl play-pause bind = , XF86AudioNext, exec, playerctl next bind = , XF86AudioPrev, exec, playerctl previous Config File: /home/bluewy/.config/hypr/sections/env.conf: Read Succeeded env = XDG_CURRENT_DESKTOP, Hyprland env = XDG_SESSION_DESKTOP, Hyprland env = XDG_SESSION_TYPE, wayland env = XDG_CONFIG_HOME, $HOME/.config env = XDG_DATA_HOME, $HOME/.local/share env = XDG_STATE_HOME, $HOME/.local/state env = XDG_CACHE_HOME, $HOME/.cache env = PATH, $PATH:$HOME/.local/bin:$HOME/.cargo/bin # wayland stuff env = SDL_VIDEODRIVER, wayland env = CLUTTER_BACKEND, wayland env = GDK_BACKEND, wayland,x11 env = QT_QPA_PLATFORM, wayland;xcb # more wayland stuff but from other sources env = WAYLAND, 1 env = MOZ_DBUS_REMOTE, 1 env = MOZ_ENABLE_WAYLAND, 1 env = _JAVA_AWT_WM_NONREPARENTING, 1 env = BEMENU_BACKEND, wayland env = ECORE_EVAS_ENGINE, wayland_egl env = ELM_ENGINE, wayland_egl # enable tearing support for hyprland env = WLR_DRM_NO_ATOMIC, 1 env = EDITOR, nvim # Manage sensitive information with kwallet. env = GIT_ASKPASS, /usr/bin/ksshaskpass env = SSH_ASKPASS, /usr/bin/ksshaskpass env = SSH_ASKPASS_REQUIRE, prefer # GTK stuff env = GTK_THEME, Sweet-Dark # QT stuff env = QT_QPA_PLATFORMTHEME, qt6ct env = QT_WAYLAND_DISABLE_WINDOWDECORATION, 1 # pointer env = XCURSOR_THEME, Bibata-Modern-Classic Config File: /home/bluewy/.config/hypr/sections/window_rules.conf: Read Succeeded layerrule = blur, launcher layerrule = blur, waybar layerrule = blur, gtk-layer-shell layerrule = blur, nwg-dock windowrulev2 = idleinhibit fullscreen, class:^(.*)$ # Improve responsiveness for all applications with exceptions. # example of how the regular expression might look like -> class:^(?!LibreWolf$|Firefox$).*$ windowrulev2 = immediate, class:^(?!LibreWolf$).*$ # Disable potentially annoying requests with exceptions. windowrulev2 = suppressevent fullscreen, class:^(?!LibreWolf$).*$ windowrulev2 = suppressevent maximize, class:^(.*)$ windowrulev2 = suppressevent activate, class:^(.*)$ windowrulev2 = suppressevent activatefocus, class:^(.*)$ # Make jetbrains applications less buggy. windowrulev2 = noinitialfocus, class:^(jetbrains-.*)$, title:^(win.*)$ windowrulev2 = windowdance, class:^(jetbrains-.*)$ # Attempt to make steam less buggy # windowrulev2 = noinitialfocus, class:^(steam)$ # windowrulev2 = windowdance, class:^(steam)$ layerrule = animation slide right, swaync-control-center layerrule = animation slide left, waybar layerrule = animation slide bottom, nwg-dock Config File: /home/bluewy/.config/hypr/sections/behaviours.conf: Read Succeeded input { follow_mouse = 2 mouse_refocus = false float_switch_override_focus = 0 } gestures { workspace_swipe = true workspace_swipe_fingers = 3 } misc { key_press_enables_dpms = true new_window_takes_over_fullscreen = 2 disable_hyprland_logo = true # remember that any child window will open at the workspace where the parent window is initial_workspace_tracking = 2 } xwayland { force_zero_scaling = true } Config File: /home/bluewy/.config/hypr/sections/tiling.conf: Read Succeeded general { layout = dwindle } dwindle { pseudotile = yes preserve_split = yes } Config File: /home/bluewy/.config/hypr/sections/aesthetics.conf: Read Succeeded # ----------------------------------------------------- # Visuals # ----------------------------------------------------- general { gaps_in = 8 gaps_out = 16 border_size = 3 col.active_border = rgba(E06C75ff) # red col.inactive_border = 0xff5c6370 # grey } group { col.border_active = rgba(98C379CC) # green col.border_inactive = rgba(c678ddff) # grey col.border_locked_active = rgba(E06C75ff) # red col.border_locked_inactive = rgba(c678ddff) # grey groupbar { enabled = false gradients = false text_color = 0xffabb2bf font_size = 10 col.active = rgba(98C379CC) # green col.inactive = rgba(d19a66ff) # orange col.locked_active = rgba(e06c75ff) # red col.locked_inactive = rgba(d19a66ff) # orange render_titles = false } } decoration { blur { size = 7 passes = 2 } rounding = 4 drop_shadow = false } # ----------------------------------------------------- # Animations # ----------------------------------------------------- animations { enabled = yes bezier = easeOutQuart, 0.165, 0.84, 0.44, 1 animation = workspaces, 1, 7, easeOutQuart, slidevert animation = fade, 0 animation = windows, 1, 7, easeOutQuart, popin 0% animation = layers, 1, 7, easeOutQuart, popin 0% } Config File: /home/bluewy/.config/hypr/sections/autostart.conf: Read Succeeded # Make systemd aware of the specified environment variables. exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP exec-once = systemctl --user import-environment QT_QPA_PLATFORMTHEME # Use preferred privilage elevation tool. exec-once = /usr/lib/polkit-kde-authentication-agent-1 # Use portals for additional features. exec-once = systemctl start --user xdg-desktop-portal-hyprland exec-once = systemctl start --user xdg-desktop-portal-gtk # Use preferred wayland status bar. exec-once = waybar # Listen for user absence. exec-once = hypridle # Display notifications. exec-once = swaync # Record notifications history. exec-once = bash $HOME/.config/hypr/scripts/log_notifications.sh $XDG_DATA_HOME/notify.log # Set background wallpaper. exec-once = hyprpaper # Enable clipboard capabilities. exec-once = wl-paste --type text --watch cliphist store # stores only text data exec-once = wl-paste --type image --watch cliphist store # stores only image data # Start sensitive information manager. exec-once = /usr/lib/pam_kwallet_init # Prevent idle during sound playback. exec-once = wayland-pipewire-idle-inhibit ======Config-End======== ```

Bug or Regression?

Bug

Description

Running a game through XWayland (proton-ge/wine-ge) and then switching to another XWayland window will cause the game window to be black. Happens with games like: metro exodus, overwatch, green hell and likely many more (Some games like among us was not affected). If you switch to a Wayland window then it works as expected and the game does not turn to a black window.

How to reproduce

  1. Run a game that uses XWayland.
  2. Switch to another XWayland window.
  3. Switch back to the game.

Crash reports, logs, images, videos

2024-06-08T21:13:21,732537189+02:00 2024-06-08T21:13:30,637138689+02:00 2024-06-08T21:13:33,548210467+02:00

BluewyDiamond commented 4 months ago

Last good commit: a7120743 Bad commit: addd3e7f

BluewyDiamond commented 4 months ago

@vaxerski help me pls i can't play with a black game window

BluewyDiamond commented 4 months ago

My bad, I closed it because I thought it was working correctly, but I was actually running the last good commit so I reopened it.

JonathanSteininger commented 4 months ago

I have noticed that when running games through proton it black screens the game. And when running the game through wine it just freezes the last frame.

You can run games fine if you make wine run in wayland mode which is highly experimental. (mileage may vary)

You can also wrap your games in gamescope, but that has its own set of problems. eg. closing gamescope with a bind will not kill the wineserver/game causing weird behavior like failing to start the game the next time.

vaxerski commented 4 months ago

can you post the output of xprop when clicking on the game when it's frozen?

BluewyDiamond commented 4 months ago

lethal_company.txt

BluewyDiamond commented 4 months ago

overwatch.txt

BluewyDiamond commented 4 months ago

and an example not using steam just in case metro.txt @vaxerski

JonathanSteininger commented 4 months ago

I have also noticed this only happens when the games are fullscreened. When they are windowed they behave as expected.

These are some xprod outputs I have collected:

Fullscreen Wine

Noita_WINE.txt Hell_Is_Other_Demons_WINE.txt

Fullscreen Proton

Noita_PROTON.txt Hell_Is_Other_Demons_PROTON.txt

Same Games in Windowed (working)

This is xprod of the windowed version of each game. They were working when xprod was used. Noita_WINDOWED_WINE.txt Hell_Is_Other_Demons_WINDOWED_PROTON.txt

vaxerski commented 4 months ago

can you also get an xprop from sway or something to compare it to a working one?

BluewyDiamond commented 4 months ago

using hyprland last good commit: overwatch_last_good.txt metro_last_good.txt lethal_company_last_good.txt

JonathanSteininger commented 4 months ago

xprop output from sway. Both are working as expected.

Noita on proton

Noita_SWAY_PROTON.txt

Hell Is Other Demons on wine

Hell_Is_Other_Demson_SWAY_WINE.txt

vaxerski commented 4 months ago

hm, there are a few slight differences, but none that should matter... dunno what's up...

BluewyDiamond commented 4 months ago

:(

vaxerski commented 4 months ago

feel free to tinker with the x props and other stuff, if there is something found that's obviously wrong that might be a lead.

BluewyDiamond commented 4 months ago

When lethal company turns black it shows this decorations, does this indicate something useful? image

Agent00Ming commented 4 months ago

that looks like the game is attempting to minimize itself when it loses focus

BluewyDiamond commented 4 months ago

that is interesting, i wonder what did the commit change for the game to attempt to do so? i can't really figure it out myself since i don't know c++ :(

BluewyDiamond commented 4 months ago

@JonathanSteininger what are your system specs?

BluewyDiamond commented 4 months ago

the last commit 2566d81 just made it worse for me, now it turns black when unfocused

BluewyDiamond commented 4 months ago

I have also noticed this only happens when the games are fullscreened. When they are windowed they behave as expected.

this is also true on my side

BluewyDiamond commented 4 months ago

@vaxerski can I get code to to make xwayland full screen windows believe it has not lost focus to try it out?

vaxerski commented 4 months ago

that looks like the game is attempting to minimize itself when it loses focus

Used to be the case, but we forcefully un-minimize it... Maybe that's broken? Though the state is NORMAL and not iconic

can I get code to to make xwayland full screen windows believe it has not lost focus to try it out?

sure patch.txt

BluewyDiamond commented 4 months ago

looks like my intuition was wrong, it still has the same behavior with the patch

Used to be the case, but we forcefully un-minimize it... Maybe that's broken? Though the state is NORMAL and not >iconic

is there other ways to un-minize it? ill try any code changes to try to fix this

vaxerski commented 4 months ago

don't think so, afaik the only hint for minimizing is the ICONIC icccm state

JonathanSteininger commented 4 months ago

@JonathanSteininger what are your system specs?

System Specs ``` cpu: Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz, 1269 MHz graphics card: ATI Vega 20 [Radeon VII] Hyprland, built from branch at commit ea2501d4556f84d3de86a4ae2f4b22a474555b9f (props: bump version to 0.41.0). Date: Mon Jun 10 14:23:06 2024 Tag: v0.41.0, commits: 4794 flags: (if any) System Information: System name: Linux Node name: bigboi-arch Release: 6.9.4-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Wed, 12 Jun 2024 20:17:17 +0000 GPU information: 07:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Vega 20 [Radeon VII] [1002:66af] (rev c1) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ```
UjinT34 commented 4 months ago

the last commit 2566d81 just made it worse for me, now it turns black when unfocused

Looks like before this commit xwayland windows received unfocus events only after focusing another xwayland window. With this commit those events are sent even if you switch to an empty workspace. The black screen issue might be limited to wine/proton apps. Doesn't happen with linux native Oxygen Not Included on xwayland. It clearly has the same unfocus behaviour as other xwayland apps because main menu music stops only after focusing other xwayland window without https://github.com/hyprwm/Hyprland/commit/2566d818848b58b114071f199ffe944609376270 and after any switch with that commit. But works fine after switching back to the game.

UjinT34 commented 4 months ago

This issue has something to do with this line

https://github.com/hyprwm/Hyprland/blob/d1340bd1d8eedd274283e0cb2568a3ed67b58c81/src/xwayland/XWM.cpp#L425

Without it there is no black window issue. But xwayland windows no longer receive kb input, mouse works fine.

BluewyDiamond commented 4 months ago

This issue has something to do with this line

https://github.com/hyprwm/Hyprland/blob/d1340bd1d8eedd274283e0cb2568a3ed67b58c81/src/xwayland/XWM.cpp#L425

Without it there is no black window issue. But xwayland windows no longer receive kb input, mouse works fine.

@vaxerski we might have a lead

vaxerski commented 4 months ago

patch.txt try this

BluewyDiamond commented 4 months ago

patch.txt try this

doesn't fix it for me

UjinT34 commented 4 months ago

patch.txt try this

Doesn't fix for me. I am not sure that this is the same bug as https://github.com/hyprwm/Hyprland/issues/6570. I have no issues in windowed mode.

Detroit Become Human turns black only in exclusive fullscreen mode. Borderless fullscreen works fine. Noita turns black in both modes: fullscreen (windowed) and fullscreen (real). Noita's windowed mode works as borderless fullscreen and doesn't have this issue. Oxygen Not Included doesn't have this issue. Both native linux and proton. But it seems it only has a borderless fullscreen mode.

Since it happens only in fullscreen it is hard to tell when those game actually break. Detroit stops playing sound as soon as I switch to other workspace in exclusive fullscreen. And it keeps playing sounds in borderless fullscreen. So I assume the issue happens on kb focus out.

BluewyDiamond commented 4 months ago

patch.txt try this

Doesn't fix for me. I am not sure that this is the same bug as #6570. I have no issues in windowed mode.

Detroit Become Human turns black only in exclusive fullscreen mode. Borderless fullscreen works fine. Noita turns black in both modes: fullscreen (windowed) and fullscreen (real). Noita's windowed mode works as borderless fullscreen and doesn't have this issue. Oxygen Not Included doesn't have this issue. Both native linux and proton. But it seems it only has a borderless fullscreen mode.

Since it happens only in fullscreen it is hard to tell when those game actually break. Detroit stops playing sound as soon as I switch to other workspace in exclusive fullscreen. And it keeps playing sounds in borderless fullscreen. So I assume the issue happens on kb focus out.

sounds like it is same issue

BluewyDiamond commented 4 months ago

@vaxerski the patch did not fix it for us is there any more code that we can try out?

vaxerski commented 4 months ago

not rn, you know I have other things to do too. I'll take a look later, though I dont have a lot of idea why this happens.

a-usr commented 4 months ago

Not sure wether its helpful, but I'll add my sauce anyways: For me most games running through proton have been running just fine, Im only experiencing a weird issue where proton windows in fullscreen turn into non-fullscreen windows with no output (black window content) whenever the window isn't visible for some time (like 1 min or so).

Not sure which commit I'm on, I'd have to check when I get home, but I'm using a nvidia 3060 with proprietary drivers on nixos

Edit: Up until now i was on ea2501d, but I'll update and see what changes

drakkein commented 4 months ago

I can confirm that this issue is related to losing focus of the window. Logs from the xev. While launching second xwayland window the monitored window received FocusOut, while never gaining it back.

LeaveNotify event, serial 24, synthetic NO, window 0x1200001,
    root 0x3a7, subw 0x1000035, time 69599041, (3435,649), root:(9195,649),
    mode NotifyNormal, detail NotifyVirtual, same_screen YES,
    focus YES, state 24

FocusOut event, serial 24, synthetic NO, window 0x1200001,
    mode NotifyNormal, detail NotifyNonlinear

PropertyNotify event, serial 24, synthetic NO, window 0x1200001,
    atom 0x130 (_NET_WM_STATE), time 69615994, state PropertyNewValue

EnterNotify event, serial 24, synthetic NO, window 0x1200001,
    root 0x3a7, subw 0x1000035, time 69615996, (3435,649), root:(9195,649),
    mode NotifyNormal, detail NotifyVirtual, same_screen YES,
    focus NO, state 16

I tried to regain focus via xdotool but to no avail.

vaxerski commented 4 months ago

how tf do I send a focusin event in x

UjinT34 commented 4 months ago

how tf do I send a focusin event in x

From xproto.h docs for xcb_set_input_focus "A FocusIn and FocusOut event is generated when focus is changed." So those events should be generated by the current code. And I believe that FocusOut causes this issue. Without xcb_set_input_focus there is no black window issue... but also no kb input.

drakkein commented 4 months ago

Got some more captures for correct behavior in this example borderless window

LeaveNotify event, serial 21, synthetic NO, window 0x2200001,
    root 0x3a7, subw 0x2000035, time 23437979, (-4025,1009), root:(1735,1009),
    mode NotifyNormal, detail NotifyVirtual, same_screen YES,
    focus YES, state 16

PropertyNotify event, serial 21, synthetic NO, window 0x2200001,
    atom 0x130 (_NET_WM_STATE), time 23438358, state PropertyNewValue

FocusOut event, serial 21, synthetic NO, window 0x2200001,
    mode NotifyNormal, detail NotifyNonlinear

PropertyNotify event, serial 21, synthetic NO, window 0x2200001,
    atom 0x130 (_NET_WM_STATE), time 23457141, state PropertyNewValue

PropertyNotify event, serial 21, synthetic NO, window 0x2200001,
    atom 0x130 (_NET_WM_STATE), time 23457141, state PropertyNewValue

EnterNotify event, serial 21, synthetic NO, window 0x2200001,
    root 0x3a7, subw 0x2000035, time 23457142, (0,678), root:(5760,678),
    mode NotifyNormal, detail NotifyVirtual, same_screen YES,
    focus YES, state 16

KeymapNotify event, serial 21, synthetic NO, window 0x0,
    keys:  48  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

MotionNotify event, serial 21, synthetic NO, window 0x2200001,
    root 0x3a7, subw 0x2000035, time 23457142, (0,678), root:(5760,678),
    state 0x10, is_hint 0, same_screen YES

MotionNotify event, serial 21, synthetic NO, window 0x2200001,
    root 0x3a7, subw 0x2000035, time 23457142, (0,678), root:(5760,678),
    state 0x10, is_hint 0, same_screen YES

PropertyNotify event, serial 21, synthetic NO, window 0x2200001,
    atom 0x28 (WM_NORMAL_HINTS), time 23457149, state PropertyNewValue

PropertyNotify event, serial 21, synthetic NO, window 0x2200001,
    atom 0x141 (_MOTIF_WM_HINTS), time 23457149, state PropertyNewValue

FocusOut event, serial 21, synthetic NO, window 0x2200001,
    mode NotifyNormal, detail NotifyPointer

FocusIn event, serial 21, synthetic NO, window 0x2200001,
    mode NotifyNormal, detail NotifyNonlinear

KeymapNotify event, serial 21, synthetic NO, window 0x0,
    keys:  40  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
vaxerski commented 4 months ago

patch.txt maybe this?

BluewyDiamond commented 4 months ago

patch.txt maybe this?

doesn't fix it for me

drakkein commented 4 months ago

In my case it made it even worse. Now it freezes when I focus any other window

BluewyDiamond commented 4 months ago

any updates? the bug is inconvenient when playing games that only support fullscreen :(

vaxerski commented 4 months ago

Not until either someone shows the line at fault or #6608 is done, I am busy with that MR atm.

bubba-champion commented 4 months ago

any updates? the bug is inconvenient when playing games that only support fullscreen :(

As a temporary workaround, you can revert https://github.com/hyprwm/Hyprland/commit/2566d818848b58b114071f199ffe944609376270 (git revert --no-commit 2566d818848b58b114071f199ffe944609376270), but when switching to another XWayland window, the game window will still break

vaxerski commented 4 months ago

any small, free game / app that can be tested?

FWIW, I've launched:

None turned black.

BluewyDiamond commented 4 months ago

overwatch + fullscreen + protonge/winege

vaxerski commented 4 months ago

image

BluewyDiamond commented 4 months ago

edit: pico park: classic edition + fullscreen + protonge/winege