mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Update icon on demand
This commit is contained in:
parent
bd5dbb7ed9
commit
eebda8a375
@ -26,6 +26,7 @@ EDELIB_NS_USING(NETWM_CHANGED_ACTIVE_WINDOW)
|
||||
EDELIB_NS_USING(NETWM_CHANGED_CURRENT_WORKSPACE)
|
||||
EDELIB_NS_USING(NETWM_CHANGED_WINDOW_LIST)
|
||||
EDELIB_NS_USING(NETWM_CHANGED_WINDOW_NAME)
|
||||
EDELIB_NS_USING(NETWM_CHANGED_WINDOW_ICON)
|
||||
EDELIB_NS_USING(WM_WINDOW_STATE_ICONIC)
|
||||
|
||||
static void button_cb(TaskButton *b, void *t) {
|
||||
@ -58,6 +59,12 @@ static void net_event_cb(int action, Window xid, void *data) {
|
||||
tt->update_active_button();
|
||||
return;
|
||||
}
|
||||
|
||||
if(action == NETWM_CHANGED_WINDOW_ICON) {
|
||||
Taskbar *tt = (Taskbar*)data;
|
||||
tt->update_child_icon(xid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Taskbar::Taskbar() : Fl_Group(0, 0, 40, 25), curr_active(NULL), prev_active(NULL), panel(NULL) {
|
||||
@ -243,6 +250,21 @@ void Taskbar::update_child_title(Window xid) {
|
||||
}
|
||||
}
|
||||
|
||||
void Taskbar::update_child_icon(Window xid) {
|
||||
E_RETURN_IF_FAIL(xid >= 0);
|
||||
|
||||
TaskButton *o;
|
||||
for(int i = 0; i < children(); i++) {
|
||||
o = (TaskButton*)child(i);
|
||||
|
||||
if(o->get_window_xid() == xid) {
|
||||
o->update_image_from_xid();
|
||||
o->redraw();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Taskbar::panel_redraw(void) {
|
||||
E_RETURN_IF_FAIL(panel != NULL);
|
||||
panel->redraw();
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
void update_active_button(int xid = -1);
|
||||
void activate_window(TaskButton *b);
|
||||
void update_child_title(Window xid);
|
||||
void update_child_icon(Window xid);
|
||||
|
||||
void panel_redraw(void);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user