Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Some XWayland windows start floating

Open Ghosthree3 opened this issue 1 year ago • 1 comments

Already reported ? *

  • [X] I have searched the existing open and closed issues.

Regression?

No

System Info and Version

System/Version info
Hyprland, built from branch main at commit 73b9756b8d7ee06fc1c9f072f2a41f2dd1aeb2c9 dirty (xwayland: remove extra x11 deactivation (7755)).
Date: Thu Sep 12 19:15:01 2024
Tag: v0.43.0-18-g73b9756b, commits: 5214

flags: (if any)


System Information:
System name: Linux
Node name: milkbar
Release: 6.10.9-arch1-2
Version: #1 SMP PREEMPT_DYNAMIC Tue, 10 Sep 2024 14:37:32 +0000


GPU information: 
0b: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])
0c:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU104 [GeForce RTX 2070 SUPER] [10de:1e84] (rev a1) (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:

======Config-Start======


Config File: /home/ghost/.config/hypr/hyprland.conf: Read Succeeded
# Hyprland config file

# Environmental variables
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = XDG_CURRENT_DESKTOP,Hyprland
env = GDK_BACKEND,wayland,x11
env = QT_QPA_PLATFORM,wayland;xcb
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = QT_QPA_PLATFORMTHEME,qt6ct
#env = SDL_VIDEODRIVER,x11
env = CLUTTER_BACKEND,wayland
env = MOZ_ENABLE_WAYLAND,1
env = ECORE_EVAS_ENGINE,wayland_egl
env = ELM_ENGINE,wayland_egl
env = _JAVA_AWT_WM_NONREPARENTING,1
env = NO_AT_BRIDGE,1
env = XCURSOR_SIZE,24
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

#monitor = DP-1, 1920x1080@144, 1440x0  , 1
#monitor = DP-2, 1440x900@60  , 0x340   , 1
monitor = DP-1, 1920x1080@144, 1920x0  , 1
monitor = DP-2, 1920x1080@60 , 0x100   , 1
monitor = DP-3, 1440x900@60  , 3840x320, 1

# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf

# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
    kb_layout = us
    kb_variant =
    kb_model =
    kb_options =
    kb_rules =
    numlock_by_default = true

    follow_mouse = 1

    touchpad {
        natural_scroll = false
    }

    sensitivity = -0.75 # -1.0 - 1.0, 0 means no modification.
}

general {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    border_size = 0
    gaps_in = 0
    gaps_out = 0
    col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.inactive_border = rgba(595959aa)

    layout = dwindle
}

decoration {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    rounding = 0

    blur {
        enabled = false
        #size = 3
        #passes = 1
    }

    drop_shadow = false
    #shadow_range = 4
    #shadow_render_power = 3
    #col.shadow = rgba(1a1a1aee)
}

animations {
    enabled = false

    # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more

    bezier = myBezier, 0.05, 0.9, 0.1, 1.05

    animation = windows, 1, 7, myBezier
    animation = windowsOut, 1, 7, default, popin 80%
    animation = border, 1, 10, default
    animation = borderangle, 1, 8, default
    animation = fade, 1, 7, default
    animation = workspaces, 1, 6, default
}

dwindle {
    # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
    pseudotile = true # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = true # you probably want this
}

master {
    # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
    new_status = master
}

gestures {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more
    workspace_swipe = false
}

misc {
    force_default_wallpaper = 0
}

binds {
    movefocus_cycles_fullscreen = false
}

# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
#device:epic-mouse-v1 {
#    sensitivity = -0.5
#}

# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = opacity 0.0 override,class:^(xwaylandvideobridge)$
windowrulev2 = noanim,class:^(xwaylandvideobridge)$
windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$
windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$
windowrulev2 = noblur,class:^(xwaylandvideobridge)$

windowrulev2 = renderunfocused,class:^(looking-glass-client)$

# See https://wiki.hyprland.org/Configuring/Keywords/ for more
$mainMod = SUPER

# Workspace Bindings
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
bind = $mainMod, KP_End, workspace, 11
bind = $mainMod, KP_Down, workspace, 12
bind = $mainMod, KP_Next, workspace, 13
bind = $mainMod, KP_Left, workspace, 14
bind = $mainMod, KP_Begin, workspace, 15
bind = $mainMod, KP_Right, workspace, 16
bind = $mainMod, KP_Home, workspace, 17
bind = $mainMod, KP_Up, workspace, 18
bind = $mainMod, KP_Prior, workspace, 19
bind = $mainMod, KP_Insert, workspace, 20

bind = $mainMod SHIFT ALT, left, movecurrentworkspacetomonitor, l
bind = $mainMod SHIFT ALT, right, movecurrentworkspacetomonitor, r
bind = $mainMod SHIFT ALT, up, movecurrentworkspacetomonitor, u
bind = $mainMod SHIFT ALT, down, movecurrentworkspacetomonitor, d

bind = $mainMod, mouse_down, workspace, e-1
bind = $mainMod, mouse_up, workspace, e+1

# Window Bindings
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
bind = $mainMod SHIFT, KP_End, movetoworkspace, 11
bind = $mainMod SHIFT, KP_Down, movetoworkspace, 12
bind = $mainMod SHIFT, KP_Next, movetoworkspace, 13
bind = $mainMod SHIFT, KP_Left, movetoworkspace, 14
bind = $mainMod SHIFT, KP_Begin, movetoworkspace, 15
bind = $mainMod SHIFT, KP_Right, movetoworkspace, 16
bind = $mainMod SHIFT, KP_Home, movetoworkspace, 17
bind = $mainMod SHIFT, KP_Up, movetoworkspace, 18
bind = $mainMod SHIFT, KP_Prior, movetoworkspace, 19
bind = $mainMod SHIFT, KP_Insert, movetoworkspace, 20

bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d
bind = $mainMod SHIFT, left, movewindow, l
bind = $mainMod SHIFT, right, movewindow, r
bind = $mainMod SHIFT, up, movewindow, u
bind = $mainMod SHIFT, down, movewindow, d

bind = $mainMod, R, submap, resize
submap = resize
binde = SHIFT, left, resizeactive, -10 0
binde = SHIFT, right, resizeactive, 10 0
binde = SHIFT, up, resizeactive, 0 -10
binde = SHIFT, down, resizeactive, 0 10
binde = , left, resizeactive, -5 0
binde = , right, resizeactive, 5 0
binde = , up, resizeactive, 0 -5
binde = , down, resizeactive, 0 5
binde = ALT, left, resizeactive, -1 0
binde = ALT, right, resizeactive, 1 0
binde = ALT, up, resizeactive, 0 -1
binde = ALT, down, resizeactive, 0 1
bind = , escape, submap, reset
submap = reset

bind = $mainMod SHIFT, Q, killactive
bind = $mainMod, F, fullscreen
bind = $mainMod, E, togglesplit # dwindle
bind = $mainMod, P, pseudo # dwindle
bind = $mainMod SHIFT, SPACE, togglefloating

bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

# Media Bindings
binde = , XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +5% #increase sound volume
binde = , XF86AudioLowerVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ -5% #decrease sound volume
bind = , XF86AudioMute, exec, pactl set-sink-mute @DEFAULT_SINK@ toggle # mute sound
bind = , XF86AudioPlay, exec, playerctl play
bind = , XF86AudioPause, exec, playerctl pause
bind = , XF86AudioNext, exec, playerctl next
bind = , XF86AudioPrev, exec, playerctl previous

# Program Bindings
bind = $mainMod, Return, exec, kitty
bind = $mainMod, D, exec, kickoff
#bind = $mainMod, D, exec, tofi-run | xargs hyprctl dispatch exec
bind = $mainMod SHIFT, M, exit
bind = , PRINT, exec, hyprshot -m region -o /tmp -f $(date +%s%3N).png
bind = ALT, PRINT, exec, hyprshot -m window -o /tmp -f $(date +%s%3N).png
bind = $mainMod, PRINT, exec, hyprshot -m output -o /tmp -f $(date +%s%3N).png

# Global Hotkeys
#bindn = , Control_L, pass, ^(discord)$
bindn = , F10, pass, ^(com\.obsproject\.Studio)$

# Startup Programs
exec-once = /usr/lib/polkit-kde-authentication-agent-1
exec-once = xwaylandvideobridge
exec-once = mako
exec-once = waybar
exec-once = easyeffects --gapplication-service
exec-once = sleep 3 && keepassxc
exec-once = [workspace 1 silent] librewolf
exec-once = [workspace 9 silent] brave
exec-once = [workspace 7 silent] discord
exec-once = [workspace 3 silent] kitty
exec-once = [workspace 8 silent] kitty
exec-once = pactl set-sink-volume @DEFAULT_SINK@ 85%
exec-once = pactl set-sink-volume easyeffects_sink 100%
exec-once = pactl set-source-volume @DEFAULT_SOURCE@ 85%
exec-once = pactl set-source-volume easyeffects_source 100%
exec-once = send-ctrl-to-xwayland /dev/input/by-id/usb-04d9_USB_Keyboard-event-kbd

# Hacks
#windowrulev2 = nomaximizerequest,class:(mpv)

======Config-End========

Description

This is a very, very long standing issue that predates the rewrites, probably started happening around a year ago.

Some XWayland windows when started under Hyprland will always start in floating mode, for no apparent reason. It's been so long that it's hard for me to tell if this is some sort of feature that I've failed to configure properly for, but it's not universal. It's as if Hyprland believes for some reason that they should be a floating type window, like the file picker/upload dialog windows, but they shouldn't.

I've encountered it frequently with many different windows over the last year, often with game or game adjacent windows, but for a quick example, Kitty when opened under X11 mode will float, Chromium browsers will tile. (I can provide more examples if necessary).

I apologize if this has in fact been reported before, but I couldn't find this exact issue anywhere, the closest I found was #6568 which blames the rewrite. Perhaps the rewrite shifted or inflated the issue, but I'm certain it long predates it.

How to reproduce

Can easily be demonstrated by opening a fresh Kitty terminal normally under Wayland, then opening an X11 copy from within that same terminal using kitty -o linux_display_server=x11. The size will vary and usually have some sort of memory, but the window will usually open floating near the top left of the output.

Crash reports, logs, images, videos

No response

Ghosthree3 avatar Sep 13 '24 02:09 Ghosthree3

Exact same thing here, for PWA/OWA chromium 'app', it was working perfectly before 0.44.

I am trying to play with rules on my exec bind, not successfully, had you find a way ?

2Belette avatar Oct 18 '24 15:10 2Belette

hmm true, my game xwayland game also happens to launch in floating instead of tile

EvilBoi123 avatar Nov 19 '24 07:11 EvilBoi123

This may have been fixed for me in the latest release 0.45.2. I will try a little more the games that were doing this but so far its looking like it was fixed.

Edit: Tested as much as I could and it appears to be fully gone for me. If it comes back I will write here but I am assuming the issue is fixed

Perfectio07 avatar Nov 20 '24 22:11 Perfectio07

Still got the same issue on 0.45.2 for PWA from Chromium 👎

2Belette avatar Nov 22 '24 12:11 2Belette

Issue still exists with the original repro example I gave with Kitty, as well as several other applications, so I don't think any recent changes fixed this issue specifically.

Ghosthree3 avatar Nov 22 '24 15:11 Ghosthree3

Issue still exists with the original repro example I gave with Kitty, as well as several other applications, so I don't think any recent changes fixed this issue specifically.

I was able to replicate your issue, so that is still around. That said all my games that were misbehaving and floating are not doing so anymore so I am not sure what is going on anymore. Best of luck to you and hope Vaxry fixes it quick.

Edit: nvm its back lol idk why it wasn't happening these past few days but it just happened

Perfectio07 avatar Nov 23 '24 14:11 Perfectio07

Another example is any Java SWT/Swing app, they all seem to open as floating XWayland windows.

b4shful avatar Dec 07 '24 19:12 b4shful

Exact same thing here, for PWA/OWA chromium 'app', it was working perfectly before 0.44.

I am trying to play with rules on my exec bind, not successfully, had you find a way ?

This fixes for me

windowrulev2 = tile, class:Microsoft-edge # your-browser-class

sohanemon avatar Dec 29 '24 11:12 sohanemon

Exact same thing here, for PWA/OWA chromium 'app', it was working perfectly before 0.44.

I am trying to play with rules on my exec bind, not successfully, had you find a way ?

This fixes for me

windowrulev2 = tile, class:Microsoft-edge # your-browser-class

Just to avoid any confusion when people are reading this: this is a workaround (via creating a window rule) but the bug being discussed here is that some XWayland apps are floating by default when they shouldn't be.

Also, I'd say that if you're using PWAs on Chromium, you should instead be making sure they're opening in native Wayland mode rather than XWayland anyways?

b4shful avatar Dec 29 '24 12:12 b4shful

I didn't know there is a way to force PWAs to be opened with native Wayland, do you know how to?

2Belette avatar Dec 29 '24 12:12 2Belette

I found the option in Chromium. After changing from Auto to Wayland the issue is not anymore an issue :)

Fun fact, if I go back to Auto after the change it is still working fine!

2Belette avatar Jan 02 '25 16:01 2Belette

I found the option in Chromium. After changing from Auto to Wayland the issue is not anymore an issue :)

Fun fact, if I go back to Auto after the change it is still working fine!

Likely what you did was similar to setting the flag --ozone-platform-hint=wayland, which is a common fix for Chromium/Electron apps defaulting to launching in XWayland instead of natively.

Also with regards to the second statement, I use Microsoft Edge for PWAs and it doesn't have the GUI config option to change ozone platform hint, so I have to add that command line flag to the .desktop entry of each PWA (as well as for Edge's desktop entry itself). Otherwise even if Edge opens in Wayland, PWAs will open in XWayland. Interestingly though, if you first open Edge successfully in Wayland mode, then PWAs will open in Wayland too without needing the command line flag. So that might be what you were encountering if this behaviour exists across different Chromium browsers.

However, apps opening in XWayland instead of native Wayland by default is not the topic of this bug report. This bug report is about apps which have purposely been run in XWayland strangely opening as floating for no reason.

NOTE TO MAINTAINERS/ANYONE LOOKING INTO FIXING THIS BUG:

I'm a bit concerned that this issue has been derailed by talk about PWAs and other things which are accidentally being opened in XWayland, and someone might look at this and see various "fixes" which are actually just addressing the root of the problem for PWA users (as in, they should be making sure their apps are opening in Wayland regardless) but not for anyone else who 100% needs to run something that only supports X11 in XWayland. Please keep in mind that many of the fixes being discussed here are not fixes for the actual bug in this report, thanks :)

b4shful avatar Jan 08 '25 20:01 b4shful

Hello there!

This issue has been closed, as we are moving from issues to discussions. More about this can be found here and in #9854.

Firstly, please make sure this issue is still relevant in latest Hyprland. If so, we ask you to open a discussion (please read the discussion guidelines first, in the pinned post)

Thank you for your understanding!

vaxerski avatar Apr 05 '25 19:04 vaxerski

Just for anyone that finds this, as I have several times: if you have basically all windows tiling by default and just want to stop some random XWayland windows floating, a quick workaround until this is fixed is: to add windowrule = tile, xwayland:1 to hyprland.conf.

josswright avatar Apr 06 '25 23:04 josswright

@josswright there is an issue with your workaround, for example in PWA , when the mouse-hover event listener displays a small dialog where the text is expanded, the content is display as new second window not as a small text globe or even the contextual menu.

https://github.com/user-attachments/assets/81d24ac7-7583-498e-ab90-c93c232d36a5

jahirmedinacs avatar Apr 29 '25 08:04 jahirmedinacs

@vaxerski Please reopen, it is not resolved.

mortezadadgar avatar Jul 01 '25 06:07 mortezadadgar