1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge branch 'master' into inp-utf8

This commit is contained in:
James Booth 2015-01-15 13:31:13 +00:00
commit a7dff070a4
4 changed files with 10 additions and 10 deletions

View File

@ -90,15 +90,12 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
ui_update(); ui_update();
log_info("Starting main event loop");
jabber_conn_status_t conn_status = jabber_get_connection_status(); jabber_conn_status_t conn_status = jabber_get_connection_status();
int size = 0;
gboolean read_input = TRUE; gboolean read_input = TRUE;
gboolean cmd_result = TRUE; gboolean cmd_result = TRUE;
log_info("Starting main event loop");
while(cmd_result == TRUE) { while(cmd_result == TRUE) {
size = 0;
read_input = TRUE; read_input = TRUE;
while(read_input) { while(read_input) {
conn_status = jabber_get_connection_status(); conn_status = jabber_get_connection_status();
@ -106,7 +103,7 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
_handle_idle_time(); _handle_idle_time();
} }
read_input = ui_get_char(inp, &size); read_input = ui_get_char(inp);
#ifdef HAVE_LIBOTR #ifdef HAVE_LIBOTR
otr_poll(); otr_poll();

View File

@ -73,6 +73,7 @@
#include "xmpp/xmpp.h" #include "xmpp/xmpp.h"
static char *win_title; static char *win_title;
static int inp_size;
#ifdef HAVE_LIBXSS #ifdef HAVE_LIBXSS
static Display *display; static Display *display;
@ -108,6 +109,7 @@ ui_init(void)
display = XOpenDisplay(0); display = XOpenDisplay(0);
#endif #endif
ui_idle_time = g_timer_new(); ui_idle_time = g_timer_new();
inp_size = 0;
ProfWin *window = wins_get_current(); ProfWin *window = wins_get_current();
win_update_virtual(window); win_update_virtual(window);
} }
@ -175,10 +177,10 @@ ui_close(void)
} }
gboolean gboolean
ui_get_char(char *input, int *size) ui_get_char(char *input)
{ {
int result = 0; int result = 0;
wint_t ch = inp_get_char(input, size, &result); wint_t ch = inp_get_char(input, &inp_size, &result);
_win_handle_switch(ch); _win_handle_switch(ch);
ProfWin *current = wins_get_current(); ProfWin *current = wins_get_current();
win_handle_page(current, ch, result); win_handle_page(current, ch, result);
@ -194,7 +196,8 @@ ui_get_char(char *input, int *size)
} }
if (ch == '\n') { if (ch == '\n') {
input[*size++] = '\0'; input[inp_size++] = '\0';
inp_size = 0;
} }
return (ch != '\n'); return (ch != '\n');

View File

@ -229,7 +229,7 @@ void ui_update_presence(const resource_presence_t resource_presence,
void ui_about(void); void ui_about(void);
void ui_statusbar_new(const int win); void ui_statusbar_new(const int win);
gboolean ui_get_char(char *input, int *size); gboolean ui_get_char(char *input);
void ui_input_clear(void); void ui_input_clear(void);
void ui_input_nonblocking(gboolean); void ui_input_nonblocking(gboolean);
void ui_replace_input(char *input, const char * const new_input, int *size); void ui_replace_input(char *input, const char * const new_input, int *size);

View File

@ -323,7 +323,7 @@ void ui_update_presence(const resource_presence_t resource_presence,
void ui_about(void) {} void ui_about(void) {}
void ui_statusbar_new(const int win) {} void ui_statusbar_new(const int win) {}
gboolean ui_get_char(char *input, int *size) gboolean ui_get_char(char *input)
{ {
return FALSE; return FALSE;
} }