Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sway doesn't set the secondary monitor properly #1212

Closed
zsrkmyn opened this issue May 6, 2017 · 5 comments
Closed

sway doesn't set the secondary monitor properly #1212

zsrkmyn opened this issue May 6, 2017 · 5 comments

Comments

@zsrkmyn
Copy link

zsrkmyn commented May 6, 2017

I have a laptop and a external monitor. The resolution of the laptop's monitor (LVDS) and the external one (HDMI) is 1366x768 and 1920x1080 respectively. And thus I cofigure the outputs in the config file with the following two lines:

output LVDS-1 resolution 1366x768 position 0,0
output HDMI-A-1 resolution 1920x1080 position 1366,0

However, when I start sway, the external monitor doesn't display properly, the screenshot (captured by swaygrap) is shown below. The output is blur and the title of the window isn't correctly rendered. It is noticeable that the size of the screenshot is 1280x720 but not 1920x1080.
2017-05-06-220735_swaygrab
But when I run swaymsg -t get_outputs, I get the output as below:

[
   {
     "id": 1,
     "name": "LVDS-1",
     "rect": {
       "x": 0,
       "y": 0,
       "width": 1366,
       "height": 768
     },
     "visible": true,
     "focused": false,
     "active": true,
     "primary": false,
     "layout": "output",
     "type": "output",
     "current_workspace": "1",
     "scale": 1
   },
   {
     "id": 3,
     "name": "HDMI-A-1",
     "rect": {
       "x": 1366,
       "y": 0,
       "width": 1920,
       "height": 1080
     },
     "visible": true,
     "focused": false,
     "active": true,
     "primary": false,
     "layout": "output",
     "type": "output",
     "current_workspace": "2",
     "scale": 1
   }
 ]

I think sway renders the output as 1280x720 but not 1920x1080.

Interestingly, when I switch to an Xserver running on tty1 (my sway is running on tty2), which has the proper resolution settings (1366x768 and 1920x1080), and then switch back to sway, the output of the external monitor becomes good as the following screenshot shows!
2017-05-06-221048_swaygrab.png
As is seen in the screenshot, the everything is clear and works well. It is noticeable that the size of the screenshot is 1920x1080. And I run swaymsg -t get_outputs, the output keeps the same as above.

Later, I switch to tty3, which runs nothing except a getty shell, and then switch back to sway, the resolution of the external monitor is set to 1280x720, and the swaymsg -t get_outputs gives

[
   {
     "id": 1,
     "name": "LVDS-1",
     "rect": {
       "x": 0,
       "y": 0,
       "width": 1366,
       "height": 768
     },
     "visible": true,
     "focused": false,
     "active": true,
     "primary": false,
     "layout": "output",
     "type": "output",
     "current_workspace": "1",
     "scale": 1
   },
   {
     "id": 3,
     "name": "HDMI-A-1",
     "rect": {
       "x": 1366,
       "y": 0,
       "width": 1280,
       "height": 720
     },
     "visible": true,
     "focused": false,
     "active": true,
     "primary": false,
     "layout": "output",
     "type": "output",
     "current_workspace": "2",
     "scale": 1
   }
 ]

And the screenshot is shown below:
2017-05-06-224745_swaygrab.png

I am using Arch Linux with the sway version 0.12.2. I am pleasure to provide more details if you need :-)
Thanks!

Here is my full config file:

~$ cat ~/.config/sway/config |grep -v '^\s*[#]'
set $mod Mod4
set $left d
set $down h
set $up t
set $right n
set $term xfce4-terminal
set $menu dmenu_run

output * bg /usr/share/sway/Sway_Wallpaper_Blue_1920x1080.png fill
output LVDS-1 resolution 1366x768 position 0,0
output HDMI-A-1 resolution 1920x1080 position 1366,0


    input "2:7:SynPS/2_Synaptics_TouchPad" {
    	accel_profile flat
    	dwt enabled
    	tap enabled
    	click_method clickfinger
    	scroll_method edge
    	natural_scroll enabled
    	middle_emulation enabled
    	pointer_accel [100,100]
    }


    bindsym $mod+Return exec $term

    bindsym $mod+c kill

    bindsym $mod+F2 exec $menu -b

    floating_modifier $mod normal

    bindsym $mod+Shift+r reload

    bindsym $mod+Shift+q exit
    bindsym $mod+$left focus left
    bindsym $mod+$down focus down
    bindsym $mod+$up focus up
    bindsym $mod+$right focus right
    bindsym $mod+Left focus left
    bindsym $mod+Down focus down
    bindsym $mod+Up focus up
    bindsym $mod+Right focus right

    bindsym $mod+Shift+$left move left
    bindsym $mod+Shift+$down move down
    bindsym $mod+Shift+$up move up
    bindsym $mod+Shift+$right move right
    bindsym $mod+Shift+Left move left
    bindsym $mod+Shift+Down move down
    bindsym $mod+Shift+Up move up
    bindsym $mod+Shift+Right move right
    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
    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
    bindsym $mod+o splith
    bindsym $mod+v splitv

    bindsym $mod+s layout stacking
    bindsym $mod+w layout tabbed
    bindsym $mod+e layout toggle split

    bindsym $mod+f fullscreen

    bindsym $mod+Shift+space floating toggle

    bindsym $mod+space focus mode_toggle

    bindsym $mod+a focus parent

    bindsym $mod+Shift+minus move scratchpad

    bindsym $mod+minus scratchpad show
mode "resize" {
    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

    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

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

bar {
    position top
    colors {
        statusline #ffffff
        background #323232
        inactive_workspace #32323200 #32323200 #5c5c5c
    }
}

include /etc/sway/config.d/*
@ddevault
Copy link
Contributor

ddevault commented May 6, 2017

Can we have a debug log, please?

@zsrkmyn
Copy link
Author

zsrkmyn commented May 6, 2017

I did a research and the full log can be found here.
In L461, the mode 1280x720 is chosen by wlc, but sway set it to 1920x1080 in L467.
In L773, I switched to Xserver in tty1 and then switched back, and this time wlc chose the proper mode in L830.

@ddevault
Copy link
Contributor

ddevault commented May 6, 2017 via email

@zsrkmyn
Copy link
Author

zsrkmyn commented May 6, 2017

Do you mean that we cannot specify a resolution to wlc, and wlc will automatically choose the display's preferred mode?

@ddevault
Copy link
Contributor

ddevault commented May 6, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants