Remove _NET_WM_ICON_GEOMETRY for hidden task buttons (issue #634)

This commit is contained in:
o9000 2017-04-08 13:50:49 +02:00
parent 87ca207107
commit 8917a4d15b

View file

@ -289,7 +289,12 @@ void task_update_icon(Task *task)
icon_data[j] = tmp_data[j]; icon_data[j] = tmp_data[j];
img = imlib_create_image_using_copied_data(w, h, icon_data); img = imlib_create_image_using_copied_data(w, h, icon_data);
if (img) if (img)
fprintf(stderr, "%s: Got %dx%d icon via _NET_WM_ICON for %s\n", __FUNCTION__, w, h, task->title ? task->title : "task"); fprintf(stderr,
"%s: Got %dx%d icon via _NET_WM_ICON for %s\n",
__FUNCTION__,
w,
h,
task->title ? task->title : "task");
XFree(data); XFree(data);
} }
} }
@ -308,7 +313,12 @@ void task_update_icon(Task *task)
imlib_context_set_drawable(hints->icon_pixmap); imlib_context_set_drawable(hints->icon_pixmap);
img = imlib_create_image_from_drawable(hints->icon_mask, 0, 0, w, h, 0); img = imlib_create_image_from_drawable(hints->icon_mask, 0, 0, w, h, 0);
if (img) if (img)
fprintf(stderr, "%s: Got %dx%d pixmap icon via WM_HINTS for %s\n", __FUNCTION__, w, h, task->title ? task->title : "task"); fprintf(stderr,
"%s: Got %dx%d pixmap icon via WM_HINTS for %s\n",
__FUNCTION__,
w,
h,
task->title ? task->title : "task");
} }
XFree(hints); XFree(hints);
} }
@ -454,22 +464,22 @@ void task_dump_geometry(void *obj, int indent)
Panel *panel = (Panel *)task->area.panel; Panel *panel = (Panel *)task->area.panel;
fprintf(stderr, fprintf(stderr,
"%*sText: x = %d, y = %d, w = %d, h = %d, align = %s, text = %s\n", "%*sText: x = %d, y = %d, w = %d, h = %d, align = %s, text = %s\n",
indent, indent,
"", "",
(int)panel->g_task.text_posx, (int)panel->g_task.text_posx,
(int)task->_text_posy, (int)task->_text_posy,
task->_text_width, task->_text_width,
task->_text_height, task->_text_height,
panel->g_task.centered ? "center" : "left", panel->g_task.centered ? "center" : "left",
task->title); task->title);
fprintf(stderr, fprintf(stderr,
"%*sIcon: x = %d, y = %d, w = h = %d\n", "%*sIcon: x = %d, y = %d, w = h = %d\n",
indent, indent,
"", "",
task->_icon_x, task->_icon_x,
task->_icon_y, task->_icon_y,
panel->g_task.icon_size1); panel->g_task.icon_size1);
} }
int task_compute_desired_size(void *obj) int task_compute_desired_size(void *obj)
@ -485,15 +495,24 @@ void on_change_task(void *obj)
Task *task = (Task *)obj; Task *task = (Task *)obj;
Panel *panel = (Panel *)task->area.panel; Panel *panel = (Panel *)task->area.panel;
long value[] = {panel->posx + task->area.posx, panel->posy + task->area.posy, task->area.width, task->area.height}; if (task->area.on_screen) {
XChangeProperty(server.display, long value[] = {panel->posx + task->area.posx,
task->win, panel->posy + task->area.posy,
server.atom._NET_WM_ICON_GEOMETRY, task->area.width,
XA_CARDINAL, task->area.height};
32, XChangeProperty(server.display,
PropModeReplace, task->win,
(unsigned char *)value, server.atom._NET_WM_ICON_GEOMETRY,
4); XA_CARDINAL,
32,
PropModeReplace,
(unsigned char *)value,
4);
} else {
XDeleteProperty(server.display,
task->win,
server.atom._NET_WM_ICON_GEOMETRY);
}
} }
Task *find_active_task(Task *current_task) Task *find_active_task(Task *current_task)