python-mss icon indicating copy to clipboard operation
python-mss copied to clipboard

shot() not working on Ubuntu through VNC

Open cyril94440 opened this issue 7 years ago • 9 comments

Hi there, Thanks for your awesome library which is working like a charm on my local Mac.

However, I need to port it to ubuntu but when I run the shot() function I get the following error : (It's is through VNC, running vnc4server)

X Error of failed request:  BadRequest (invalid request code or no such operation)
  Major opcode of failed request:  149 (RANDR)
  Minor opcode of failed request:  8 (RRGetScreenResources)
  Serial number of failed request:  11
  Current serial number in output stream:  11

Any clue about where it's coming from?

Thanks!

cyril94440 avatar Apr 21 '18 10:04 cyril94440

When you tried on Mac, was it via VNC too?

BoboTiG avatar Apr 21 '18 12:04 BoboTiG

No, directly on my Macbook

On 21 Apr 2018 at 19:11 +0700, Mickaël Schoentgen [email protected], wrote:

When you tried on Mac, was it via VNC too? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

cyril94440 avatar Apr 21 '18 15:04 cyril94440

Could you post the minimal code to reproduce? Also, what is the value of the DISPLAY envar?

BoboTiG avatar Apr 22 '18 06:04 BoboTiG

of course.

echo $DISPLAY Result : :1

code :

import mss
sct = mss.mss()
img = sct.shot()

sct.monitors produces the same error

thanks for you help

cyril94440 avatar Apr 23 '18 12:04 cyril94440

Try this:

    sct = mss.mss(display=':1')

BoboTiG avatar Apr 23 '18 14:04 BoboTiG

Unfortunately I get the exact same error

cyril94440 avatar Apr 24 '18 07:04 cyril94440

There is something wrong/not handled with VNC. I never tested it. It would be great if you have the possibility to investigate, else I will check when I have some free time.

BoboTiG avatar Apr 24 '18 09:04 BoboTiG

Allright, I'll try to find something helpful. Thanks for your help

cyril94440 avatar Apr 25 '18 12:04 cyril94440

Some clues:

  • https://askubuntu.com/a/672000
  • https://lists.gt.net/vnc/list/33382

BoboTiG avatar Jan 29 '19 22:01 BoboTiG