mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 12:58:08 +01:00
wDockAttachIcon paint argument
The function wDockAttachIcon has a new argument. This argument is used to force an icon create if needed.
This commit is contained in:
committed by
Carlos R. Mafra
parent
f38e5e40c8
commit
a3078a5095
@@ -194,6 +194,7 @@ void paint_app_icon(WApplication *wapp)
|
|||||||
WScreen *scr = wapp->main_window_desc->screen_ptr;
|
WScreen *scr = wapp->main_window_desc->screen_ptr;
|
||||||
WDock *clip = scr->workspaces[scr->current_workspace]->clip;
|
WDock *clip = scr->workspaces[scr->current_workspace]->clip;
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
|
Bool update_icon = False;
|
||||||
|
|
||||||
if (!wapp || !wapp->app_icon)
|
if (!wapp || !wapp->app_icon)
|
||||||
return;
|
return;
|
||||||
@@ -209,9 +210,9 @@ void paint_app_icon(WApplication *wapp)
|
|||||||
wapp->app_icon->attracted = 1;
|
wapp->app_icon->attracted = 1;
|
||||||
if (!icon->shadowed) {
|
if (!icon->shadowed) {
|
||||||
icon->shadowed = 1;
|
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 {
|
} else {
|
||||||
/* We must know if the icon is painted in the screen,
|
/* We must know if the icon is painted in the screen,
|
||||||
* because if painted, then PlaceIcon will return the next
|
* 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 */
|
/* icon is trying to be docked */
|
||||||
SlideWindow(icon->core->window, x, y, shad_x, shad_y);
|
SlideWindow(icon->core->window, x, y, shad_x, shad_y);
|
||||||
XUnmapWindow(dpy, scr->dock_shadow);
|
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)
|
if (scr->last_dock->auto_collapse)
|
||||||
collapsed = 0;
|
collapsed = 0;
|
||||||
|
|
||||||
|
|||||||
13
src/dock.c
13
src/dock.c
@@ -577,6 +577,7 @@ static void colectIconsCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
WDock *clip;
|
WDock *clip;
|
||||||
WAppIcon *aicon;
|
WAppIcon *aicon;
|
||||||
int x, y, x_pos, y_pos;
|
int x, y, x_pos, y_pos;
|
||||||
|
Bool update_icon = False;
|
||||||
|
|
||||||
assert(entry->clientdata != NULL);
|
assert(entry->clientdata != NULL);
|
||||||
clip = clickedIcon->dock;
|
clip = clickedIcon->dock;
|
||||||
@@ -593,12 +594,9 @@ static void colectIconsCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
aicon->attracted = 1;
|
aicon->attracted = 1;
|
||||||
if (!aicon->icon->shadowed) {
|
if (!aicon->icon->shadowed) {
|
||||||
aicon->icon->shadowed = 1;
|
aicon->icon->shadowed = 1;
|
||||||
aicon->icon->force_paint = 1;
|
update_icon = True;
|
||||||
/* We don't do an wAppIconPaint() here because it's in
|
|
||||||
* wDockAttachIcon(). -Dan
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
wDockAttachIcon(clip, aicon, x, y);
|
wDockAttachIcon(clip, aicon, x, y, update_icon);
|
||||||
if (clip->collapsed || !clip->mapped)
|
if (clip->collapsed || !clip->mapped)
|
||||||
XUnmapWindow(dpy, aicon->icon->core->window);
|
XUnmapWindow(dpy, aicon->icon->core->window);
|
||||||
}
|
}
|
||||||
@@ -1848,7 +1846,7 @@ int wDockReceiveDNDDrop(WScreen *scr, XEvent *event)
|
|||||||
}
|
}
|
||||||
#endif /* XDND */
|
#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;
|
WWindow *wwin;
|
||||||
int index;
|
int index;
|
||||||
@@ -1856,6 +1854,9 @@ Bool wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y)
|
|||||||
wwin = icon->icon->owner;
|
wwin = icon->icon->owner;
|
||||||
icon->editing = 0;
|
icon->editing = 0;
|
||||||
|
|
||||||
|
if (update_icon)
|
||||||
|
icon->icon->force_paint = 1;
|
||||||
|
|
||||||
if (icon->command == NULL) {
|
if (icon->command == NULL) {
|
||||||
char *command;
|
char *command;
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ void wDockRaise(WDock *dock);
|
|||||||
void wDockRaiseLower(WDock *dock);
|
void wDockRaiseLower(WDock *dock);
|
||||||
void wDockSaveState(WScreen *scr, WMPropList *old_state);
|
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,
|
Bool wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y,
|
||||||
int *ret_x, int *ret_y, int redocking);
|
int *ret_x, int *ret_y, int redocking);
|
||||||
Bool wDockFindFreeSlot(WDock *dock, int *req_x, int *req_y);
|
Bool wDockFindFreeSlot(WDock *dock, int *req_x, int *req_y);
|
||||||
|
|||||||
Reference in New Issue
Block a user