Repository navigation
fix: pass current refresh rate to cosmic-randr when changing monitor position - #2139
Conversation
|
This PR has made it so that the displays can't be re-positioned by dragging anymore. They snap back to where they started from. |
Apologies for the delay, could you provide the version of cosmic-randr you have installed so I can reproduce your issue? Additionally, if you run cosmic-settings from this PR from the CLI, are there any error messages that appear when changing screen position? Edit: I'm also interested in what refresh rate your affected monitor is set to. |
|
This is what I see when I run cosmic-settings from the terminal: The and the Edit: Both displays are set to 144Hz, when they were both set to 60Hz this doesn't happen, though. |
|
@jacobktm Thank you! Could you also send me the output of |
|
Here is the output of system76@pop-os:~$ cosmic-randr list
eDP-1 (enabled)
Make: BOE
Model: 0x08B3
Physical Size: 350 x 190 mm
Position: 1920,0
Scale: 100%
Transform: normal
Adaptive Sync Support: false
Adaptive Sync: false
Xwayland primary: false
Modes:
1920x1080 @ 144.003 Hz (current) (preferred)
1920x1080 @ 59.997 Hz
HDMI-A-4 (enabled)
Make: Shenzhen KTC Technology Group
Model: H24T09P
Physical Size: 530 x 300 mm
Position: 0,0
Scale: 100%
Transform: normal
Adaptive Sync Support: false
Adaptive Sync: false
Xwayland primary: true
Modes:
1920x1080 @ 164.999 Hz
1920x1080 @ 144.002 Hz (current)
1920x1080 @ 120.000 Hz
1920x1080 @ 119.996 Hz
1920x1080 @ 119.879 Hz
1920x1080 @ 60.000 Hz
1920x1080 @ 59.996 Hz (preferred)
1920x1080 @ 59.939 Hz
1920x1080 @ 50.000 Hz
1680x1050 @ 59.954 Hz
1600x900 @ 60.000 Hz
1440x900 @ 59.887 Hz
1280x1024 @ 75.025 Hz
1280x1024 @ 60.020 Hz
1280x720 @ 119.879 Hz
1280x720 @ 60.000 Hz
1280x720 @ 59.943 Hz
1152x864 @ 59.997 Hz
1024x768 @ 75.029 Hz
1024x768 @ 60.004 Hz
800x600 @ 75.000 Hz
800x600 @ 60.317 Hz
720x480 @ 59.940 Hz
640x480 @ 75.000 Hz
640x480 @ 59.940 Hz |
|
@jacobktm Thank you, that was very helpful! I suspect |
|
|
||
| task.arg("mode") | ||
| .arg("--refresh") | ||
| .arg(format!("{}.{:03}", rate / 1000, rate % 1000)) |
There was a problem hiding this comment.
We use integer math for the refresh rate, like so
|
Whoops, I thought I saw @jacobktm Can you give it another shot? |
jacobktm
left a comment
There was a problem hiding this comment.
This has passed regression testing.
# TestingThis document provides a regression testing checklist for COSMIC Settings and the COSMIC Settings Daemon. The checklist provides a starting point for Quality Assurance reviews.
Checklist
Network & Wireless
Wi-Fi
- Able to disconnect from and connect to a network.
Bluetooth
- Bluetooth device connects.
- Paired device can be disconnected & reconnected.
- Paired device can be forgotten & connecting again works.
Desktop
Wallpaper
- Clicking a different wallpaper switches to it immediately
- Leaving the page and coming back does not change the wallpaper
Appearance
- Open a COSMIC app and a GNOME app. When switching between Dark and Light mode, the COSMIC app switches immediately, and the GNOME app switches after restarting.
- Changing the accent color works.
- Changing the roundness style works and does not affect other aspects of the theme (e.g. color mode).
- Changing the interface density works.
Panel
- Enable tiling. "Automatically hide panel" takes effect immediately.
- Disable tiling; maximize a window. "Automatically hide panel" takes effect immediately.
Dock
- Enable tiling. "Automatically hide dock" takes effect immediately.
- Disable tiling; maximize a window. "Automatically hide dock" takes effect immediately.
- Changing position on screen works.
- All Style settings take effect as expected.
Displays
- Plug in a second display. Displays can be rearranged via dragging.
Sound
- Output & Input volume sliders work independently
- Output balance slider works & doesn't get reset by volume slider
- Amplification toggles work as expected
- Device profiles can be changed & reflect as expected on the main Sound page
Power & Battery
- Changing power mode takes effect and is reflected by top panel applet.
Input Devices
Touchpad
- All click behavior settings work as expected.
- All scrolling settings work as expected.
Applications
Default Applications
- Changing the default terminal affects Super-T shortcut.
X11 Applications Compatibility
- Global Shortcuts in X11 Applications work (in e.g. Discord).
Time & Language
Date & Time
- Changing time zone works.
- Toggling 24-hour time takes effect in Settings preview, on top panel, and on the lock screen.
- Toggling seconds takes effect in Settings preview and on top panel.
- Changing first day of week takes effect in Calendar applet.
- Turning date on/off for applet works.
System & Accounts
About
- Changing hostname works (check terminal prompt).
Looks good now, thanks!
Hello,
I've had a really strange and specific issue while using the COSMIC settings app where changing the display position specifically on my secondary ASUS VG249 monitor would set the refresh rate of the monitor to 60hz even though it was already set to 144hz.
This seems to happen when constructing the
cosmic-randrcommand to call. The command called sets only the position of the monitor which different monitors tend to handle differently. The low-level explanation is above me at the moment, but specifying the refresh rate explicitly in the constructedcosmic-randrcommand appears to fix the issue at best and does nothing at worst.I thought that
cosmic-randrwas trying to select the refresh rate of the monitor's default mode, but that doesn't seem to hold on my TV as it's default mode is 3560x2560@60 (had it set to 2560x1440@120 in the demo) so in theory it should have set the refresh rate to 60, but that didn't happen. Any other ideas/theories are welcome!Here's a demo of the issue along with a demo of the fixed build: https://github.com/user-attachments/assets/5ffa3d3d-a9c9-4e62-843d-a7af72be4061
Testers would be greatly appreciated if you're also seeing this issue yourself!
Should also fix the following quote within the description of the issue pop-os/cosmic-epoch#1540:
Please let me know if any improvements need to be made!
-- Alex