Undo gmainloop related changes

Revert "Merge pull request #1943 from H3rnand3zzz/gmainloop

This reverts commit 609fde0998, reversing
changes made to 2ec94064ed.

Revert "Merge pull request #1948 from H3rnand3zzz/fix/rl-less-refreshes"

This reverts commit 11762fd2b0, reversing
changes made to 609fde0998.

We have got several issues, that we don't quite see how to solve, with
the merge of the gmainloop PR.

* Slashguard is broken (#1955) (though #1956 could fix that)
* One person reported problems with copy paste selection via mouse
* Some input buffer seems not to be cleared correctly
  It happened that I was debugging profanity used `/connect` and typed
  the password. I then debugged so long that a time out occurred, so
  profanity disconnected. Then it printed "unknown command: $password".

There was something else that I forgot now.

Bottomline is: so far we didn't get it right so we will undo these
changes until someone proposes a working solution.

We got a slight performance increase (apparently noticable when
alt+mouse scrolling) but got too many issues with this change.
This commit is contained in:
Michael Vetter
2024-02-19 17:30:17 +01:00
parent 569e37f018
commit 88b26cfdb9
7 changed files with 29 additions and 74 deletions

View File

@@ -171,41 +171,6 @@ create_input_window(void)
_inp_win_update_virtual();
}
static gboolean
_inp_callback(GIOChannel* source, GIOCondition condition, gpointer data)
{
rl_callback_read_char();
if (rl_line_buffer && rl_line_buffer[0] != '/' && rl_line_buffer[0] != '\0' && rl_line_buffer[0] != '\n') {
chat_state_activity();
}
ui_reset_idle_time();
if (inp_line) {
ProfWin* window = wins_get_current();
if (!cmd_process_input(window, inp_line))
g_main_loop_quit(mainloop);
free(inp_line);
inp_line = NULL;
}
return TRUE;
}
void
inp_add_watch(void)
{
GIOChannel* channel = g_io_channel_unix_new(fileno(rl_instream));
if (g_io_channel_set_encoding(channel, NULL, NULL) != G_IO_STATUS_NORMAL) {
log_error("cannot set NULL encoding");
}
g_io_add_watch(channel, G_IO_IN, _inp_callback, NULL);
}
char*
inp_readline(void)
{

View File

@@ -46,6 +46,5 @@ void inp_win_resize(void);
void inp_put_back(void);
char* inp_get_password(void);
char* inp_get_line(void);
void inp_add_watch(void);
#endif