You are not logged in.

#1 2022-12-30 17:01:58

pmatos
Member
Registered: 2017-09-03
Posts: 50

No mouse in Steam games on Wayland

Hi,

I moved to wayland (sway) from Xorg (i3) and all was good in i3 but in sway, for some reason steam does not recognize the mouse. The mouse works in the steam app but when I start a game, the game can't recognize the mouse. The cursor seems to move but clicking doesn't do anything.

Has anyone seen anything similar?

Paulo

Offline

#2 2022-12-30 17:24:34

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: No mouse in Steam games on Wayland

CS:GO plays fine for me under sway.

Post your configuration files and explain exactly how you are starting the sway session.

Offline

#3 2022-12-30 19:36:23

pmatos
Member
Registered: 2017-09-03
Posts: 50

Re: No mouse in Steam games on Wayland

Head_on_a_Stick wrote:

CS:GO plays fine for me under sway.

Post your configuration files and explain exactly how you are starting the sway session.

That's really good news. There's hope for me then.

This is a new dell laptop, so sort of a vanilla start at the moment.

Using tuigreet to start sway with a `sway --unsupported-gpu`, since I have an optimus setup.

Sway config looks like: (partially ported from i3)

~ cat .config/sway/config
# Keyboard
input "7504:24868:Ultimate_Gadget_Laboratories_UHK_60_v2" {
    xkb_layout "us"
}

input "1:1:AT_Translated_Set_2_keyboard" {
    xkb_layout "gb"
    xkb_model "pc105"
}

output eDP-1 mode 1920x1200@60Hz pos 4000 1060
output "Goldstar Company Ltd LG Ultra HD 0x000003E5" mode 3840x2160@60Hz scale 1.5 pos 1440 660
output "Goldstar Company Ltd LG Ultra HD 0x00008617" mode 3840x2160@60Hz scale 1.5 transform 270 pos 0 0

# Avizo
bindsym XF86AudioRaiseVolume exec volumectl -u up
bindsym XF86AudioLowerVolume exec volumectl -u down
bindsym XF86AudioMute exec volumectl toggle-mute
bindsym XF86AudioMicMute exec volumectl -m toggle-mute

bindsym XF86MonBrightnessUp exec lightctl up
bindsym XF86MonBrightnessDown exec lightctl down

exec "avizo-service"

# Disable xwayland
# zoom requires Xwayland
#xwayland disable

# Mod key
set $mod Mod4

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
font pango:DejaVu Sans Mono 8

# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec alacritty

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

# start rofi (a program launcher)
bindsym $mod+d exec wofi --allow-images --show run

# Screenshots created in XDG_PICTURES_DIR
bindsym $mod+s exec grim -g "$(slurp)"

# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+i focus up
bindsym $mod+l focus right

# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+i move up
bindsym $mod+Shift+l move right

# split in horizontal orientation
bindsym $mod+h split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+Shift+s layout stacking
bindsym $mod+Shift+w layout tabbed
bindsym $mod+Shift+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10

# move workspace to display
bindsym $mod+Shift+comma move container to output left
bindsym $mod+Shift+period move container to output right

# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym j resize shrink width 10 px or 10 ppt
        bindsym k resize grow height 10 px or 10 ppt
        bindsym l resize shrink height 10 px or 10 ppt
        bindsym semicolon resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"

# exit mode impl
mode "exit: [l]ogout, [r]eboot, [s]hutdown" {
  bindsym l exec i3-msg exit
  bindsym r exec systemctl reboot
  bindsym s exec systemctl shutdown

  bindsym Escape mode "default"
  bindsym Return mode "default"
}
bindsym $mod+x mode "exit: [l]ogout, [r]eboot, [s]hutdown"

# Disable title bars
default_border pixel 1

# Gaps config
smart_gaps on
gaps inner 10
gaps outer 15

# bar
bar swaybar_command /usr/local/bin/waybar.sh

###############################
#
# Auto Start Programs

# Start Nextcloud
exec nextcloud --background

# Start telegram and whatsapp apps
exec telegram-desktop
exec whatsapp-nativefier

Are you starting any services that could be relevant for gaming?

Offline

#4 2022-12-30 20:09:41

pmatos
Member
Registered: 2017-09-03
Posts: 50

Re: No mouse in Steam games on Wayland

Head_on_a_Stick wrote:

CS:GO plays fine for me under sway.

Post your configuration files and explain exactly how you are starting the sway session.

Might have found the problem, I read somewhere I should have `SDL_VIDEODRIVER=wayland`, except when I do so I get: "Couldn't initialize SDL: wayland not available" when starting steam and the same when starting CS:GO but as a window with really bad fonts.

I checked, I have libsdl and lib32-sdl installed. So I wonder what else is needed to have this initialized in wayland. Any guesses?

Offline

#5 2022-12-30 20:10:49

pmatos
Member
Registered: 2017-09-03
Posts: 50

Re: No mouse in Steam games on Wayland

pmatos wrote:
Head_on_a_Stick wrote:

CS:GO plays fine for me under sway.

Post your configuration files and explain exactly how you are starting the sway session.

Might have found the problem, I read somewhere I should have `SDL_VIDEODRIVER=wayland`, except when I do so I get: "Couldn't initialize SDL: wayland not available" when starting steam and the same when starting CS:GO but as a window with really bad fonts.

I checked, I have libsdl and lib32-sdl installed. So I wonder what else is needed to have this initialized in wayland. Any guesses?


humm, but wait... what i have installed doesn't matter cause steam bundles its own libraries. I wonder if this is a call to install steam native runtime. Do you have that installed?

Offline

#6 2022-12-30 20:13:42

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: No mouse in Steam games on Wayland

pmatos wrote:

`sway --unsupported-gpu`

Well there's the problem then. Either pester NVIDIA to fix their GBM support or sell the card and give your money to a manufacturer that doesn't hate the open source community.

pmatos wrote:

Are you starting any services that could be relevant for gaming?

No:

$ find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f
btrfs-scrub@-.timer                      | timers.target.wants
ctrl-alt-del.target                      | system
dbus-org.freedesktop.resolve1.service    | system
dbus-org.freedesktop.timesync1.service   | system
default.target                           | system
fstrim.timer                             | timers.target.wants
getty@tty1.service                       | getty.target.wants
iwd.service                              | multi-user.target.wants
mirrorlist.timer                         | timers.target.wants
nftables.service                         | multi-user.target.wants
paccache.timer                           | timers.target.wants
seatd.service                            | multi-user.target.wants
systemd-resolved.service                 | multi-user.target.wants
systemd-timesyncd.service                | sysinit.target.wants
systemd-vconsole-setup.service           | multi-user.target.wants
xdg-user-dirs-update.service             | default.target.wants
$

Offline

#7 2023-01-02 18:03:00

pmatos
Member
Registered: 2017-09-03
Posts: 50

Re: No mouse in Steam games on Wayland

Head_on_a_Stick wrote:
pmatos wrote:

`sway --unsupported-gpu`

Well there's the problem then. Either pester NVIDIA to fix their GBM support or sell the card and give your money to a manufacturer that doesn't hate the open source community.

Thanks, it does feel like I need to understand the architecture better and pester nvidia cause this is a laptop and the card won't be going anywhere soon.

Head_on_a_Stick wrote:
pmatos wrote:

Are you starting any services that could be relevant for gaming?

No:

$ find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f
btrfs-scrub@-.timer                      | timers.target.wants
ctrl-alt-del.target                      | system
dbus-org.freedesktop.resolve1.service    | system
dbus-org.freedesktop.timesync1.service   | system
default.target                           | system
fstrim.timer                             | timers.target.wants
getty@tty1.service                       | getty.target.wants
iwd.service                              | multi-user.target.wants
mirrorlist.timer                         | timers.target.wants
nftables.service                         | multi-user.target.wants
paccache.timer                           | timers.target.wants
seatd.service                            | multi-user.target.wants
systemd-resolved.service                 | multi-user.target.wants
systemd-timesyncd.service                | sysinit.target.wants
systemd-vconsole-setup.service           | multi-user.target.wants
xdg-user-dirs-update.service             | default.target.wants
$

I will take a look, there might be something useful for me in there as well.

Offline

Board footer

Powered by FluxBB