# HG changeset patch # User Sadrul Habib Chowdhury # Date 1194886434 0 # Node ID 93e69f29bc5f3b3aefd9406b9922b1c8ef34eb90 # Parent b068b2d146d10a86d818d5405a345aa1fe9b09f0# Parent 14f06265d13440e72ef1239fad71a9add019cc2e merge of '45a353a8a7978312260680050564b3a32f0d07aa' and 'c7f6969f2405aa75f2e945cb239e6bf9ff0d6372' diff -r b068b2d146d1 -r 93e69f29bc5f finch/gntblist.c --- a/finch/gntblist.c Mon Nov 12 08:58:25 2007 +0000 +++ b/finch/gntblist.c Mon Nov 12 16:53:54 2007 +0000 @@ -1506,6 +1506,8 @@ { if (text[0] == 27 && text[1] == 0) { /* Escape was pressed */ + if (gnt_tree_is_searching(GNT_TREE(ggblist->tree))) + gnt_bindable_perform_action_named(GNT_BINDABLE(ggblist->tree), "end-search", NULL); remove_peripherals(ggblist); } else if (strcmp(text, GNT_KEY_CTRL_O) == 0) { purple_prefs_set_bool(PREF_ROOT "/showoffline", diff -r b068b2d146d1 -r 93e69f29bc5f finch/libgnt/gnttextview.c --- a/finch/libgnt/gnttextview.c Mon Nov 12 08:58:25 2007 +0000 +++ b/finch/libgnt/gnttextview.c Mon Nov 12 16:53:54 2007 +0000 @@ -61,6 +61,8 @@ static gchar *select_end; static gboolean double_click; +static void reset_text_view(GntTextView *view); + static void gnt_text_view_draw(GntWidget *widget) { @@ -370,7 +372,7 @@ string = view->string; view->string = NULL; - gnt_text_view_clear(view); + reset_text_view(view); view->string = g_string_set_size(view->string, string->len); view->string->len = 0; @@ -654,7 +656,7 @@ return fl; } -void gnt_text_view_clear(GntTextView *view) +static void reset_text_view(GntTextView *view) { GntTextLine *line; @@ -667,6 +669,14 @@ if (view->string) g_string_free(view->string, TRUE); view->string = g_string_new(NULL); +} + +void gnt_text_view_clear(GntTextView *view) +{ + reset_text_view(view); + + g_list_foreach(view->tags, free_tag, NULL); + view->tags = NULL; if (GNT_WIDGET(view)->window) gnt_widget_draw(GNT_WIDGET(view)); @@ -833,7 +843,7 @@ if (status == 0) { char *text = NULL; if (g_file_get_contents(pageditor.file, &text, NULL, NULL)) { - gnt_text_view_clear(pageditor.tv); + reset_text_view(pageditor.tv); gnt_text_view_append_text_with_flags(pageditor.tv, text, GNT_TEXT_FLAG_NORMAL); gnt_text_view_scroll(GNT_TEXT_VIEW(pageditor.tv), 0); g_free(text); diff -r b068b2d146d1 -r 93e69f29bc5f finch/libgnt/gntwidget.c --- a/finch/libgnt/gntwidget.c Mon Nov 12 08:58:25 2007 +0000 +++ b/finch/libgnt/gntwidget.c Mon Nov 12 16:53:54 2007 +0000 @@ -466,7 +466,6 @@ *width = wid->priv.width + shadow; if (height) *height = wid->priv.height + shadow; - } static void diff -r b068b2d146d1 -r 93e69f29bc5f finch/libgnt/gntwm.c --- a/finch/libgnt/gntwm.c Mon Nov 12 08:58:25 2007 +0000 +++ b/finch/libgnt/gntwm.c Mon Nov 12 16:53:54 2007 +0000 @@ -109,12 +109,10 @@ gnt_wm_copy_win(GntWidget *widget, GntNode *node) { WINDOW *src, *dst; - int shadow; if (!node) return; src = widget->window; dst = node->window; - shadow = gnt_widget_has_shadow(widget) ? 1 : 0; copywin(src, dst, node->scroll, 0, 0, 0, getmaxy(dst) - 1, getmaxx(dst) - 1, 0); } @@ -1004,9 +1002,9 @@ GntWM *wm = GNT_WM(bindable); endwin(); + refresh(); - g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, NULL); - refresh(); + g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, GINT_TO_POINTER(TRUE)); g_signal_emit(wm, signals[SIG_TERMINAL_REFRESH], 0); update_screen(wm); gnt_ws_draw_taskbar(wm->cws, TRUE); @@ -1622,13 +1620,11 @@ shadow = FALSE; x = widget->priv.x; y = widget->priv.y; - w = widget->priv.width; - h = widget->priv.height; + w = widget->priv.width + shadow; + h = widget->priv.height + shadow; - getmaxyx(stdscr, maxy, maxx); - maxy -= 1; /* room for the taskbar */ - maxy -= shadow; - maxx -= shadow; + maxx = getmaxx(stdscr); + maxy = getmaxy(stdscr) - 1; /* room for the taskbar */ x = MAX(0, x); y = MAX(0, y); @@ -1639,7 +1635,7 @@ w = MIN(w, maxx); h = MIN(h, maxy); - node->window = newwin(h + shadow, w + shadow, y, x); + node->window = newwin(h, w, y, x); gnt_wm_copy_win(widget, node); } #endif @@ -1884,9 +1880,8 @@ { gboolean ret = TRUE; GntNode *node; - int shadow; int maxx, maxy; - + while (widget->parent) widget = widget->parent; node = g_hash_table_lookup(wm->nodes, widget); @@ -1900,9 +1895,8 @@ gnt_widget_set_size(widget, width, height); gnt_widget_draw(widget); - shadow = gnt_widget_has_shadow(widget) ? 1 : 0; - maxx = getmaxx(stdscr) - shadow; - maxy = getmaxy(stdscr) - 1 - shadow; + maxx = getmaxx(stdscr); + maxy = getmaxy(stdscr) - 1; height = MIN(height, maxy); width = MIN(width, maxx); wresize(node->window, height, width);