diff options
| author | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-01-06 12:58:59 +0300 |
|---|---|---|
| committer | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-01-06 12:58:59 +0300 |
| commit | 68d19d800cd037a8efb210c6ebc52cf23c11ad5e (patch) | |
| tree | 72baba9e31a8ee1b8b1c4a6fcd647e8fedd3aab0 /src | |
| parent | 5b11e487cc24779d32723f9736b06b939e64e655 (diff) | |
PDCurses/XCurses: fixed crashes on startup
Must not (and don't have to) probe the clipboard on startup.
We just assume there always is a clipboard.
Diffstat (limited to 'src')
| -rw-r--r-- | src/interface-curses/interface.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index 0764db3..bc48b5e 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -1229,7 +1229,20 @@ teco_interface_info_update_buffer(const teco_buffer_t *buffer) * default clipboard ("~") as we do not know whether * it corresponds to the X11 PRIMARY, SECONDARY or * CLIPBOARD selections. + * + * On XCurses we must not (and don't have to) probe + * the clipboard as it would be before Xinitscr(). */ +#ifdef XCURSES + +static void +teco_interface_init_clipboard(void) +{ + teco_qreg_table_replace(&teco_qreg_table_globals, teco_qreg_clipboard_new("")); +} + +#else /* XCURSES */ + static void teco_interface_init_clipboard(void) { @@ -1254,6 +1267,8 @@ teco_interface_init_clipboard(void) teco_qreg_table_replace(&teco_qreg_table_globals, teco_qreg_clipboard_new("")); } +#endif /* !XCURSES */ + gboolean teco_interface_set_clipboard(const gchar *name, const gchar *str, gsize str_len, GError **error) { |
