[Pidgin] #15664: Finch internal clipboard window does not stretch to fill the terminal

Pidgin trac at pidgin.im
Fri May 6 01:01:31 EDT 2016


#15664: Finch internal clipboard window does not stretch to fill the terminal
-------------------------+----------------------------------
 Reporter:  risujin      |       Owner:  sadrul
     Type:  defect       |      Status:  new
Milestone:               |   Component:  finch (gnt/ncurses)
  Version:  2.10.6       |  Resolution:
 Keywords:  copy window  |
-------------------------+----------------------------------

Comment (by eth4-global):

 In case anyone is still interested.
 I've managed to track down two causes of the problem.
 First, in finch/libgnt/gntwm.c, in function toggle_clipboard there are
 these three lines:
 {{{
 gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" "));
 gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(text));
 gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" "));
 }}}
 Not sure why, but two spaces are deliberately put before and after the
 clipboard content. However, removing them is not enough, there will always
 be an additional space if the clipboard content consists of multiple
 lines. This is because the following piece of code in
 finch/libgnt/gntutils.c (function gnt_util_get_text_bound):
 {{{
 if (width)
   *width = max + (count > 1);
 }}}
 Not sure why is the width extended. Commenting out the (count > 1) fixes
 the trailing space for multi-line clipboard content. But it might break
 something else somewhere (didn't test).

 Now the last problem occurs if the text is multi-line, but shorter than
 the width of the terminal. As the text spans only to a part of the
 terminal, terminal copy/paste method will pick up the text sticking out on
 the right side of the clipboard window.
 I don't know what would be the right way to fix that. Of course it could
 be done by altering the text in the clipboard by padding any of the lines
 with spaces. But I hope there is a way to that easier.

--
Ticket URL: <https://developer.pidgin.im/ticket/15664#comment:1>
Pidgin <https://pidgin.im>
Pidgin


More information about the Tracker mailing list