1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-04 21:12:47 -05:00

Ignore X11 BadMatch errors during cut buffer setup.

This is quite a pain, since it involves inventing an entire new piece
of infrastructure to install a custom Xlib error handler and give it a
queue of things to do. But it fixes a bug in which Unix pterm/PuTTY
crash out at startup if one of the root window's CUT_BUFFERn
properties contains something of a type other than STRING - in
particular, UTF8_STRING is not unheard-of.

For example, run
  xprop -root -format CUT_BUFFER3 8u -set CUT_BUFFER3 "thingy"
and then pterm without this fix would have crashed.
This commit is contained in:
Simon Tatham
2016-03-20 18:16:43 +00:00
parent ca68700570
commit 36ddc57084
4 changed files with 114 additions and 1 deletions

15
unix/x11misc.h Normal file
View File

@ -0,0 +1,15 @@
/*
* x11misc.h: header file for functions that need to refer to Xlib
* data types. Has to be separate from unix.h so that we can include
* it only after including the X headers, which in turn has to be done
* after putty.h has told us whether NOT_X_WINDOWS is defined.
*/
#ifndef NOT_X_WINDOWS
/*
* x11misc.c.
*/
void x11_ignore_error(Display *disp, unsigned char errcode);
#endif