nvidia - Scale application differently on different monitors - Ubuntu 16.04 - Ask Ubuntu


i have found lot of solid articles/answers topic: https://askubuntu.com/a/555812/574648

https://unix.stackexchange.com/a/213984

https://askubuntu.com/a/662567/574648

and of course:

https://wiki.archlinux.org/index.php/xrandr https://wiki.archlinux.org/index.php/hidpi#multiple_displays

however, i'm still struggling. laptop dell xps15. display 3840x2160. have tried different external monitors, @ moment 1 use dell resolution 1920x1080.

when connect external monitor, of panels become small on 3840x2160 screen. when try scale build-in display, chrome scales, ide scales, displays window along other windows nvidia x server settings stay small. have tried play scale window contents match in display no avail. it's either big on external screen or small on build-in. have tried xrandr scale param gives me:

xrandr --output hdmi-1 --scale 2x2 x error of failed request:  badvalue (integer parameter out of range operation)   major opcode of failed request:  140 (randr)   minor opcode of failed request:  26 (rrsetcrtctransform)   value in failed request:  0x40   serial number of failed request:  38   current serial number in output stream:  39 

ideally, want several windows of same application(let's chrome or intellij idea open on different displays , scale independently on them).

edit: not looking scale menus , title bar, way bars are. want windows contents scaled independently. displays ui forces me either scale windows match built-id display or external display. result:

1) scale window contents match build-in display:

build-in display - looks perfect; external display - huge.

2) scale window contents match external display:

build-in display - small; external display - looks perfect.

i have nvidia driver 340.98 gt218m [nvs 3100m], xubuntu 16.04, results below environment if don't mention otherwise. here my testing environment info, output of:

sudo apt-get install pastebinit; \ sudo sh -c "lsb_release -sd; \  dmidecode -s system-product-name; echo ==; \  lshw -c display; echo ==; \  xrandr --verbose; echo ==; \  cat /etx/x11/xorg.conf" \  | tee ~/desktop/ubuntu-graphic-info.txt \  | pastebinit 

weird , complex stack debug specially using proprietary drivers. of time, unexpected behaviors, may due lack of knowledge current linux graphics stack setup.

  • i wrote this answer before, may introduce debugging tools xtrace
  • avoid running multiple/sequential xrandr commands, after x server reset. same command may have different result depending on previous commands. have noticed --scale (see test case answer, linked above) --transform & --fb. still don't know easy way logout/login. logout/login before making trial.
  • screenshots take pixel size image fb, add camera photos show real results.

method 1: xrandr --output .. --scale hcoefxvcoef or --scale-from wxh

note, works fine me. --scale shortcut --transform, see method3

(vga-0 below dp-3)

xrandr \ --output dp-3 --mode 1280x800 --scale 1x1 --pos 0x0 --fb 2880x2600 \ --output vga-0 --mode 1440x900 --scale 2x2 --pos 0x800 

or:

xrandr \ --output dp-3 --mode 1280x800 --pos 0x0 --fb 2880x2600 \ --output vga-0 --mode 1440x900 --scale-from 2880x1800 --pos 0x800 

framebuffer size calculation:

width = max(1280,1440*2) = 2880 height = 800+900*2 = 2600 

results:

  • nvidia xrandr scale screenshot

    nvidia xrandr scale screenshot

  • nvidia xrandr scale photo

    nvidia xrandr scale photo

method 2: nvidia-settings view port in/out

note, doesn't work well. nvidia-settings not change frame-buffer required size in xrandr command. seems bug (kind of, nvidia has own fb), need more research.

tried replicate xrandr setup directly using nvidia-settings (i used xrandr method1, marked down nvidia setting, reset settings, used nvidia-settings directly):

  1. gksu nvidia-settings → x server display configuration
  2. select external monitor → advanced...
  3. make viewportin & panning double of viewportout (which same original resolution)
  4. leave internal monitor unchanged apply

example:

results: notice mouse pointer, can reach edges of 2nd monitor draws top left quarter.

  • nvidia-settings viewportin screenshot

    nvidia-settings viewportin screenshot

  • nvidia-settings viewportin photo

    nvidia-settings viewportin photo

update: well, workaround trick. add 1px width or height of panning (panning)

    panning:     2881x1800 or 2880x1801 

new results: can't explain this, background corrupted if use below, otherwise every thing seems ok.

  • nvidia-settings viewportin panning trick screenshot

    nvidia-settings viewportin panning trick screenshot - below lowered color quality of above picture make less 2mb imgur limit nvidia-settings viewportin panning trick screenshot - right of

  • nvidia -settings viewportin panning trick photo

    nvidia-settings viewportin panning trick photo - below nvidia-settings viewportin panning trick photo - right of

method 3: xrandr --output .. --transform "h,0,0,0,v,0,0,0,1"

note, works fine me, same method1

(vga-0 right of dp-3)

xrandr \ --output dp-3  -primary --mode 1280x800 --pos 0x0 --transform "1,0,0,0,1,0,0,0,1" --fb 4160x1800 \ --output vga-0 --mode 1440x900 --transform "2,0,0,0,2,0,0,0,1" --right-of dp-3 

framebuffer size calculation:

width = 1280+1440*2 = 4160 height = max(800,900*2) = 1800 

results:

  • nvidia xrandr transform screenshot

    nvidia xrandr transform screenshot

  • nvidia xrandr transform photo

    nvidia xrandr transform photo


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User