From 3df8f4ed7e05de532ff251572271667e550f3a42 Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Thu, 20 Dec 2012 01:50:00 +0000 Subject: [PATCH] Fixing long standing issue with tray space when tray icon gets destroyed. When tray icon gets destroyed, space it was occupying would not be cleaned, yielding wholes inside taskbar. Fixing by explicitly hiding and deleting FLTK window which holded application tray window. --- ede-panel/applets/system-tray/Tray.cpp | 8 ++++++-- ede-panel/applets/taskbar/Taskbar.cpp | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ede-panel/applets/system-tray/Tray.cpp b/ede-panel/applets/system-tray/Tray.cpp index 5baae4a..1fbe885 100644 --- a/ede-panel/applets/system-tray/Tray.cpp +++ b/ede-panel/applets/system-tray/Tray.cpp @@ -205,7 +205,8 @@ void Tray::add_to_tray(Fl_Widget *win) { w(w() + win->w() + TRAY_ICONS_SPACE); distribute_children(); - redraw(); + + //redraw(); EDE_PANEL_GET_PANEL_OBJECT(this)->relayout(); } @@ -213,10 +214,13 @@ void Tray::remove_from_tray(Fl_Widget *win) { remove(win); w(w() - win->w() - TRAY_ICONS_SPACE); + win->hide(); + delete win; + distribute_children(); - redraw(); EDE_PANEL_GET_PANEL_OBJECT(this)->relayout(); + EDE_PANEL_GET_PANEL_OBJECT(this)->redraw(); } int Tray::handle(int e) { diff --git a/ede-panel/applets/taskbar/Taskbar.cpp b/ede-panel/applets/taskbar/Taskbar.cpp index bb5c064..b231fc6 100644 --- a/ede-panel/applets/taskbar/Taskbar.cpp +++ b/ede-panel/applets/taskbar/Taskbar.cpp @@ -186,6 +186,8 @@ void Taskbar::update_task_buttons(void) { XSelectInput(fl_display, wins[i], PropertyChangeMask | StructureNotifyMask); b->callback((Fl_Callback*)button_cb, this); add(b); + + need_full_redraw = true; } }