rendering engine : _on_change_layout() called when pos/size changed
git-svn-id: http://tint2.googlecode.com/svn/trunk@565 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
@@ -344,9 +344,6 @@ void draw_task (void *obj, cairo_t *c)
|
||||
Panel *panel = (Panel*)tsk->area.panel;
|
||||
//printf("draw_task %d %d\n", tsk->area.posx, tsk->area.posy);
|
||||
|
||||
long value[] = { panel->posx+tsk->area.posx, panel->posy+tsk->area.posy, tsk->area.width, tsk->area.height };
|
||||
XChangeProperty (server.dsp, tsk->win, server.atom._NET_WM_ICON_GEOMETRY, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)value, 4);
|
||||
|
||||
if (panel->g_task.text) {
|
||||
/* Layout */
|
||||
layout = pango_cairo_create_layout (c);
|
||||
@@ -389,6 +386,19 @@ void draw_task (void *obj, cairo_t *c)
|
||||
}
|
||||
|
||||
|
||||
void on_change_task (void *obj)
|
||||
{
|
||||
Task *tsk = obj;
|
||||
Panel *panel = (Panel*)tsk->area.panel;
|
||||
|
||||
long value[] = { panel->posx+tsk->area.posx, panel->posy+tsk->area.posy, tsk->area.width, tsk->area.height };
|
||||
XChangeProperty (server.dsp, tsk->win, server.atom._NET_WM_ICON_GEOMETRY, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)value, 4);
|
||||
|
||||
// reset Pixmap when position/size changed
|
||||
set_task_redraw(tsk);
|
||||
}
|
||||
|
||||
|
||||
Task *next_task(Task *tsk)
|
||||
{
|
||||
if (tsk == 0)
|
||||
|
||||
@@ -69,6 +69,7 @@ Task *add_task (Window win);
|
||||
void remove_task (Task *tsk);
|
||||
|
||||
void draw_task (void *obj, cairo_t *c);
|
||||
void on_change_task (void *obj);
|
||||
|
||||
void get_icon (Task *tsk);
|
||||
void get_title(Task *tsk);
|
||||
|
||||
@@ -125,6 +125,7 @@ void init_taskbar_panel(void *p)
|
||||
// task
|
||||
panel->g_task.area.size_mode = SIZE_BY_LAYOUT;
|
||||
panel->g_task.area._draw_foreground = draw_task;
|
||||
panel->g_task.area._on_change_layout = on_change_task;
|
||||
panel->g_task.area.redraw = 1;
|
||||
panel->g_task.area.on_screen = 1;
|
||||
if ((panel->g_task.config_asb_mask & (1<<TASK_NORMAL)) == 0) {
|
||||
@@ -296,7 +297,6 @@ int resize_taskbar(void *obj)
|
||||
for (l = taskbar->area.list; l ; l = l->next) {
|
||||
tsk = l->data;
|
||||
if (!tsk->area.on_screen) continue;
|
||||
//set_task_redraw(tsk); // always redraw task, because the background could have changed (taskbar_active_id)
|
||||
tsk->area.width = pixel_width;
|
||||
|
||||
if (modulo_width) {
|
||||
@@ -331,7 +331,6 @@ int resize_taskbar(void *obj)
|
||||
for (l = taskbar->area.list; l ; l = l->next) {
|
||||
tsk = l->data;
|
||||
if (!tsk->area.on_screen) continue;
|
||||
//set_task_redraw(tsk); // always redraw task, because the background could have changed (taskbar_active_id)
|
||||
tsk->area.height = pixel_height;
|
||||
|
||||
if (modulo_height) {
|
||||
|
||||
Reference in New Issue
Block a user