Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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)

share|improve this question
1  
Look into xrandr on Ask Ubuntu –  don.joey Mar 6 '13 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 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 at 14:56
    
@false, Could you post your hardware/drive setup lshw -C display ? –  Sneetsher Jun 22 at 0:21
    
@Sneetsher: See above! –  false Jun 22 at 10:37

3 Answers 3

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".

share|improve this answer
    
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 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 at 20:48
    
Both did not work –  false Jun 25 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 at 10:18

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.

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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.