From d1ee3cadb3466f4b72544b4997713da94c92d994 Mon Sep 17 00:00:00 2001 From: dan Date: Sun, 26 Sep 1999 01:29:04 +0000 Subject: [PATCH] Fixed crashing bug related to omnipresent icons in clip (fixes bug #1167) --- ChangeLog | 1 + src/appicon.c | 3 ++- src/dock.c | 26 ++++++++++---------------- src/dockedapp.c | 15 --------------- 4 files changed, 13 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99035af2..f157c7c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ Changes since version 0.61.0: - fixed problem with fonts in WINGs (Masahide -mac- NODA ) - fixed crashing bug when saving session information. +- fixed crashing bug related to onmipresent icons in Clip Changes since version 0.60.0: diff --git a/src/appicon.c b/src/appicon.c index 0c81aac3..87d47a98 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -402,7 +402,8 @@ wAppIconPaint(WAppIcon *aicon) # ifdef WS_INDICATOR - if (aicon->docked && scr->dock && aicon->yindex==0) + if (aicon->docked && scr->dock && scr->dock==aicon->dock && + aicon->yindex==0) updateDockNumbers(scr); # endif if (scr->dock_dots && aicon->docked && !aicon->running diff --git a/src/dock.c b/src/dock.c index a559e4fc..35f504b4 100644 --- a/src/dock.c +++ b/src/dock.c @@ -2417,6 +2417,11 @@ wDockDetach(WDock *dock, WAppIcon *icon) DestroyDockAppSettingsPanel(icon->panel); } + /* This must be called before icon->dock is set to NULL. + * Don't move it. -Dan + */ + wClipMakeIconOmnipresent(icon, False); + icon->docked = 0; icon->dock = NULL; icon->attracted = 0; @@ -2425,11 +2430,6 @@ wDockDetach(WDock *dock, WAppIcon *icon) icon->icon->force_paint = 1; } - /* This must be called before dock->icon_array[index] is set to NULL. - * Don't move it. -Dan - */ - wClipMakeIconOmnipresent(icon, False); - /* deselect the icon */ if (icon->icon->selected) wIconSelect(icon->icon); @@ -4441,8 +4441,10 @@ wClipMakeIconOmnipresent(WAppIcon *aicon, int omnipresent) WAppIconChain *new_entry, *tmp, *tmp1; int status = WO_SUCCESS; - if (aicon->dock == scr->dock || aicon == scr->clip_icon) + if ((!wPreferences.flags.nodock && aicon->dock == scr->dock) || + aicon == scr->clip_icon) { return WO_NOT_APPLICABLE; + } if (aicon->omnipresent == omnipresent) return WO_SUCCESS; @@ -4452,16 +4454,8 @@ wClipMakeIconOmnipresent(WAppIcon *aicon, int omnipresent) aicon->omnipresent = 1; new_entry = wmalloc(sizeof(WAppIconChain)); new_entry->aicon = aicon; - new_entry->next = NULL; - if (!scr->global_icons) { - scr->global_icons = new_entry; - } else { - tmp = scr->global_icons; - while (tmp->next) - tmp = tmp->next; - - tmp->next = new_entry; - } + new_entry->next = scr->global_icons; + scr->global_icons = new_entry; scr->global_icon_count++; } else { aicon->omnipresent = 0; diff --git a/src/dockedapp.c b/src/dockedapp.c index 9bb6bb06..5e247ad4 100644 --- a/src/dockedapp.c +++ b/src/dockedapp.c @@ -244,21 +244,6 @@ panelBtnCallback(WMWidget *self, void *data) updateDNDCommand(panel->editedIcon, text); #endif -#ifdef dan_remove_later - omnipresent = WMGetButtonSelected(panel->omnipresentBtn); - if (wClipMakeIconOmnipresent(panel->editedIcon, omnipresent) == - WO_FAILED) { - wMessageDialog(panel->wwin->screen_ptr, _("Error"), - _("Sorry, icon cannot be made omnipresent. " - "Please make sure that no other icon is " - "docked in the same position on the other " - "workspaces, and the Clip is not full in " - "some workspace, then try again."), - _("OK"), NULL, NULL); - return; - } -#endif - panel->editedIcon->auto_launch = WMGetButtonSelected(panel->autoLaunchBtn); }