evdi icon indicating copy to clipboard operation
evdi copied to clipboard

Change resolution of evdi screen with randr.

Open sysescool opened this issue 1 month ago • 0 comments

Try with:

cvt 777 800
xrandr --newmode  "784x800_60.00"   51.00  784 824 904 1024  800 803 813 831 -hsync +vsyn
xrandr --addmode DVI-I-1-1 784x800_60.00  && xrandr --output DVI-I-1-1 --mode 784x800_60.00  

It's failed.

In mode_changed_handler callback:

  • firstly, received callback with param mode: 784 800 60
  • print error:
    • [libevdi] Ioctl grabpix error: Invalid argument
    • [libevdi] Grabbing pixels for buffer 0 failed.
    • [libevdi] Ignore if caused by change of mode.
  • Immediately afterwards, received callback with prarm mode: 1920 1080 60, which is the resolution before changing the resolution by xrandr.
  • the finally result is previous 1920 1080 60.

However, If I tried with:

cvt 600 888
xrandr --newmode "600x888_60.00"   43.75  600 640 696 792  888 891 901 922 -hsync +vsync
xrandr --addmode DVI-I-1-1 600x888_60.00  && sleep 5 && xrandr --output DVI-I-1-1 --mode 600x888_60.00

Note that there is a sleep 5 here. the final resolution is 600x888 60. It's worked.

This is a demonstration; in reality, I use libXrandr to call it via the C API.

I don't know what's happening at the underlying level, or if there's some synchronization mechanism instead of sleeping for a period of time.

sysescool avatar Nov 06 '25 02:11 sysescool