From a3078a5095af096720cb604e3534c1a6451b54f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sat, 10 Nov 2012 20:25:10 +0100 Subject: [PATCH] wDockAttachIcon paint argument The function wDockAttachIcon has a new argument. This argument is used to force an icon create if needed. --- src/appicon.c | 7 ++++--- src/dock.c | 13 +++++++------ src/dock.h | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/appicon.c b/src/appicon.c index 77c5e304..8a6841d9 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -194,6 +194,7 @@ void paint_app_icon(WApplication *wapp) WScreen *scr = wapp->main_window_desc->screen_ptr; WDock *clip = scr->workspaces[scr->current_workspace]->clip; int x = 0, y = 0; + Bool update_icon = False; if (!wapp || !wapp->app_icon) return; @@ -209,9 +210,9 @@ void paint_app_icon(WApplication *wapp) wapp->app_icon->attracted = 1; if (!icon->shadowed) { icon->shadowed = 1; - icon->force_paint = 1; + update_icon = True; } - wDockAttachIcon(clip, wapp->app_icon, x, y); + wDockAttachIcon(clip, wapp->app_icon, x, y, update_icon); } else { /* We must know if the icon is painted in the screen, * because if painted, then PlaceIcon will return the next @@ -849,7 +850,7 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event) /* icon is trying to be docked */ SlideWindow(icon->core->window, x, y, shad_x, shad_y); XUnmapWindow(dpy, scr->dock_shadow); - docked = wDockAttachIcon(scr->last_dock, aicon, ix, iy); + docked = wDockAttachIcon(scr->last_dock, aicon, ix, iy, False); if (scr->last_dock->auto_collapse) collapsed = 0; diff --git a/src/dock.c b/src/dock.c index 58ef31a3..e6a575bf 100644 --- a/src/dock.c +++ b/src/dock.c @@ -577,6 +577,7 @@ static void colectIconsCallback(WMenu *menu, WMenuEntry *entry) WDock *clip; WAppIcon *aicon; int x, y, x_pos, y_pos; + Bool update_icon = False; assert(entry->clientdata != NULL); clip = clickedIcon->dock; @@ -593,12 +594,9 @@ static void colectIconsCallback(WMenu *menu, WMenuEntry *entry) aicon->attracted = 1; if (!aicon->icon->shadowed) { aicon->icon->shadowed = 1; - aicon->icon->force_paint = 1; - /* We don't do an wAppIconPaint() here because it's in - * wDockAttachIcon(). -Dan - */ + update_icon = True; } - wDockAttachIcon(clip, aicon, x, y); + wDockAttachIcon(clip, aicon, x, y, update_icon); if (clip->collapsed || !clip->mapped) XUnmapWindow(dpy, aicon->icon->core->window); } @@ -1848,7 +1846,7 @@ int wDockReceiveDNDDrop(WScreen *scr, XEvent *event) } #endif /* XDND */ -Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y) +Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y, Bool update_icon) { WWindow *wwin; int index; @@ -1856,6 +1854,9 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y) wwin = icon->icon->owner; icon->editing = 0; + if (update_icon) + icon->icon->force_paint = 1; + if (icon->command == NULL) { char *command; diff --git a/src/dock.h b/src/dock.h index be100959..08ae8de4 100644 --- a/src/dock.h +++ b/src/dock.h @@ -79,7 +79,7 @@ void wDockRaise(WDock *dock); void wDockRaiseLower(WDock *dock); void wDockSaveState(WScreen *scr, WMPropList *old_state); -Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y); +Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y, Bool update_icon); Bool wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y, int *ret_x, int *ret_y, int redocking); Bool wDockFindFreeSlot(WDock *dock, int *req_x, int *req_y); -- 2.11.4.GIT