swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.77k stars 1.11k forks source link

Enabling / disabling the scaled laptop internal display interferes with fonthinting and titlebar scale of non-scaled external display #7978

Open tobiolo opened 9 months ago

tobiolo commented 9 months ago

Please read the following before submitting:

Please fill out the following:

``` # Default config for sway # # Copy this to ~/.config/sway/config and edit it to your liking. # # Read `man 5 sway` for a complete reference. ### Autostart exec foot --server exec mako exec dropbox ### Import user environment variables into DBUS user environment exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP exec hash dbus-update-activation-environment 2>/dev/null && \ dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE ### Variables # # Logo key. Use Mod1 for Alt. set $mod Mod4 # Home row direction keys, like vim set $left h set $down j set $up k set $right l # Your preferred terminal emulator set $term footclient # Your preferred application launcher # Note: pass the final command to swaymsg so that the resulting window can be opened # on the original workspace that the command was run on. # set $menu dmenu_path | wmenu | xargs swaymsg exec -- # set $menu wofi --show drun -I -G set $menu rofi -font "Monospace 12" -show combi -combi-modi window\,drun\,run -show-icons -drun-show-actions bindsym $mod+Shift+d exec rofimoji ### Output configuration # # Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/) output * bg #808080 solid_color # # Example configuration: # # output HDMI-A-1 resolution 1920x1080 position 1920,0 # # You can get the names of your outputs by running: swaymsg -t get_outputs output eDP-1 resolution 2800x1800 scale 2.0 position 0,0 output DP-2 resolution 2560x1440 scale 1.0 position 1400,0 subpixel rgb output HDMI-A-1 resolution 2560x1440 scale 1.0 position 4000,0 subpixel rgb # output HDMI-A-1 resolution 3840x2160 scale 2.0 position 1280,0 ### Idle configuration # # Example configuration: # # exec swayidle -w \ # timeout 300 'swaylock -f -c 000000' \ # timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ # before-sleep 'swaylock -f -c 000000' # # This will lock your screen after 300 seconds of inactivity, then turn off # your displays after another 300 seconds, and turn your screens back on when # resumed. It will also lock your screen before your computer goes to sleep. ### Input configuration # # Example configuration: # input "type:touchpad" { dwt enabled tap enabled natural_scroll enabled middle_emulation enabled } input "type:keyboard" { repeat_delay 500 repeat_delay 200 xkb_layout de xkb_options grp:alt_space_toggle,compose:caps,keypad:pointerkeys } input "1:1:AT_Translated_Set_2_keyboard" { xkb_layout ch(de) } # # You can get the names of your inputs by running: swaymsg -t get_inputs # Read `man 5 sway-input` for more information about this section. seat seat0 { hide_cursor when-typing enable # shortcuts_inhibitor disable xcursor_theme Adwaita } ### Key bindings # # Basics: # # Start a terminal bindsym $mod+Return exec $term # Kill focused window bindsym $mod+Shift+q kill bindsym --whole-window Shift+BTN_RIGHT 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 swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit' # Clamshell bindswitch lid:on output eDP-1 disable bindswitch lid:off output eDP-1 enable # # 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 # Or use $mod+[up|down|left|right] 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 # Ditto, with arrow keys 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="1"] move workspace to output current; workspace number 1 bindsym $mod+2 [workspace="2"] move workspace to output current; workspace number 2 bindsym $mod+3 [workspace="3"] move workspace to output current; workspace number 3 bindsym $mod+4 [workspace="4"] move workspace to output current; workspace number 4 bindsym $mod+5 [workspace="5"] move workspace to output current; workspace number 5 bindsym $mod+6 [workspace="6"] move workspace to output current; workspace number 6 bindsym $mod+7 [workspace="7"] move workspace to output current; workspace number 7 bindsym $mod+8 [workspace="8"] move workspace to output current; workspace number 8 bindsym $mod+9 [workspace="9"] move workspace to output current; workspace number 9 bindsym $mod+0 [workspace="0"] move workspace to output current; 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 # Note: workspaces can have any name you want, not just numbers. # We just use 1-10 as the default. set $mode_move_all_workspace_windows "Move all workspace windows to [0-9]?" mode $mode_move_all_workspace_windows { bindsym 1 [workspace=".*"] move to workspace 1; workspace number 1, mode "default" bindsym 2 [workspace=".*"] move to workspace 2; workspace number 2, mode "default" bindsym 3 [workspace=".*"] move to workspace 3; workspace number 3, mode "default" bindsym 4 [workspace=".*"] move to workspace 4; workspace number 4, mode "default" bindsym 5 [workspace=".*"] move to workspace 5; workspace number 5, mode "default" bindsym 6 [workspace=".*"] move to workspace 6; workspace number 6, mode "default" bindsym 7 [workspace=".*"] move to workspace 7; workspace number 7, mode "default" bindsym 8 [workspace=".*"] move to workspace 8; workspace number 8, mode "default" bindsym 9 [workspace=".*"] move to workspace 9; workspace number 9, mode "default" bindsym 0 [workspace=".*"] move to workspace 10; workspace number 10, mode "default" # back to normal: Enter or Escape bindsym Return mode "default" bindsym Escape mode "default" } bindsym $mod+shift+ctrl+m mode $mode_move_all_workspace_windows # # Layout stuff: # # You can "split" the current object of your focus with # $mod+b or $mod+v, for horizontal and vertical splits # respectively. 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 bindsym $mod+g fullscreen global bindsym --whole-window $mod+BTN_MIDDLE 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 # Move focus to the parent container bindsym $mod+a focus parent # # Scratchpad: # # Sway has a "scratchpad", which is a bag of holding for windows. # You can send windows there and get them back later. # 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" { # left will shrink the containers width # right will grow the containers width # up will shrink the containers height # down will grow the containers height bindsym $left resize shrink width 10px bindsym $down resize grow height 10px bindsym $up resize shrink height 10px bindsym $right resize grow width 10px # Ditto, with arrow keys 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" # # Status Bar: # # Read `man 5 sway-bar` for more information about this section. bar { position top swaybar_command swaybar mode dock # When the status_command prints a new line to stdout, swaybar updates. # The default just shows the current date and time. status_command while date +'%V %a %d.%m.%Y %H:%M:%S %p'; do sleep 1; done colors { statusline #ffffff background #323232 inactive_workspace #32323200 #32323200 #5c5c5c } } # MPRIS set $sinkvolup "pactl set-sink-mute @DEFAULT_SINK@ false; pactl set-sink-volume @DEFAULT_SINK@ +5%" set $sinkvoldown "pactl set-sink-mute @DEFAULT_SINK@ false; pactl set-sink-volume @DEFAULT_SINK@ -5%" set $sourcevolup "pactl set-source-mute @DEFAULT_SOURCE@ false; pactl set-source-volume @DEFAULT_SOURCE@ +5%" set $sourcevoldown "pactl set-source-mute @DEFAULT_SOURCE@ false; pactl set-source-volume @DEFAULT_SOURCE@ -5%" set $sinkmute "pactl set-sink-mute @DEFAULT_SINK@ toggle" set $sourcemute "pactl set-source-mute @DEFAULT_SOURCE@ toggle" set $playernext "playerctl next" set $playerprevious "playerctl previous" set $playerplay "playerctl play" set $playerpause "playerctl pause" set $playerforward "playerctl position 5+" set $playerrewind "playerctl position 5-" bindsym { XF86AudioRaiseVolume exec $sinkvolup XF86AudioLowerVolume exec $sinkvoldown XF86AudioMute exec $sinkmute XF86AudioMicMute exec $sourcemute XF86AudioPause exec $playerplay XF86AudioPlay exec $playerpause XF86AudioNext exec $playernext XF86AudioPrev exec $playerprevious XF86AudioForward exec $playerforward XF86AudioRewind exec $playerrewind } set $multimedia "MPRIS: Return (Un)Mute | Keys ↓↑ Sink Vol | →← Keys Source Vol | >< Seek | Page ↓↑ Track | _ Pause | Tab Loop Track | Shift+Tab Unloop | x Switch BT Profile" bindsym $mod+y mode $multimedia mode $multimedia { bindsym --no-repeat { Escape mode default Return exec $sinkmute Up exec $sinkvolup Down exec $sinkvoldown Right exec $sourcevolup Left exec $sourcevoldown Next exec $playernext Greater exec $playerforward Less exec $playerrewind Prior exec $playerprevious Space exec "playerctl play-pause" Tab exec "playerctl loop track" Shift+Tab exec "playerctl loop none" x exec "switchbtprofile.sh" } } # Display management set $display "Display - Number, BTN: Toggle, Escape: Leave" bindsym $mod+p mode $display mode $display { bindsym --no-repeat { Escape mode default 1 output eDP-1 toggle 2 output DP-1 toggle 3 output HDMI-A-1 toggle } bindsym --whole-window { BTN_RIGHT output HDMI-A-1 toggle BTN_MIDDLE output eDP-1 toggle BTN_LEFT output DP-1 toggle } } # Backlight bindsym XF86MonBrightnessUp exec light -A 10 bindsym XF86MonBrightnessDown exec light -U 10 # GSettings set $gnome-schema org.gnome.desktop.interface exec_always { gsettings set $gnome-schema font-name 'sans-serif 10' gsettings set $gnome-schema color-scheme 'prefer-light' gsettings set $gnome-schema cursor-theme 'Adwaita' } # Files bindsym $mod+Less exec nautilus # Screeshot # bindsym Print exec grim -g "$(slurp)" - | wl-copy -t image/png bindsym Print exec flameshot gui # Screencast bindsym $mod+Print exec wvidcap bindsym Shift+Print exec wvidcapwoa # Import systemd settings include /etc/sway/config.d/* # Polkit exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Focus on xdg_activation focus_on_window_activation focus # Autostart exec wlsunset -l 47.3 -L 7.9 -t 2800 for_window [app_id="flameshot"] border pixel 0, floating disable, fullscreen enable global, move absolute position 0 0 ```

https://github.com/swaywm/sway/assets/3286756/bb4a2e3e-fb99-4c61-b6ed-fbb54bb2a80f

emersion commented 9 months ago

Can you reproduce with the latest commit?

Here are some instructions to compile from source: https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject

tobiolo commented 9 months ago

Can you reproduce with the latest commit?

Here are some instructions to compile from source: https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject

Thanks for your reply. I used the branch for the release candidate together with the latest stable wlroots release (as subproject). I will try to test with the latest commits of each project.

emersion commented 9 months ago

Also, is this a regression? Are you able to reproduce with sway 1.8, or not?

tobiolo commented 9 months ago

Also, is this a regression? Are you able to reproduce with sway 1.8, or not?

This seems to be a regression. It does not happen with sway 1.8.1 and wlroots 0.16.2.

tobiolo commented 9 months ago

Problems persists with latest commit on sway and wlroots.

tobiolo commented 9 months ago

In addition to that, a strange overlap occures between the internal display and the first external one (on latest commits).