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.35k stars 898 forks source link

xwayland apps lose focus when inside element is being dragged by mouse. #8294

Open mobilex1122 opened 3 days ago

mobilex1122 commented 3 days ago

Already reported ? *

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 4520b30d498daca8079365bdb909a8dea38e8d55 (version: bump to 0.44.1). Date: Wed Oct 9 12:54:39 2024 Tag: v0.44.1, commits: 5309 built against aquamarine 0.4.2 flags: (if any) System Information: System name: Linux Node name: mainPC Release: 6.6.56-1-lts Version: #1 SMP PREEMPT_DYNAMIC Thu, 10 Oct 2024 12:04:53 +0000 GPU information: 03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 23 [Radeon RX 6600/6600 XT/6600M] [1002:73ff] (rev c7) (prog-if 00 [VGA controller]) os-release: NAME="EndeavourOS" PRETTY_NAME="EndeavourOS" ID="endeavouros" ID_LIKE="arch" BUILD_ID="2023.11.17" ANSI_COLOR="38;2;23;147;209" HOME_URL="https://endeavouros.com" DOCUMENTATION_URL="https://discovery.endeavouros.com" SUPPORT_URL="https://forum.endeavouros.com" BUG_REPORT_URL="https://forum.endeavouros.com/c/general-system/endeavouros-installation" PRIVACY_POLICY_URL="https://endeavouros.com/privacy-policy-2" LOGO="endeavouros" plugins: ======Config-Start====== Config File: /home/mobilex/.config/hypr/hyprland.conf: Read Succeeded ################ ### MONITORS ### ################ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,preferred,auto,1 # Custom monitor setup for my main computer monitor= desc:Lenovo Group Limited T22i-20 V9077BKV, prefered, -1920x0, 1 monitor= desc:Lenovo Group Limited T22i-20 V90A9G1P, prefered, 0x0, 1 ################### ### MY PROGRAMS ### ################### # See https://wiki.hyprland.org/Configuring/Keywords/ # Set programs that you use $terminal = kitty $fileManager = thunar #$menu = pgrep -x wofi > /dev/null || wofi -ani --show drun $menu = anyrun ################# ### AUTOSTART ### ################# # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: # exec-once = $terminal exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once=ags exec-once = nm-applet #exec-once = waybar exec-once = udiskie --tray exec-once = keepassxc exec-once = hyprpaper exec-once = hypridle #exec-once = dunst --startup_notification #exec-once = ~/.config/hypr/scripts/xdg-hypr.sh exec-once = ~/.config/hypr/scripts/autostart.sh exec-once = clipse -listen exec-once = quimup exec-once = webcord exec-once = solaar -w hide ############################# ### ENVIRONMENT VARIABLES ### ############################# # See https://wiki.hyprland.org/Configuring/Environment-variables/ env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 #env = XDG_CURRENT_DESKTOP,hyperland #env = AQ_DRM_DEVICES,/dev/dri/card2:/dev/dri/card1 ##################### ### LOOK AND FEEL ### ##################### # Refer to https://wiki.hyprland.org/Configuring/Variables/ # https://wiki.hyprland.org/Configuring/Variables/#general general { gaps_in = 5 gaps_out = 20 border_size = 2 # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors col.active_border = rgba(3DAEE9ff) rgba(f9207bff) 45deg col.inactive_border = rgba(595959aa) -360deg # Set to true enable resizing windows by clicking and dragging on borders and gaps resize_on_border = false # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false layout = dwindle allow_tearing = false } # https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { rounding = 5 # Change transparency of focused and unfocused windows active_opacity = 1 inactive_opacity = 1 dim_special= 0.4 drop_shadow = true shadow_range = 15 shadow_render_power = 3 col.shadow = rgba(00000055) # https://wiki.hyprland.org/Configuring/Variables/#blur blur { # Eats pereformance on lowend devices enabled = false size = 2 passes = 1 vibrancy = 2 popups = true special = true } } # https://wiki.hyprland.org/Configuring/Variables/#animations animations { enabled = true # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = easeOut, 0.11, 0.99, 0.46, 1 bezier = easeInOut, 0.8, 0, 0.2, 1 animation = windowsMove, 1, 4, easeOut animation = windowsIn, 1, 4, easeOut, popin 90% animation = windowsOut, 1, 4, easeOut, popin 90% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 4, easeOut, slidefade 10% animation = specialWorkspace, 1, 4, easeOut, slidefadevert 2% } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # You probably want this } # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { new_status = master } # https://wiki.hyprland.org/Configuring/Variables/#misc misc { force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( } ############# ### INPUT ### ############# # https://wiki.hyprland.org/Configuring/Variables/#input input { kb_layout = cz kb_variant = kb_model = kb_options = kb_rules = numlock_by_default = false # Badly broken repeat_delay = 250 repeat_rate = 35 follow_mouse = 1 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. touchpad { natural_scroll = true disable_while_typing = true scroll_factor = 0.6 middle_button_emulation = true } special_fallthrough = true tablet { output = DP-2 region_size = 1920 1080 } } # https://wiki.hyprland.org/Configuring/Variables/#gestures gestures { workspace_swipe = false } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more device { name = epic-mouse-v1 sensitivity = -0.5 } #################### ### KEYBINDINGSS ### #################### # See https://wiki.hyprland.org/Configuring/Keywords/ $mainMod = SUPER # Sets "Windows" key as main modifier # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Q, exec, $terminal bind = $mainMod, C, killactive, bind = $mainMod, M, exec, nwg-bar bind = $mainMod, A, exec, ags -r "sidebar()" bind = , XF86PowerOff, exec, nwg-bar bind = $mainMod, E, exec, $fileManager bind = $mainMod, R, exec, $menu bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle bind = $mainMod, F, togglefloating bind = $mainMod, F11, fullscreen bind = $mainMod, L, exec, loginctl lock-session # Move focus with mainMod + arrow keys 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 source = ~/.config/hypr/keymap/workspaces.conf # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, S bind = $mainMod SHIFT, S, movetoworkspace, special:S # Example special workspace (scratchpad) bind = $mainMod, D, togglespecialworkspace, D bind = $mainMod SHIFT, D, movetoworkspace, special:D # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow # Set/Mute Autio level binde = , XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 & wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ binde = , XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 & wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle # Requires playerctl bindl = , XF86AudioPlay, exec, playerctl play-pause bindl = , XF86AudioPrev, exec, playercl previous bindl = , XF86AudioNext, exec, playerctl next # Set Brightness (Small increments with Shift) bindl = , XF86MonBrightnessUp, exec, brightnessctl set +5% bindl = , XF86MonBrightnessDown, exec, brightnessctl set 5%- binde = Shift , XF86MonBrightnessUp, exec, brightnessctl set +10 binde = Shift , XF86MonBrightnessDown, exec, brightnessctl set 10- bindl = , Print, exec, hyprshot -z -m region bindl = CTRL, Print, exec, hyprshot -z -m output bindl = SHIFT, Print, exec, hyprshot -z -m window bind = $mainMod, V, exec, kitty --class clipse -e clipse bind = $mainMod SHIFT, P, exec, hyprpicker -a ############################## ### WINDOWS AND WORKSPACES ### ############################## # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. windowrulev2 = float, class:(wofi) windowrulev2 = pin, class:(wofi) windowrulev2 = stayfocused, class:(wofi) windowrulev2 = move 0 0, class:(nwg-bar) windowrulev2 = float, class:(clipse) windowrulev2 = size 622 652, class:(clipse) # Quimup Settings windowrulev2 = float, class:(Quimup) windowrulev2 = move 100%-w-25 60, title:(Quimup) windowrulev2 = size 1230 750, title:(Quimup Media Browser) windowrulev2 = move 100%-w-25 180, title:(Quimup Media Browser) windowrulev2 = size 650 750, title:(Quimup Settings) windowrulev2 = move 100%-w-25 180, title:(Quimup Settings) windowrulev2 = dimaround, class:(org.kde.kdialog) windowrulev2 = tile, class:(lite-xl) windowrulev2 = workspace special:D, class:(WebCord) windowrulev2 = float, class:(org.keepassxc.KeePassXC) windowrulev2 = size 1500 900, class:(org.keepassxc.KeePassXC) windowrulev2 = center 1, class:(org.keepassxc.KeePassXC) windowrulev2 = float, class:(com.defold.editor.Start) windowrulev2 = tile, class:(com.defold.editor.Start), title:^(.*Defold.*)$ # Does not work as expected workspace = 9,monitor:desc:Lenovo Group Limited T22i-20 V9077BKV,default:true workspace = special:S, gapsout:40 workspace = special:D, gapsout:40 layerrule = noanim, notifications layerrule = dimaround, overlay exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP Config File: /home/mobilex/.config/hypr/keymap/workspaces.conf: Read Succeeded ############################### ### ENGLISH WORKSPACE BINDS ### ############################### # Switch workspaces with mainMod + [0-9] 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 # Move active window to a workspace with mainMod + SHIFT + [0-9] 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 ############################### ### CZECH WORKSPACE BINDS ### ############################### # Hardcoded fix for czech keyboard # Switch workspaces with mainMod + [0-9] bind = $mainMod, plus, workspace, 1 bind = $mainMod, ecaron, workspace, 2 bind = $mainMod, scaron, workspace, 3 bind = $mainMod, ccaron, workspace, 4 bind = $mainMod, rcaron, workspace, 5 bind = $mainMod, zcaron, workspace, 6 bind = $mainMod, yacute, workspace, 7 bind = $mainMod, aacute, workspace, 8 bind = $mainMod, iacute, workspace, 9 bind = $mainMod, eacute, workspace, 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, plus, movetoworkspace, 1 bind = $mainMod SHIFT, ecaron, movetoworkspace, 2 bind = $mainMod SHIFT, scaron, movetoworkspace, 3 bind = $mainMod SHIFT, ccaron, movetoworkspace, 4 bind = $mainMod SHIFT, rcaron, movetoworkspace, 5 bind = $mainMod SHIFT, zcaron, movetoworkspace, 6 bind = $mainMod SHIFT, yacute, movetoworkspace, 7 bind = $mainMod SHIFT, aacute, movetoworkspace, 8 bind = $mainMod SHIFT, iacute, movetoworkspace, 9 bind = $mainMod SHIFT, eacute, movetoworkspace, 10 ======Config-End======== ```

Description

I noticed that when you have JavaFX app with a drag element (drag and drop) and you drag the element it unfocuses the window and cancels the drag. This seams to be bug from the Hyprland side as no other DE I tried had this issue.

How to reproduce

Crash reports, logs, images, videos

Example of dragging in Defold: https://github.com/user-attachments/assets/00e1a95a-8ce3-4743-8650-b14d95caab3d

mobilex1122 commented 2 days ago

Update: JavaFX creates additional window for the dragged element witch unconveniently is called java. So hyprland auto focuses on the java window witch deselects the main window.

Output of `hyprctl clients`* when dragging occurred ```sh Window 5a8723a022e0 -> mario - Defold 1.9.4: ## JavaFX Main App mapped: 1 hidden: 0 at: 22,57 size: 1876,1001 workspace: 2 (2) floating: 0 pseudo: 0 monitor: 0 class: com.defold.editor.Start title: mario - Defold 1.9.4 initialClass: com.defold.editor.Start initialTitle: Defold 1.9.4 pid: 56093 xwayland: 1 pinned: 0 fullscreen: 0 fullscreenClient: 0 grouped: 0 tags: defold swallowing: 0 focusHistoryID: 0 Window 5a8723a06500 -> java: ## JavaFX Dragged Element mapped: 1 hidden: 0 at: 49,289 size: 24,24 workspace: 2 (2) floating: 1 pseudo: 0 monitor: 0 class: title: java initialClass: initialTitle: java pid: 56093 xwayland: 1 pinned: 0 fullscreen: 0 fullscreenClient: 0 grouped: 0 tags: swallowing: 0 focusHistoryID: 7 ```

*Output simplified to show only relevant clients

mobilex1122 commented 2 days ago

I noticed that this issue is on all xwayland apps. Inkscape has this unfocus issue as well.

vaxerski commented 2 days ago

can you try finding a nofocus rule to target those? or perhaps noinitialfocus?

mobilex1122 commented 2 days ago

Could be a solutuon but i think this should be included into hyprland so that it doesn't happen at all.

Because in the end this solition doesn't solve the underlying issue where drag elemets (i would guess in xwayland in general) unfocus the window.

mobilex1122 commented 1 day ago

Here is inkscape clients (running on xwayland) while draging/reordering layers.

hyprctrl clients output (Summary) ```sh Window 61c16fe45b00 -> org.inkscape.Inkscape: ## Inkscape dragged layer window mapped: 1 hidden: 0 at: 1411,259 size: 480,27 workspace: 3 (3) floating: 1 pseudo: 0 monitor: 0 class: title: org.inkscape.Inkscape initialClass: initialTitle: org.inkscape.Inkscape pid: 250831 xwayland: 1 pinned: 0 fullscreen: 0 fullscreenClient: 0 grouped: 0 tags: swallowing: 0 focusHistoryID: 13 Window 61c16c4b0ce0 -> *New document 1 - Inkscape: ## Inkscape main window mapped: 1 hidden: 0 at: 22,57 size: 1876,1001 workspace: 3 (3) floating: 0 pseudo: 0 monitor: 0 class: Inkscape title: *New document 1 - Inkscape initialClass: Inkscape initialTitle: New document 1 - Inkscape pid: 250831 xwayland: 1 pinned: 0 fullscreen: 0 fullscreenClient: 0 grouped: 0 tags: swallowing: 0 focusHistoryID: 0 ```

This is for sure some kind if issue between xwayland and hyprland. Because any other DE that uses xwayland doesn't have this issue.