Skip to content
Snippets Groups Projects
Commit b4b3a439 authored by Olivier Fourdan's avatar Olivier Fourdan
Browse files

Fix a bug when window title was < 0

(Old svn revision: 10432)
parent 62136df2
No related branches found
No related tags found
No related merge requests found
......@@ -170,6 +170,15 @@ static void frameCreateTitlePixmap(Client * c, int state, int left, int right, M
}
width = frameWidth(c) - corners[CORNER_TOP_LEFT][ACTIVE].width - corners[CORNER_TOP_RIGHT][ACTIVE].width;
if (width < 1)
{
pm->pixmap = None;
pm->mask = None;
pm->width = 0;
pm->height = 0;
return;
}
if(left < corners[CORNER_TOP_LEFT][ACTIVE].width)
{
left = corners[CORNER_TOP_LEFT][ACTIVE].width;
......@@ -251,7 +260,7 @@ static void frameCreateTitlePixmap(Client * c, int state, int left, int right, M
gc = gdk_gc_new(gpixmap);
gdk_gc_get_values(title_colors[state].gc, &values);
gdk_gc_set_values(gc, &values, GDK_GC_FOREGROUND);
if(w1 > 0)
{
fillRectangle(dpy, pm->pixmap, title[TITLE_1][state].pixmap, 0, 0, w1, frameTop(c));
......
......@@ -65,8 +65,10 @@ gboolean loadPixmap(Display * dpy, MyPixmap * pm, gchar * dir, gchar * file, Xpm
void createPixmap(Display * dpy, MyPixmap * pm, gint width, gint height)
{
DBG("entering createPixmap, width=%i, height=%i\n", width, height);
if ((width < 1) || (height < 1))
{
DBG("Pixmap size invalid\n");
pm->pixmap = None;
pm->mask = None;
pm->width = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment