fix(popup): fit the current X11 monitor
This commit is contained in:
8
font.c
8
font.c
@@ -13,8 +13,8 @@ resetlayout(void)
|
||||
pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
textclear(void)
|
||||
void
|
||||
textclose(void)
|
||||
{
|
||||
if(layout != nil)
|
||||
g_object_unref(layout);
|
||||
@@ -52,7 +52,7 @@ setfont(void)
|
||||
int
|
||||
textinit(void)
|
||||
{
|
||||
textclear();
|
||||
textclose();
|
||||
fontmap = pango_cairo_font_map_new();
|
||||
if(fontmap == nil){
|
||||
fprint(2, "strans: popup: can't initialize PangoCairo\n");
|
||||
@@ -64,7 +64,7 @@ textinit(void)
|
||||
layout = pango_layout_new(context);
|
||||
if(context == nil || layout == nil){
|
||||
fprint(2, "strans: popup: can't create text layout\n");
|
||||
textclear();
|
||||
textclose();
|
||||
return 0;
|
||||
}
|
||||
pango_layout_set_single_paragraph_mode(layout, TRUE);
|
||||
|
||||
Reference in New Issue
Block a user