From 1d91481d2fc0f9fa2c0c4bdc6a1055ef0fc93e2f Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Mon, 12 Nov 2007 11:56:17 -0500 Subject: [PATCH] Update to c0948a94827c1941d90ddb1db8c383dae4f86c05 --- gntfilesel.c | 1 + gntstyle.h | 1 + gnttextview.c | 16 +++++++++++++--- gntwidget.c | 1 - gntwm.c | 26 ++++++++++---------------- mtn | 2 +- 6 files changed, 26 insertions(+), 21 deletions(-) diff --git a/gntfilesel.c b/gntfilesel.c index 0d1c21b..c46a302 100644 --- a/gntfilesel.c +++ b/gntfilesel.c @@ -265,6 +265,7 @@ local_read_fn(const char *path, GList **files, GError **error) } g_free(fp); } + g_dir_close(dir); *files = g_list_reverse(*files); return TRUE; diff --git a/gntstyle.h b/gntstyle.h index c6a1cd2..4537f1e 100644 --- a/gntstyle.h +++ b/gntstyle.h @@ -122,3 +122,4 @@ void gnt_init_styles(void); */ void gnt_uninit_styles(void); + diff --git a/gnttextview.c b/gnttextview.c index 0b8c293..9edaea4 100644 --- a/gnttextview.c +++ b/gnttextview.c @@ -61,6 +61,8 @@ static gchar *select_start; 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 @@ gnt_text_view_reflow(GntTextView *view) 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 @@ chtype gnt_text_format_flag_to_chtype(GntTextFormatFlags flags) return fl; } -void gnt_text_view_clear(GntTextView *view) +static void reset_text_view(GntTextView *view) { GntTextLine *line; @@ -667,6 +669,14 @@ void gnt_text_view_clear(GntTextView *view) 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 @@ editor_end_cb(int status, gpointer data) 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 --git a/gntwidget.c b/gntwidget.c index 52e842c..05bbc6b 100644 --- a/gntwidget.c +++ b/gntwidget.c @@ -466,7 +466,6 @@ gnt_widget_get_size(GntWidget *wid, int *width, int *height) *width = wid->priv.width + shadow; if (height) *height = wid->priv.height + shadow; - } static void diff --git a/gntwm.c b/gntwm.c index a14a5d6..67f2098 100644 --- a/gntwm.c +++ b/gntwm.c @@ -109,12 +109,10 @@ void 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 @@ refresh_screen(GntBindable *bindable, GList *null) GntWM *wm = GNT_WM(bindable); endwin(); - - 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 @@ gnt_wm_new_window_real(GntWM *wm, GntWidget *widget) 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 @@ gnt_wm_new_window_real(GntWM *wm, GntWidget *widget) 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 @@ void gnt_wm_resize_window(GntWM *wm, GntWidget *widget, int width, int height) { 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 @@ void gnt_wm_resize_window(GntWM *wm, GntWidget *widget, int width, int height) 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); diff --git a/mtn b/mtn index 27c5e2a..a4265bd 100644 --- a/mtn +++ b/mtn @@ -1 +1 @@ -0c9637482b845cc65e95a26e144697391c51133f +c0948a94827c1941d90ddb1db8c383dae4f86c05 -- 2.11.4.GIT