12

When I change the screen resolution of my laptop from 1366x768 to 1024x768 via [Displays ...], the entire screen is still filled, stretching the picture uglyly. How can I have a pixel wise 1-to-1 mapping such that the original proportions are preserved?

This I need particularly when I want to mirror the screen together with a beamer.

(In 9.10 it somewhat depended on the displays available at startup. If a lower resolution screen was added later on, proportions were retained)


xrandr output:

Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS connected 1366x768+0+0 (normal left inverted right x axis y axis) 256mm x 144mm
   1366x768       60.0*+   50.0  
   1360x768       60.0     50.0  
   1280x768       60.0     50.0  
   1280x720       60.0     50.0  
   1024x768       60.0     50.0  
   1024x600       60.0     50.0  
   800x600        60.0     50.0  
   800x480        60.0     50.0  
   640x480        60.0     50.0  
DFP1 disconnected (normal left inverted right x axis y axis)
CRT1 disconnected (normal left inverted right x axis y axis)

This is a lenovo X121e and:

$ sudo lshw -C display
[sudo] password for ulrich: 
  *-display               
       description: VGA compatible controller
       product: Wrestler [Radeon HD 6320]
       vendor: Hynix Semiconductor (Hyundai Electronics)
       physical id: 1
       bus info: pci@0000:00:01.0
       version: 00
       width: 32 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=fglrx_pci latency=0
       resources: irq:45 memory:e0000000-efffffff ioport:4000(size=256) memory:f0300000-f033ffff

(What I found odd when running above is that it took so long)

5
  • 1
    Look into xrandr on Ask Ubuntu
    – don.joey
    Mar 6, 2013 at 8:51
  • Not exactly sure if I understand you right you mean changing the resolution makes the wallpaper look bad? Then simply right click on your desktop and in wallpaper settings instead of zoomed switch to streched. Currently using it myself while connected my old display with 1024x768 size but originally installed with display 1920x1080 after display replacement the wallpaper looked weird so that what I did and the wallpaper looks fine now.
    – JoKeR
    Jun 20, 2015 at 14:46
  • @JoKeR: It's not the wallpaper I care, but rather text. It is no longer 1-to-1 but 1024 pixels in width are stretched to 1366 pixels. What I want is to have exactly 1024 pixels such that I can see on my screen exactly the same I have on the beamer.
    – false
    Jun 20, 2015 at 14:56
  • @false, Could you post your hardware/drive setup lshw -C display ?
    – user.dz
    Jun 22, 2015 at 0:21
  • @Sneetsher: See above!
    – false
    Jun 22, 2015 at 10:37

6 Answers 6

8

Try first setting scaling mode on the display to "Full aspect"

xrandr --output LVDS --set "scaling mode" "Full aspect" 

or

xrandr --output LVDS --set PANEL_FITTING full_aspect

After this change your resolution

xrandr -s 1024x768

This works with lenovo E330 laptop with intel gpu.

Options for scaling mode are: "Full", "Center" or "Full aspect".

5
  • X Error of failed request: BadName (named color or font does not exist) Major opcode of failed request: 157 (RANDR) Minor opcode of failed request: 11 (RRQueryOutputProperty
    – false
    Jun 25, 2015 at 15:41
  • @false Did you get that error from both of the commands or only from the PANEL_FITTING one. For me the first one works and the second gives that error, but some systems use the latter
    – Manwe
    Jun 25, 2015 at 20:48
  • Both did not work
    – false
    Jun 25, 2015 at 21:13
  • @false Then I'm afraid that it's something Radeon specific (ie. radeon drive does not support that xrandr extension) or your screen. run xrandr --props to see properties that can be set and their values (there could be others). On my LVDS I have "scaling mode: Full"
    – Manwe
    Jun 26, 2015 at 10:18
  • This doesn't work on external displays
    – Anwar
    Feb 13, 2021 at 10:41
3

It's not 100% clear what you want (I suggest you edit the title so it's more obvious to the next guy who tries to solve this problem), but I think the solution is basically this: My xrandr output is

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 173mm
   1920x1080      60.1*+   59.9  
   1680x1050      60.0     59.9  
   1600x1024      60.2  
   1400x1050      60.0  
   1280x1024      60.0  
   1440x900       59.9  
   1280x960       60.0  
   1360x768       59.8     60.0  
   1152x864       60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

If I then run xrandr --output eDP1 --size 1360x768 --fb 1360x768 The result is a big chunk of the bottom and right of my screen is black, although it doesn't play well with my window manager. Basically, if I'd just passed size I'd have switched to a lower resolution, and then stretched the image to fit the screen. But since I also passed fb, I've told X that there's only 1360x768 to fill up, so no stretching needed to be done.

I have no idea how to make this play well with my window manager or anyone else's. Maybe you can. Good luck.

EDIT: I'm not actually sure whether you have to pick one of the existing modelines, or if you can just use two arbitrary (width, height) pairs, or if you need to define a modeline before using arbitrary pairs. The above was the only command I tried.

7
  • It's this stretching that I want to avoid.
    – false
    Jun 18, 2015 at 18:55
  • So is this a solution? Jun 18, 2015 at 18:57
  • Freezes my screen... Cntrl-Alt-F1 etc. no longer work. Reboot :-(
    – false
    Jun 18, 2015 at 19:02
  • Check Xorg.0.log. Maybe something else is wrong. Also, you passed 1024x768, right? Jun 18, 2015 at 19:07
  • Yes, I passed it - but I still saw a warning that it does not fit.
    – false
    Jun 18, 2015 at 19:08
3

This helped me a lot, but none of it worked. My grandson dropped his notebook which damaged the LCD on all 4 sides.

The native resolution of the LCD is 1366x768.

So I set it with this:

xrandr --output eDP \
  --mode 1280x720 \
  --set 'underscan' on \
  --set 'underscan vborder' 24 \
  --set 'underscan hborder' 43

Works great!

3
+50

I do not have an external monitor to test, so I will give a few possible leads.

Check the scaling modes available for your screen with xrandr --verbose (ref).

If aiming (e.g.) at moving from 1920x1080 to 1024x768 on HDMI1, try

$ xrandr --output HDMI1 --mode 1024x768 --scale 1.33333333x1 --panning 1024x768

(ref).

Note to Anwar: It would have been probably better to add a new post with the exact settings you want to have. That would also give you the option of posting new info in response to comments/answers.

Related:

  1. https://www.reddit.com/r/archlinux/comments/3rvp8y/xrandr_not_detecting_correct_resolution/
  2. https://unix.stackexchange.com/questions/259647/dual-monitor-setup-with-xrandr-extending-without-with-disabled-scrolling
  3. https://bbs.archlinux.org/viewtopic.php?id=145204
8
  • We have a lot of questions here already. So, creating a new one didn't seem a good option for me. Did you understand what was I trying to do? askubuntu.com/a/640132/61218 this is what I want to achieve, but in external monitor. This answer doesn't work on external monitors
    – Anwar
    Feb 17, 2021 at 11:31
  • @Anwar - I guess I understand what you mean to achieve. What is your output of xrandr --verbose? What is the result of applying each of the solutions proposed in this OP (in particular, mine)? Feb 18, 2021 at 10:56
  • sharetext.me/untitled-71 Here is the output
    – Anwar
    Feb 18, 2021 at 14:54
  • None of the solution worked. Yours one worked in the sense that I've got a lower resolution and a smaller screen, but the fonts are not sharped, pixels are not in 1:1 mapping and the non-display area is not blank
    – Anwar
    Feb 18, 2021 at 14:57
  • 1
    @Anwar - Based on your feedback: 1) Strangely, the output doesn't show scaling modes, not even None. This may be a reason why some of the solutions posted do not work. If you have another monitor that you can use to test, it would help. I just checked on a remote system (via VNC) with an external monitor, and it does have some scaling modes. I cannot use that system to test solutions, though. 2) I will further check the image you posted (which shows some of what you mention, but it doesn't help much with viewing the image quality). But it seems to be on the right track. Feb 18, 2021 at 16:09
0

From reddit post: To change this, you need to know the the name of the output where your monitor is connected (DisplayPort-0 here) and then run this:

xrandr --output DisplayPort-0 --set 'scaling mode' 'Center'
2
  • And I needed to change it back from Center to Full aspect in order to restore full aspect ratio through settings app. But not the second time, this is here in case someone else gets this problem. Mar 25, 2022 at 16:53
  • 1
    Hello. If the comment, as it appears it is, is part of the answer it needs to be added to the answer not as a comment.
    – David
    Mar 26, 2022 at 12:05
-1

You could use another video drive the flgx, and then change the resolution, and set the background to zoom in settings.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .