在具有多个显示器的 Sway 中,某些应用程序不接受鼠标单击

在具有多个显示器的 Sway 中,某些应用程序不接受鼠标单击

我有三台显示器(我的笔记本电脑的一台和两台外接显示器)。某些应用程序(例如 Discord、Gimp、Scilab,以及我记得的一些)在不在笔记本电脑屏幕上时不接受鼠标点击。唯一的工作屏幕是eDP-1。鼠标是配置文件中未列出的外接鼠标,但触摸板也会发生同样的情况。

.config/sway/config这是我的文件的内容:

### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod1
set $win Mod4
# Your preferred terminal emulator
set $term kitty
# Your preferred application launcher
set $menu "rofi -modi drun,run -show drun -icon-theme 'Papirus' -show-icons" 

set $lock swaylock -c 000000

### Output configuration
output * bg /home/janus/Pictures/Wallpapers/c182c352d778dce5eaf342fdd29fd1e3.jpg fill

output DP-4 resolution 3840x2160 scale 1.3 position -1000,-1660
output DP-2 resolution 3840x2160 scale 1.3 position 1955,-1660 transform 90
output eDP-1 resolution 1920x1080 scale 1 position 0,0

### Input configuration

input "1267:12608:ELAN06FA:00_04F3:3140_Touchpad" {
    dwt enabled
    tap enabled
    natural_scroll enabled
    scroll_method two_finger
    tap_button_map lmr
    click_method clickfinger
}

input "1386:21098:Wacom_HID_526A_Finger" map_to_output eDP-1
input "1386:21098:Wacom_HID_526A_Pen" map_to_output eDP-1

input * {
  xkb_layout "us"
  xkb_variant "intl"
}

input "1:AT_Translated_Set_2_keyboard" xkb_model "pc105" 
input "76:668:Luciano_Musacchio___s_Magic_Keyboard" xkb_model "pc105"
input "1133:45088:MX_Vertical_Mouse" {
  natural_scroll disabled
}


### Key bindings
    # Lock screen
    bindsym $mod+Ctrl+l exec $lock

    # Start a terminal
    bindsym $mod+Return exec $term

    # Kill focused window
    bindsym $mod+Shift+q kill

    # Start your launcher
    bindsym $mod+d exec $menu

    # Drag floating windows by holding down $mod and left mouse button.
    # Resize them with right mouse button + $mod.
    # Despite the name, also works for non-floating windows.
    # Change normal to inverse to use left mouse button for resizing and right
    # mouse button for dragging.
    floating_modifier $mod normal

    # Reload the configuration file
    bindsym $mod+Shift+c reload

    # Exit sway (logs you out of your Wayland session)
    bindsym $mod+Shift+e exec zenity --question --text="¿Desea cerrar la sesión?" && swaymsg exit

# Moving around:
#
    # Move your focus around
    bindsym $mod+Left focus left
    bindsym $mod+Down focus down
    bindsym $mod+Up focus up
    bindsym $mod+Right focus right

    # Move the focused window with the same, but add Shift
    bindsym $mod+Shift+Left move left
    bindsym $mod+Shift+Down move down
    bindsym $mod+Shift+Up move up
    bindsym $mod+Shift+Right move right
#
# Workspaces:
#
    # Switch to workspace
    bindsym $mod+1 workspace number 1
    bindsym $mod+2 workspace number 2
    bindsym $mod+3 workspace number 3
    bindsym $mod+4 workspace number 4
    bindsym $mod+5 workspace number 5
    bindsym $mod+6 workspace number 6
    bindsym $mod+7 workspace number 7
    bindsym $mod+8 workspace number 8
    bindsym $mod+9 workspace number 9
    bindsym $mod+0 workspace number 10
    # Move focused container to workspace
    bindsym $mod+Shift+1 move container to workspace number 1
    bindsym $mod+Shift+2 move container to workspace number 2
    bindsym $mod+Shift+3 move container to workspace number 3
    bindsym $mod+Shift+4 move container to workspace number 4
    bindsym $mod+Shift+5 move container to workspace number 5
    bindsym $mod+Shift+6 move container to workspace number 6
    bindsym $mod+Shift+7 move container to workspace number 7
    bindsym $mod+Shift+8 move container to workspace number 8
    bindsym $mod+Shift+9 move container to workspace number 9
    bindsym $mod+Shift+0 move container to workspace number 10
#
# Layout stuff:
#
    bindsym $mod+b splith
    bindsym $mod+v splitv

    # Switch the current container between different layout styles
    bindsym $mod+s layout stacking
    bindsym $mod+w layout tabbed
    bindsym $mod+e layout toggle split

    # Make the current focus fullscreen
    bindsym $mod+f fullscreen

    # Toggle the current focus between tiling and floating mode
    bindsym $mod+Shift+space floating toggle

    # Swap focus between the tiling area and the floating area
    bindsym $mod+space focus mode_toggle
#
# Scratchpad:
#
    # Move the currently focused window to the scratchpad
    bindsym $mod+Shift+minus move scratchpad

    # Show the next scratchpad window or hide the focused scratchpad window.
    # If there are multiple scratchpad windows, this command cycles through them.
    bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
    bindsym Left resize shrink width 10px
    bindsym Down resize grow height 10px
    bindsym Up resize shrink height 10px
    bindsym Right resize grow width 10px

    # Return to default mode
    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"

# Multimedia
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
bindsym --locked XF86AudioPlay exec playerctl play-pause
bindsym --locked XF86AudioNext exec playerctl next
bindsym --locked XF86AudioPrev exec playerctl previous
bindsym XF86Search exec google-chrome-stable 
bindsym XF86Calculator exec gnome-calculator

exec waybar
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
#bar {
include /etc/sway/config.d/*

# Plasma compatibility improvements
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_role="dialog"] floating enable

for_window [class="krunner"] floating enable; border none
for_window [app_id="org.kde.kcalc"] floating enable; border none
for_window [class="Kmix"] floating enable; border none
for_window [class="spectacle"] floating enable; border none
for_window [class="Klipper"] floating enable; border none
for_window [class="Plasmoidviewer"] floating enable; border none
for_window [class="plasmashell" window_type="notification"] border none, move position 70 ppt 81 ppt
no_focus [class="plasmashell" window_type="notification"]
for_window [title="Desktop @ QRect.*"] kill; floating enable; border none
for_window [title="Calculator"] floating enable 

default_border pixel 2
default_floating_border pixel 2
hide_edge_borders --i3 smart
smart_borders on
smart_gaps on
titlebar_border_thickness 0

# Notification Daemon
exec swaync

# Toggle control center
bindsym $mod+a exec swaync-client -t -sw

# Screenshot
bindsym $mod+p exec /usr/share/sway/scripts/grimshot --cursor copy area
bindsym --release Print exec /usr/share/sway/scripts/grimshot --cursor copy area

# Files
bindsym $win+e exec /usr/bin/thunar

exec systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
exec dbus-update-activation-environment WAYLAND_DISPLAY
exec wl-paste -t text --watch clipman store --no-persist```

答案1

我发现了这个问题以及解决方法维基百科

这是 Xwayland 中的一个错误,它不能像我一样处理“负”像素

output DP-4 resolution 3840x2160 scale 1.3 position -1000,-1660
output DP-2 resolution 3840x2160 scale 1.3 position 1955,-1660 transform 90
output eDP-1 resolution 1920x1080 scale 1 position 0,0

正如维基百科中所标记的,解决方法是重新排列我的显示器,这样就不会有负面的位置。例如:

output DP-4 resolution 3840x2160 scale 1.3 position 0,0
output DP-2 resolution 3840x2160 scale 1.3 position 2955,0 transform 90
output eDP-1 resolution 1920x1080 scale 1 position 1000,1660

相关内容