9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.64k stars 326 forks source link

acme/devdraw occasional resize issue under linux/i3 when window created/mapped. #423

Open cjacker opened 4 years ago

cjacker commented 4 years ago

acme sometimes doesn't resize correctly under linux/i3 when window created.

Step to reproduce:

1, not set acme as 'floating window'.

2, start acme, exit.

3, repeat step 2.

Screenshot: acme-wrong-size

Additional:

devdraw/x11-screen.c, in xattach, after 'XCreateWindow' , these is no 'XSelectInput' to listen XEvent immediately(but in xloop).

When window created and mapped, i3wm will config/resize the window immediately, devdraw should listen/receive/process XConfigureEvent to resize window correctly but sometimes xloop did not select input events for window at that time.

I tried:

1, add XSelectInput just after XCreateWindow in xattach. resize works but get a dirty start screen as expected.

or

2, add usleep() after XMapWindow in xattach, wait until xloop select input events. dirty but works.