Hide WAppIcon fields in favor of accessors.

This commit is contained in:
2025-09-01 21:20:22 -04:00
parent 18db22063c
commit 455aa71c19
18 changed files with 979 additions and 701 deletions
+13 -11
View File
@@ -1833,8 +1833,10 @@ void wHideApplication(WApplication *wapp)
if (wlist->flags.focused)
hadfocus = 1;
if (wApplicationGetAppIcon(wapp)) {
hideWindow(wApplicationGetAppIcon(wapp)->icon, wApplicationGetAppIcon(wapp)->x_pos,
wApplicationGetAppIcon(wapp)->y_pos, wlist, animate);
hideWindow(wAppIconGetIcon(wApplicationGetAppIcon(wapp)),
wAppIconGetXPos(wApplicationGetAppIcon(wapp)),
wAppIconGetYPos(wApplicationGetAppIcon(wapp)),
wlist, animate);
animate = False;
}
}
@@ -1968,8 +1970,8 @@ void wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurren
}
WMPostNotificationName(WMNChangedState, wlist, "hide");
} else if (wlist->flags.hidden) {
unhideWindow(wApplicationGetAppIcon(wapp)->icon, wApplicationGetAppIcon(wapp)->x_pos,
wApplicationGetAppIcon(wapp)->y_pos, wlist, animate, bringToCurrentWS);
unhideWindow(wAppIconGetIcon(wApplicationGetAppIcon(wapp)), wAppIconGetXPos(wApplicationGetAppIcon(wapp)),
wAppIconGetYPos(wApplicationGetAppIcon(wapp)), wlist, animate, bringToCurrentWS);
animate = False;
} else {
if (bringToCurrentWS && wlist->frame->workspace != scr->current_workspace)
@@ -2128,20 +2130,20 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
/* arrange application icons */
aicon = scr->app_icon_list;
/* reverse them to avoid unnecessarily sliding of icons */
while (aicon && aicon->next)
aicon = aicon->next;
while (aicon && wAppIconGetNext(aicon))
aicon = wAppIconGetNext(aicon);
while (aicon) {
if (!aicon->docked) {
if (!wAppIconIsDocked(aicon)) {
/* CHECK: can icon be NULL here ? */
/* The intention here is to place the AppIcon on the head that
* contains most of the applications _main_ window. */
head = wGetHeadForWindow(aicon->icon->owner);
head = wGetHeadForWindow(wAppIconGetIcon(aicon)->owner);
if (aicon->x_pos != X || aicon->y_pos != Y) {
if (wAppIconGetXPos(aicon) != X || wAppIconGetYPos(aicon) != Y) {
#ifdef USE_ANIMATIONS
if (!wPreferences.no_animations)
slide_window(aicon->icon->core->window, aicon->x_pos, aicon->y_pos, X, Y);
slide_window(wAppIconGetIcon(aicon)->core->window, wAppIconGetXPos(aicon), wAppIconGetYPos(aicon), X, Y);
#endif /* USE_ANIMATIONS */
}
wAppIconMove(aicon, X, Y);
@@ -2151,7 +2153,7 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
vars[head].si++;
}
}
aicon = aicon->prev;
aicon = wAppIconGetPrev(aicon);
}
/* arrange miniwindows */
+249
View File
@@ -55,6 +55,255 @@
#include "xdnd.h"
#endif
struct WAppIcon {
short xindex;
short yindex;
struct WAppIcon *next;
struct WAppIcon *prev;
WIcon *icon;
int x_pos, y_pos; /* absolute screen coordinate */
char *command; /* command used to launch app */
#ifdef USE_DOCK_XDND
char *dnd_command; /* command to use when something is */
/* dropped on us */
#endif
char *paste_command; /* command to run when
* something is pasted */
char *wm_class;
char *wm_instance;
pid_t pid; /* for apps launched from the dock */
Window main_window;
struct WDock *dock; /* In which dock is docked. */
struct _AppSettingsPanel *panel; /* Settings Panel */
unsigned int docked:1;
unsigned int omnipresent:1; /* If omnipresent when
* docked in clip */
unsigned int attracted:1; /* If it was attracted by the clip */
unsigned int launching:1;
unsigned int running:1; /* application is already running */
unsigned int relaunching:1; /* launching 2nd instance */
unsigned int forced_dock:1;
unsigned int auto_launch:1; /* launch app on startup */
unsigned int remote_start:1;
unsigned int updated:1;
unsigned int editing:1; /* editing docked icon */
unsigned int drop_launch:1; /* launching from drop action */
unsigned int paste_launch:1; /* launching from paste action */
unsigned int destroyed:1; /* appicon was destroyed */
unsigned int buggy_app:1; /* do not make dock rely on hints
* set by app */
unsigned int lock:1; /* do not allow to be destroyed */
};
/******** Accessors/mutators ********/
short wAppIconGetXIndex(WAppIcon *aicon) {
return aicon->xindex;
}
void wAppIconSetXIndex(WAppIcon *aicon, short xindex) {
aicon->xindex = xindex;
}
short wAppIconGetYIndex(WAppIcon *aicon) {
return aicon->yindex;
}
void wAppIconSetYIndex(WAppIcon *aicon, short yindex) {
aicon->yindex = yindex;
}
struct WAppIcon *wAppIconGetNext(WAppIcon *aicon) {
return aicon->next;
}
struct WAppIcon *wAppIconGetPrev(WAppIcon *aicon) {
return aicon->prev;
}
int wAppIconGetXPos(WAppIcon *aicon) {
return aicon->x_pos;
}
void wAppIconSetXPos(WAppIcon *aicon, int x_pos) {
aicon->x_pos = x_pos;
}
int wAppIconGetYPos(WAppIcon *aicon) {
return aicon->y_pos;
}
void wAppIconSetYPos(WAppIcon *aicon, int y_pos) {
aicon->y_pos = y_pos;
}
WIcon *wAppIconGetIcon(WAppIcon *aicon) {
return aicon->icon;
}
char *wAppIconGetCommand(WAppIcon *aicon) {
return aicon->command;
}
void wAppIconSetCommand(WAppIcon *aicon, char *command) {
if (aicon->command)
wfree(aicon->command);
if (command && (command[0] == 0 || (command[0] == '-' && command[1] == 0))) {
wfree(command);
command = NULL;
}
aicon->command = command;
}
#ifdef USE_DOCK_XDND
char *wAppIconGetDnDCommand(WAppIcon *aicon) {
return aicon->dnd_command;
}
void wAppIconSetDnDCommand(WAppIcon *aicon, char *command) {
if (aicon->dnd_command)
wfree(aicon->dnd_command);
if (command && (command[0] == 0 || (command[0] == '-' && command[1] == 0))) {
wfree(command);
command = NULL;
}
aicon->dnd_command = command;
}
#endif // USE_DOCK_XDND
char *wAppIconGetPasteCommand(WAppIcon *aicon) {
return aicon->paste_command;
}
void wAppIconSetPasteCommand(WAppIcon *aicon, char *command) {
if (aicon->paste_command)
wfree(aicon->paste_command);
if (command && (command[0] == 0 || (command[0] == '-' && command[1] == 0))) {
wfree(command);
command = NULL;
}
aicon->paste_command = command;
}
char *wAppIconGetWmClass(WAppIcon *aicon) {
return aicon->wm_class;
}
char *wAppIconGetWmInstance(WAppIcon *aicon) {
return aicon->wm_instance;
}
pid_t wAppIconGetPid(WAppIcon *aicon) {
return aicon->pid;
}
void wAppIconSetPid(WAppIcon *aicon, pid_t pid) {
aicon->pid = pid;
}
Window wAppIconGetMainWindow(WAppIcon *aicon) {
return aicon->main_window;
}
void wAppIconSetMainWindow(WAppIcon *aicon, Window main_window) {
aicon->main_window = main_window;
}
struct WDock *wAppIconGetDock(WAppIcon *aicon) {
return aicon->dock;
}
void wAppIconSetDock(WAppIcon *aicon, struct WDock *dock) {
aicon->dock = dock;
}
struct _AppSettingsPanel *wAppIconGetPanel(WAppIcon *aicon) {
return aicon->panel;
}
void wAppIconSetPanel(WAppIcon *aicon, struct _AppSettingsPanel *panel) {
aicon->panel = panel;
}
int wAppIconIsDocked(WAppIcon *aicon) {
return aicon->docked;
}
void wAppIconSetDocked(WAppIcon *aicon, int docked) {
aicon->docked = !!docked;
}
int wAppIconIsOmnipresent(WAppIcon *aicon) {
return aicon->omnipresent;
}
void wAppIconSetOmnipresent(WAppIcon *aicon, int omnipresent) {
aicon->omnipresent = !!omnipresent;
}
int wAppIconIsAttracted(WAppIcon *aicon) {
return aicon->attracted;
}
void wAppIconSetAttracted(WAppIcon *aicon, int attracted) {
aicon->attracted = !!attracted;
}
int wAppIconIsLaunching(WAppIcon *aicon) {
return aicon->launching;
}
void wAppIconSetLaunching(WAppIcon *aicon, int launching) {
aicon->launching = !!launching;
}
int wAppIconIsRunning(WAppIcon *aicon) {
return aicon->running;
}
void wAppIconSetRunning(WAppIcon *aicon, int running) {
aicon->running = !!running;
}
int wAppIconIsRelaunching(WAppIcon *aicon) {
return aicon->relaunching;
}
void wAppIconSetRelaunching(WAppIcon *aicon, int relaunching) {
aicon->relaunching = !!relaunching;
}
int wAppIconIsForceDocked(WAppIcon *aicon) {
return aicon->forced_dock;
}
void wAppIconSetForceDocked(WAppIcon *aicon, int forced_dock) {
aicon->forced_dock = !!forced_dock;
}
int wAppIconIsAutoLaunch(WAppIcon *aicon) {
return aicon->auto_launch;
}
void wAppIconSetAutoLaunch(WAppIcon *aicon, int auto_launch) {
aicon->auto_launch = !!auto_launch;
}
int wAppIconIsEditing(WAppIcon *aicon) {
return aicon->editing;
}
void wAppIconSetEditing(WAppIcon *aicon, int editing) {
aicon->editing = !!editing;
}
int wAppIconIsDropLaunch(WAppIcon *aicon) {
return aicon->drop_launch;
}
void wAppIconSetDropLaunch(WAppIcon *aicon, int drop_launch) {
aicon->drop_launch = !!drop_launch;
}
int wAppIconIsPasteLaunch(WAppIcon *aicon) {
return aicon->paste_launch;
}
void wAppIconSetPasteLaunch(WAppIcon *aicon, int paste_launch) {
aicon->paste_launch = !!paste_launch;
}
int wAppIconIsBuggyApp(WAppIcon *aicon) {
return aicon->buggy_app;
}
void wAppIconSetBuggyApp(WAppIcon *aicon, int buggy_app) {
aicon->buggy_app = !!buggy_app;
}
int wAppIconIsLocked(WAppIcon *aicon) {
return aicon->lock;
}
void wAppIconSetLocked(WAppIcon *aicon, int lock) {
aicon->lock = !!lock;
}
/*
* icon_file for the dock is got from the preferences file by
* using the classname/instancename
+87 -39
View File
@@ -29,46 +29,94 @@
#include "icon.h"
#include "application.h"
typedef struct WAppIcon {
short xindex;
short yindex;
struct WAppIcon *next;
struct WAppIcon *prev;
WIcon *icon;
int x_pos, y_pos; /* absolute screen coordinate */
char *command; /* command used to launch app */
#ifdef USE_DOCK_XDND
char *dnd_command; /* command to use when something is */
/* dropped on us */
#endif
char *paste_command; /* command to run when
* something is pasted */
char *wm_class;
char *wm_instance;
pid_t pid; /* for apps launched from the dock */
Window main_window;
struct WDock *dock; /* In which dock is docked. */
struct _AppSettingsPanel *panel; /* Settings Panel */
unsigned int docked:1;
unsigned int omnipresent:1; /* If omnipresent when
* docked in clip */
unsigned int attracted:1; /* If it was attracted by the clip */
unsigned int launching:1;
unsigned int running:1; /* application is already running */
unsigned int relaunching:1; /* launching 2nd instance */
unsigned int forced_dock:1;
unsigned int auto_launch:1; /* launch app on startup */
unsigned int remote_start:1;
unsigned int updated:1;
unsigned int editing:1; /* editing docked icon */
unsigned int drop_launch:1; /* launching from drop action */
unsigned int paste_launch:1; /* launching from paste action */
unsigned int destroyed:1; /* appicon was destroyed */
unsigned int buggy_app:1; /* do not make dock rely on hints
* set by app */
unsigned int lock:1; /* do not allow to be destroyed */
} WAppIcon;
typedef struct WAppIcon WAppIcon;
/******** Accessors/mutators ********/
short wAppIconGetXIndex(WAppIcon *aicon);
void wAppIconSetXIndex(WAppIcon *aicon, short x_index);
short wAppIconGetYIndex(WAppIcon *aicon);
void wAppIconSetYIndex(WAppIcon *aicon, short y_index);
struct WAppIcon *wAppIconGetNext(WAppIcon *aicon);
struct WAppIcon *wAppIconGetPrev(WAppIcon *aicon);
int wAppIconGetXPos(WAppIcon *aicon);
void wAppIconSetXPos(WAppIcon *aicon, int x_pos);
int wAppIconGetYPos(WAppIcon *aicon);
void wAppIconSetYPos(WAppIcon *aicon, int y_pos);
WIcon *wAppIconGetIcon(WAppIcon *aicon);
char *wAppIconGetCommand(WAppIcon *aicon);
void wAppIconSetCommand(WAppIcon *aicon, char *command);
#ifdef USE_DOCK_XDND
char *wAppIconGetDnDCommand(WAppIcon *aicon);
void wAppIconSetDnDCommand(WAppIcon *aicon, char *command);
#endif // USE_DOCK_XDND
char *wAppIconGetPasteCommand(WAppIcon *aicon);
void wAppIconSetPasteCommand(WAppIcon *aicon, char *command);
char *wAppIconGetWmClass(WAppIcon *aicon);
char *wAppIconGetWmInstance(WAppIcon *aicon);
pid_t wAppIconGetPid(WAppIcon *aicon);
void wAppIconSetPid(WAppIcon *aicon, pid_t pid);
Window wAppIconGetMainWindow(WAppIcon *aicon);
void wAppIconSetMainWindow(WAppIcon *aicon, Window main_window);
struct WDock *wAppIconGetDock(WAppIcon *aicon);
void wAppIconSetDock(WAppIcon *aicon, struct WDock *dock);
struct _AppSettingsPanel *wAppIconGetPanel(WAppIcon *aicon);
void wAppIconSetPanel(WAppIcon *aicon, struct _AppSettingsPanel *panel);
int wAppIconIsDocked(WAppIcon *aicon);
void wAppIconSetDocked(WAppIcon *aicon, int docked);
int wAppIconIsOmnipresent(WAppIcon *aicon);
void wAppIconSetOmnipresent(WAppIcon *aicon, int omnipresent);
int wAppIconIsAttracted(WAppIcon *aicon);
void wAppIconSetAttracted(WAppIcon *aicon, int attracted);
int wAppIconIsLaunching(WAppIcon *aicon);
void wAppIconSetLaunching(WAppIcon *aicon, int launching);
int wAppIconIsRunning(WAppIcon *aicon);
void wAppIconSetRunning(WAppIcon *aicon, int running);
int wAppIconIsRelaunching(WAppIcon *aicon);
void wAppIconSetRelaunching(WAppIcon *aicon, int relaunching);
int wAppIconIsForceDocked(WAppIcon *aicon);
void wAppIconSetForceDocked(WAppIcon *aicon, int forced_dock);
int wAppIconIsAutoLaunch(WAppIcon *aicon);
void wAppIconSetAutoLaunch(WAppIcon *aicon, int auto_launch);
int wAppIconIsEditing(WAppIcon *aicon);
void wAppIconSetEditing(WAppIcon *aicon, int editing);
int wAppIconIsDropLaunch(WAppIcon *aicon);
void wAppIconSetDropLaunch(WAppIcon *aicon, int drop_launch);
int wAppIconIsPasteLaunch(WAppIcon *aicon);
void wAppIconSetPasteLaunch(WAppIcon *aicon, int paste_launch);
int wAppIconIsBuggyApp(WAppIcon *aicon);
void wAppIconSetBuggyApp(WAppIcon *aicon, int buggy_app);
int wAppIconIsLocked(WAppIcon *aicon);
void wAppIconSetLocked(WAppIcon *aicon, int locked);
/******** Lifecycle/resource management ********/
WAppIcon *wAppIconCreateForDock(WScreen *scr, const char *command, const char *wm_instance,
const char *wm_class, int tile);
Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event);
+4 -4
View File
@@ -199,8 +199,8 @@ WApplication *wApplicationCreate(WWindow * wwin)
wapp = wApplicationOf(main_window);
if (wapp) {
wapp->refcount++;
if (wapp->app_icon && wapp->app_icon->docked &&
wapp->app_icon->relaunching && wapp->main_window_desc->fake_group)
if (wapp->app_icon && wAppIconIsDocked(wapp->app_icon) &&
wAppIconIsRelaunching(wapp->app_icon) && wapp->main_window_desc->fake_group)
wDockFinishLaunch(wapp->app_icon);
return wapp;
@@ -319,7 +319,7 @@ void wApplicationClearRefcount(WApplication *wapp)
void wApplicationActivate(WApplication *wapp)
{
if (wapp->app_icon) {
wIconSetHighlited(wapp->app_icon->icon, True);
wIconSetHighlited(wAppIconGetIcon(wapp->app_icon), True);
wAppIconPaint(wapp->app_icon);
}
}
@@ -327,7 +327,7 @@ void wApplicationActivate(WApplication *wapp)
void wApplicationDeactivate(WApplication *wapp)
{
if (wapp->app_icon) {
wIconSetHighlited(wapp->app_icon->icon, False);
wIconSetHighlited(wAppIconGetIcon(wapp->app_icon), False);
wAppIconPaint(wapp->app_icon);
}
}
+18 -18
View File
@@ -507,7 +507,7 @@ static void miniwindowBalloon(WObjDescriptor *object)
static void appiconBalloon(WObjDescriptor *object)
{
WAppIcon *aicon = (WAppIcon *) object->parent;
WScreen *scr = aicon->icon->core->screen_ptr;
WScreen *scr = wAppIconGetIcon(aicon)->core->screen_ptr;
char *tmp;
/* Show balloon if it is the Clip and the workspace name is > 5 chars */
@@ -518,15 +518,15 @@ static void appiconBalloon(WObjDescriptor *object)
wBalloonHide(scr);
return;
}
} else if (aicon->command && aicon->wm_class) {
} else if (wAppIconGetCommand(aicon) && wAppIconGetWmClass(aicon)) {
int len;
WApplication *app;
unsigned int app_win_cnt = 0;
const char *display_name;
if (object->parent_type == WCLASS_DOCK_ICON) {
if (aicon->main_window) {
app = wApplicationOf(aicon->main_window);
if (wAppIconGetMainWindow(aicon)) {
app = wApplicationOf(wAppIconGetMainWindow(aicon));
if (app && wApplicationGetMainWindowDesc(app) && wApplicationGetMainWindowDesc(app)->fake_group)
app_win_cnt = wApplicationGetMainWindowDesc(app)->fake_group->retainCount - 1;
}
@@ -537,38 +537,38 @@ static void appiconBalloon(WObjDescriptor *object)
* instead of the class, otherwise the user will not be able to distinguish what
* is being referred.
*/
if (strcmp(aicon->wm_class, "GNUstep") == 0)
display_name = aicon->wm_instance;
if (strcmp(wAppIconGetWmClass(aicon), "GNUstep") == 0)
display_name = wAppIconGetWmInstance(aicon);
else
display_name = aicon->wm_class;
display_name = wAppIconGetWmClass(aicon);
len = strlen(aicon->command) + strlen(display_name) + 8;
len = strlen(wAppIconGetCommand(aicon)) + strlen(display_name) + 8;
if (app_win_cnt > 0)
len += 1 + snprintf(NULL, 0, "%u", app_win_cnt);
tmp = wmalloc(len);
if (app_win_cnt > 0)
snprintf(tmp, len, "%u %s\n(%s)", app_win_cnt, display_name, aicon->command);
snprintf(tmp, len, "%u %s\n(%s)", app_win_cnt, display_name, wAppIconGetCommand(aicon));
else
snprintf(tmp, len, "%s\n(%s)", aicon->wm_instance, aicon->command);
snprintf(tmp, len, "%s\n(%s)", wAppIconGetWmInstance(aicon), wAppIconGetCommand(aicon));
scr->balloon->text = tmp;
} else if (aicon->command) {
scr->balloon->text = wstrdup(aicon->command);
} else if (aicon->wm_class) {
} else if (wAppIconGetCommand(aicon)) {
scr->balloon->text = wstrdup(wAppIconGetCommand(aicon));
} else if (wAppIconGetWmClass(aicon)) {
/* Check to see if it is a GNUstep App */
if (strcmp(aicon->wm_class, "GNUstep") == 0)
scr->balloon->text = wstrdup(aicon->wm_instance);
if (strcmp(wAppIconGetWmClass(aicon), "GNUstep") == 0)
scr->balloon->text = wstrdup(wAppIconGetWmInstance(aicon));
else
scr->balloon->text = wstrdup(aicon->wm_class);
scr->balloon->text = wstrdup(wAppIconGetWmClass(aicon));
} else {
wBalloonHide(scr);
return;
}
scr->balloon->h = aicon->icon->core->height - 2;
scr->balloon->h = wAppIconGetIcon(aicon)->core->height - 2;
scr->balloon->objectWindow = aicon->icon->core->window;
scr->balloon->objectWindow = wAppIconGetIcon(aicon)->core->window;
if ((scr->balloon->prevType == object->parent_type || scr->balloon->prevType == WCLASS_MINIWINDOW)
&& scr->balloon->ignoreTimer) {
XUnmapWindow(dpy, scr->balloon->window);
+3 -5
View File
@@ -324,14 +324,12 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event)
WApplication *wapp = wApplicationOf(wwin->main_window);
char *command;
if (!wapp || !wApplicationGetAppIcon(wapp) || wApplicationGetAppIcon(wapp)->docked)
if (!wapp || !wApplicationGetAppIcon(wapp) || wAppIconIsDocked(wApplicationGetAppIcon(wapp)))
break;
command = GetCommandForWindow(wwin->main_window);
if (command) {
if (wApplicationGetAppIcon(wapp)->command)
wfree(wApplicationGetAppIcon(wapp)->command);
wApplicationGetAppIcon(wapp)->command = command;
wAppIconSetCommand(wApplicationGetAppIcon(wapp), command);
}
}
break;
@@ -461,7 +459,7 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event)
wapp = wApplicationOf(wwin->main_window);
if (wapp && wApplicationGetAppIcon(wapp)) {
wIconUpdate(wApplicationGetAppIcon(wapp)->icon);
wIconUpdate(wAppIconGetIcon(wApplicationGetAppIcon(wapp)));
wAppIconPaint(wApplicationGetAppIcon(wapp));
}
}
+2 -2
View File
@@ -1309,9 +1309,9 @@ void wDefaultUpdateIcons(WScreen *scr)
while (aicon) {
/* Get the application icon, default included */
wIconChangeImageFile(aicon->icon, NULL);
wIconChangeImageFile(wAppIconGetIcon(aicon), NULL);
wAppIconPaint(aicon);
aicon = aicon->next;
aicon = wAppIconGetNext(aicon);
}
if (!wPreferences.flags.noclip || wPreferences.flags.clip_merged_in_dock)
+520 -509
View File
File diff suppressed because it is too large Load Diff
+29 -59
View File
@@ -42,43 +42,13 @@
static void updateCommand(WAppIcon * icon, char *command)
{
if (icon->command)
wfree(icon->command);
if (command && (command[0] == 0 || (command[0] == '-' && command[1] == 0))) {
wfree(command);
command = NULL;
}
icon->command = command;
wAppIconSetCommand(icon, command);
if (!icon->wm_class && !icon->wm_instance && icon->command && strlen(icon->command) > 0) {
icon->forced_dock = 1;
if (!wAppIconGetWmClass(icon) && !wAppIconGetWmInstance(icon) && wAppIconGetCommand(icon) && strlen(wAppIconGetCommand(icon)) > 0) {
wAppIconSetForceDocked(icon, 1);
}
}
static void updatePasteCommand(WAppIcon * icon, char *command)
{
if (icon->paste_command)
wfree(icon->paste_command);
if (command && (command[0] == 0 || (command[0] == '-' && command[1] == 0))) {
wfree(command);
command = NULL;
}
icon->paste_command = command;
}
#ifdef USE_DOCK_XDND
static void updateDNDCommand(WAppIcon * icon, char *command)
{
if (icon->dnd_command)
wfree(icon->dnd_command);
if (command && (command[0] == 0 || (command[0] == '-' && command[1] == 0))) {
wfree(command);
command = NULL;
}
icon->dnd_command = command;
}
#endif /* USE_DOCK_XDND */
static void updateSettingsPanelIcon(AppSettingsPanel * panel)
{
char *file;
@@ -132,7 +102,7 @@ static void chooseIconCallback(WMWidget * self, void *clientData)
WMSetButtonEnabled(panel->browseBtn, False);
result = wIconChooserDialog(panel->wwin->screen_ptr, &file,
panel->editedIcon->wm_instance, panel->editedIcon->wm_class);
wAppIconGetWmInstance(panel->editedIcon), wAppIconGetWmClass(panel->editedIcon));
panel->choosingIcon = 0;
if (!panel->destroyed) {
@@ -164,7 +134,7 @@ static void panelBtnCallback(WMWidget * self, void *data)
text = NULL;
}
if (!wIconChangeImageFile(panel->editedIcon->icon, text)) {
if (!wIconChangeImageFile(wAppIconGetIcon(panel->editedIcon), text)) {
char *buf;
int len = strlen(text) + 64;
@@ -181,14 +151,14 @@ static void panelBtnCallback(WMWidget * self, void *data)
WAppIcon *aicon = panel->editedIcon;
// Cf dock.c:dockIconPaint(WAppIcon *aicon)?
if (aicon == aicon->icon->core->screen_ptr->clip_icon)
if (aicon == wAppIconGetIcon(aicon)->core->screen_ptr->clip_icon)
wClipIconPaint(aicon);
else if (wIsADrawer(aicon))
wDrawerIconPaint(aicon);
else
wAppIconPaint(aicon);
wDefaultChangeIcon(aicon->wm_instance, aicon->wm_class, text);
wDefaultChangeIcon(wAppIconGetWmInstance(aicon), wAppIconGetWmClass(aicon), text);
}
if (text)
wfree(text);
@@ -203,16 +173,16 @@ static void panelBtnCallback(WMWidget * self, void *data)
updateCommand(panel->editedIcon, text);
#ifdef USE_DOCK_XDND
/* cannot free text from this, because it will be not be duplicated
* in updateDNDCommand */
* in wAppIconSetDnDCommand */
text = WMGetTextFieldText(panel->dndCommandField);
updateDNDCommand(panel->editedIcon, text);
wAppIconSetDnDCommand(panel->editedIcon, text);
#endif
text = WMGetTextFieldText(panel->pasteCommandField);
updatePasteCommand(panel->editedIcon, text);
wAppIconSetPasteCommand(panel->editedIcon, text);
panel->editedIcon->auto_launch = WMGetButtonSelected(panel->autoLaunchBtn);
wAppIconSetAutoLaunch(panel->editedIcon, WMGetButtonSelected(panel->autoLaunchBtn));
panel->editedIcon->lock = WMGetButtonSelected(panel->lockBtn);
wAppIconSetLocked(panel->editedIcon, WMGetButtonSelected(panel->lockBtn));
}
DestroyDockAppSettingsPanel(panel);
@@ -221,7 +191,7 @@ static void panelBtnCallback(WMWidget * self, void *data)
void ShowDockAppSettingsPanel(WAppIcon * aicon)
{
AppSettingsPanel *panel;
WScreen *scr = aicon->icon->core->screen_ptr;
WScreen *scr = wAppIconGetIcon(aicon)->core->screen_ptr;
Window parent;
WMFont *font;
int x, y;
@@ -252,8 +222,8 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
panel->editedIcon = aicon;
aicon->panel = panel;
aicon->editing = 1;
wAppIconSetPanel(aicon, panel);
wAppIconSetEditing(aicon, 1);
panel->win = WMCreateWindow(scr->wmscreen, "applicationSettings");
WMResizeWidget(panel->win, pwidth, pheight);
@@ -270,10 +240,10 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
WMSetLabelTextAlignment(panel->nameLabel, WALeft);
WMSetLabelFont(panel->nameLabel, font);
WMReleaseFont(font);
if (aicon->wm_class && strcmp(aicon->wm_class, "DockApp") == 0)
WMSetLabelText(panel->nameLabel, aicon->wm_instance);
if (wAppIconGetWmClass(aicon) && strcmp(wAppIconGetWmClass(aicon), "DockApp") == 0)
WMSetLabelText(panel->nameLabel, wAppIconGetWmInstance(aicon));
else
WMSetLabelText(panel->nameLabel, aicon->wm_class);
WMSetLabelText(panel->nameLabel, wAppIconGetWmClass(aicon));
vbox = WMCreateBox(panel->win);
WMResizeWidget(vbox, pwidth - 2 * WMScaleX(10), pheight - iconSize - 3 * WMScaleY(10));
@@ -282,12 +252,12 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
panel->autoLaunchBtn = WMCreateSwitchButton(vbox);
WMAddBoxSubview(vbox, WMWidgetView(panel->autoLaunchBtn), False, True, WMScaleY(20), WMScaleY(20), WMScaleY(2));
WMSetButtonText(panel->autoLaunchBtn, _("Start when Window Maker is started"));
WMSetButtonSelected(panel->autoLaunchBtn, aicon->auto_launch);
WMSetButtonSelected(panel->autoLaunchBtn, wAppIconIsAutoLaunch(aicon));
panel->lockBtn = WMCreateSwitchButton(vbox);
WMAddBoxSubview(vbox, WMWidgetView(panel->lockBtn), False, True, WMScaleY(20), WMScaleY(20), WMScaleY(5));
WMSetButtonText(panel->lockBtn, _("Lock (prevent accidental removal)"));
WMSetButtonSelected(panel->lockBtn, aicon->lock);
WMSetButtonSelected(panel->lockBtn, wAppIconIsLocked(aicon));
panel->commandFrame = WMCreateFrame(vbox);
WMSetFrameTitle(panel->commandFrame, _("Application path and arguments"));
@@ -296,7 +266,7 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
panel->commandField = WMCreateTextField(panel->commandFrame);
WMResizeWidget(panel->commandField, WMScaleX(260), WMScaleY(20));
WMMoveWidget(panel->commandField, WMScaleX(10), WMScaleY(20));
WMSetTextFieldText(panel->commandField, aicon->command);
WMSetTextFieldText(panel->commandField, wAppIconGetCommand(aicon));
WMMapSubwidgets(panel->commandFrame);
@@ -312,7 +282,7 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
WMResizeWidget(panel->pasteCommandLabel, WMScaleX(260), WMScaleY(18));
WMMoveWidget(panel->pasteCommandLabel, WMScaleX(10), WMScaleY(45));
WMSetTextFieldText(panel->pasteCommandField, aicon->paste_command);
WMSetTextFieldText(panel->pasteCommandField, wAppIconGetPasteCommand(aicon));
WMSetLabelText(panel->pasteCommandLabel, _("%s will be replaced with current selection"));
WMMapSubwidgets(panel->pasteCommandFrame);
@@ -328,7 +298,7 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
WMResizeWidget(panel->dndCommandLabel, WMScaleX(260), WMScaleY(18));
WMMoveWidget(panel->dndCommandLabel, WMScaleX(10), WMScaleY(45));
#ifdef USE_DOCK_XDND
WMSetTextFieldText(panel->dndCommandField, aicon->dnd_command);
WMSetTextFieldText(panel->dndCommandField, wAppIconGetDnDCommand(aicon));
WMSetLabelText(panel->dndCommandLabel, _("%d will be replaced with the file name"));
#else
WMSetTextFieldEditable(panel->dndCommandField, False);
@@ -346,7 +316,7 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
panel->iconField = WMCreateTextField(panel->iconFrame);
WMResizeWidget(panel->iconField, WMScaleX(180), WMScaleY(20));
WMMoveWidget(panel->iconField, WMScaleX(10), WMScaleY(20));
WMSetTextFieldText(panel->iconField, wDefaultGetIconFile(aicon->wm_instance, aicon->wm_class, False));
WMSetTextFieldText(panel->iconField, wDefaultGetIconFile(wAppIconGetWmInstance(aicon), wAppIconGetWmClass(aicon), False));
panel->browseBtn = WMCreateCommandButton(panel->iconFrame);
WMResizeWidget(panel->browseBtn, WMScaleX(70), WMScaleY(24));
@@ -392,14 +362,14 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
{
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
y = aicon->y_pos;
y = wAppIconGetYPos(aicon);
if (y < 0)
y = 0;
else if (y + pheight > rect.pos.y + rect.size.height)
y = rect.pos.y + rect.size.height - pheight - 3 * WMScaleY(10);
if (aicon->dock && wDockGetType(aicon->dock) == WM_DOCK) {
if (wDockIsOnRightSide(aicon->dock))
if (wAppIconGetDock(aicon) && wDockGetType(wAppIconGetDock(aicon)) == WM_DOCK) {
if (wDockIsOnRightSide(wAppIconGetDock(aicon)))
x = rect.pos.x + rect.size.width / 2;
else
x = rect.pos.x + rect.size.width / 2 - pwidth - WMScaleX(2);
@@ -443,9 +413,9 @@ void DestroyDockAppSettingsPanel(AppSettingsPanel * panel)
XDestroyWindow(dpy, panel->parent);
panel->editedIcon->panel = NULL;
wAppIconSetPanel(panel->editedIcon, NULL);
panel->editedIcon->editing = 0;
wAppIconSetEditing(panel->editedIcon, 0);
wfree(panel);
}
+1 -1
View File
@@ -1115,7 +1115,7 @@ static void handleClientMessage(XEvent * event)
if (desc->parent_type == WCLASS_MINIWINDOW) {
icon = (WIcon *) desc->parent;
} else if (desc->parent_type == WCLASS_DOCK_ICON || desc->parent_type == WCLASS_APPICON) {
icon = ((WAppIcon *) desc->parent)->icon;
icon = wAppIconGetIcon((WAppIcon *) desc->parent);
}
if (icon && (wwin = icon->owner)) {
if (wwin->client_win != event->xclient.window) {
+3 -3
View File
@@ -57,9 +57,9 @@ iconPosition(WCoreWindow *wcore, int sx1, int sy1, int sx2, int sy2,
parent = wcore->descriptor.parent;
/* if it is an application icon */
if (wcore->descriptor.parent_type == WCLASS_APPICON && !((WAppIcon *) parent)->docked) {
*retX = ((WAppIcon *) parent)->x_pos;
*retY = ((WAppIcon *) parent)->y_pos;
if (wcore->descriptor.parent_type == WCLASS_APPICON && !wAppIconIsDocked((WAppIcon *) parent)) {
*retX = wAppIconGetXPos((WAppIcon *) parent);
*retY = wAppIconGetYPos((WAppIcon *) parent);
ok = 1;
} else if (wcore->descriptor.parent_type == WCLASS_MINIWINDOW &&
+13 -13
View File
@@ -202,9 +202,9 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
command = GetCommandForWindow(win);
if (!command) {
if (wApplicationGetAppIcon(wapp) && wApplicationGetAppIcon(wapp)->command) {
command = wmalloc(strlen(wApplicationGetAppIcon(wapp)->command) + 1);
strcpy(command, wApplicationGetAppIcon(wapp)->command);
if (wApplicationGetAppIcon(wapp) && wAppIconGetCommand(wApplicationGetAppIcon(wapp))) {
command = wmalloc(strlen(wAppIconGetCommand(wApplicationGetAppIcon(wapp))) + 1);
strcpy(command, wAppIconGetCommand(wApplicationGetAppIcon(wapp)));
} else
return NULL;
}
@@ -256,16 +256,16 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
WMReleasePropList(maximized);
WMReleasePropList(geometry);
WMReleasePropList(shortcut);
if (wapp && wApplicationGetAppIcon(wapp) && wApplicationGetAppIcon(wapp)->dock) {
if (wapp && wApplicationGetAppIcon(wapp) && wAppIconGetDock(wApplicationGetAppIcon(wapp))) {
int i;
char *name = NULL;
if (wApplicationGetAppIcon(wapp)->dock == scr->dock)
if (wAppIconGetDock(wApplicationGetAppIcon(wapp)) == scr->dock)
name = "Dock";
/* Try the clips */
if (name == NULL) {
for (i = 0; i < scr->workspace_count; i++)
if (scr->workspaces[i]->clip == wApplicationGetAppIcon(wapp)->dock)
if (scr->workspaces[i]->clip == wAppIconGetDock(wApplicationGetAppIcon(wapp)))
break;
if (i < scr->workspace_count)
name = scr->workspaces[i]->name;
@@ -274,11 +274,11 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
if (name == NULL) {
WDrawerChain *dc;
for (dc = scr->drawers; dc != NULL; dc = dc->next) {
if (dc->adrawer == wApplicationGetAppIcon(wapp)->dock)
if (dc->adrawer == wAppIconGetDock(wApplicationGetAppIcon(wapp)))
break;
}
assert(dc != NULL);
name = wDockGetIcon(dc->adrawer, 0)->wm_instance;
name = wAppIconGetWmInstance(wDockGetIcon(dc->adrawer, 0));
}
dock = WMCreatePLString(name);
WMPutInPLDictionary(win_state, sDock, dock);
@@ -536,7 +536,7 @@ void wSessionRestoreState(WScreen *scr)
WDrawerChain *dc;
for (dc = scr->drawers; dc != NULL; dc = dc->next)
{
if (strcmp(wDockGetIcon(dc->adrawer, 0)->wm_instance, tmp) == 0)
if (strcmp(wAppIconGetWmInstance(wDockGetIcon(dc->adrawer, 0)), tmp) == 0)
{
dock = dc->adrawer;
break;
@@ -556,10 +556,10 @@ void wSessionRestoreState(WScreen *scr)
if (dock != NULL) {
for (j = 0; j < wDockGetMaxIcons(dock); j++) {
btn = wDockGetIcon(dock, j);
if (btn && is_same(instance, btn->wm_instance) &&
is_same(class, btn->wm_class) &&
is_same(command, btn->command) &&
!btn->launching) {
if (btn && is_same(instance, wAppIconGetWmInstance(btn)) &&
is_same(class, wAppIconGetWmClass(btn)) &&
is_same(command, wAppIconGetCommand(btn)) &&
!wAppIconIsLaunching(btn)) {
found = 1;
break;
}
+17 -17
View File
@@ -201,7 +201,7 @@ static void doAppBounce(void *arg)
reinit:
if (wApplicationHasLiveRefcount(data->wapp)) {
if (wPreferences.raise_appicons_when_bouncing)
XRaiseWindow(dpy, aicon->icon->core->window);
XRaiseWindow(dpy, wAppIconGetIcon(aicon)->core->window);
const double ticks = BOUNCE_HZ * BOUNCE_LENGTH;
const double s = sqrt(BOUNCE_HEIGHT)/(ticks/2);
@@ -218,29 +218,29 @@ reinit:
switch (data->dir) {
case 0: /* left, bounce to right */
XMoveWindow(dpy, aicon->icon->core->window,
aicon->x_pos + (int)offset, aicon->y_pos);
XMoveWindow(dpy, wAppIconGetIcon(aicon)->core->window,
wAppIconGetXPos(aicon) + (int)offset, wAppIconGetYPos(aicon));
break;
case 1: /* right, bounce to left */
XMoveWindow(dpy, aicon->icon->core->window,
aicon->x_pos - (int)offset, aicon->y_pos);
XMoveWindow(dpy, wAppIconGetIcon(aicon)->core->window,
wAppIconGetXPos(aicon) - (int)offset, wAppIconGetYPos(aicon));
break;
case 2: /* top, bounce down */
XMoveWindow(dpy, aicon->icon->core->window,
aicon->x_pos, aicon->y_pos + (int)offset);
XMoveWindow(dpy, wAppIconGetIcon(aicon)->core->window,
wAppIconGetXPos(aicon), wAppIconGetYPos(aicon) + (int)offset);
break;
case 3: /* bottom, bounce up */
XMoveWindow(dpy, aicon->icon->core->window,
aicon->x_pos, aicon->y_pos - (int)offset);
XMoveWindow(dpy, wAppIconGetIcon(aicon)->core->window,
wAppIconGetXPos(aicon), wAppIconGetYPos(aicon) - (int)offset);
break;
}
return;
}
}
XMoveWindow(dpy, aicon->icon->core->window,
aicon->x_pos, aicon->y_pos);
CommitStackingForWindow(aicon->icon->core);
XMoveWindow(dpy, wAppIconGetIcon(aicon)->core->window,
wAppIconGetXPos(aicon), wAppIconGetYPos(aicon));
CommitStackingForWindow(wAppIconGetIcon(aicon)->core);
wApplicationSetBouncing(data->wapp, 0);
WMDeleteTimerHandler(data->timer);
wApplicationDestroy(data->wapp);
@@ -251,13 +251,13 @@ static int bounceDirection(WAppIcon *aicon)
{
enum { left_e = 1, right_e = 2, top_e = 4, bottom_e = 8 };
WScreen *scr = aicon->icon->core->screen_ptr;
WScreen *scr = wAppIconGetIcon(aicon)->core->screen_ptr;
WMRect rr, sr;
int l, r, t, b, h, v;
int dir = 0;
rr.pos.x = aicon->x_pos;
rr.pos.y = aicon->y_pos;
rr.pos.x = wAppIconGetXPos(aicon);
rr.pos.y = wAppIconGetYPos(aicon);
rr.size.width = rr.size.height = 64;
sr = wGetRectForHead(scr, wGetHeadForRect(scr, rr));
@@ -283,8 +283,8 @@ static int bounceDirection(WAppIcon *aicon)
v = b;
}
if (aicon->dock && abs(aicon->xindex) != abs(aicon->yindex)) {
if (abs(aicon->xindex) < abs(aicon->yindex)) dir &= ~(top_e | bottom_e);
if (wAppIconGetDock(aicon) && abs(wAppIconGetXIndex(aicon)) != abs(wAppIconGetYIndex(aicon))) {
if (abs(wAppIconGetXIndex(aicon)) < abs(wAppIconGetYIndex(aicon))) dir &= ~(top_e | bottom_e);
else dir &= ~(left_e | right_e);
} else {
if (h < v) dir &= ~(top_e | bottom_e);
+5 -5
View File
@@ -837,12 +837,12 @@ static void applySettings(WMWidget *button, void *client_data)
if (!WFLAGP(wwin, always_user_icon)) {
/* Change App Icon image, using the icon provided by the client */
if (wApplicationGetAppIcon(wapp)) {
RImage *image = get_rimage_icon_from_wm_hints(wApplicationGetAppIcon(wapp)->icon);
RImage *image = get_rimage_icon_from_wm_hints(wAppIconGetIcon(wApplicationGetAppIcon(wapp)));
if (image) {
set_icon_image_from_image(wApplicationGetAppIcon(wapp)->icon, image);
update_icon_pixmap(wApplicationGetAppIcon(wapp)->icon);
set_icon_image_from_image(wAppIconGetIcon(wApplicationGetAppIcon(wapp)), image);
update_icon_pixmap(wAppIconGetIcon(wApplicationGetAppIcon(wapp)));
} else {
wIconUpdate(wApplicationGetAppIcon(wapp)->icon);
wIconUpdate(wAppIconGetIcon(wApplicationGetAppIcon(wapp)));
}
}
@@ -860,7 +860,7 @@ static void applySettings(WMWidget *button, void *client_data)
} else {
/* Change App Icon image */
if (wApplicationGetAppIcon(wapp))
wIconChangeImageFile(wApplicationGetAppIcon(wapp)->icon, file);
wIconChangeImageFile(wAppIconGetIcon(wApplicationGetAppIcon(wapp)), file);
/* Change icon image if the app is minimized */
if (wwin->icon)
+1 -1
View File
@@ -566,7 +566,7 @@ static void updateIconImage(WWindow *wwin)
/* Refresh the application icon */
WApplication *app = wApplicationOf(wwin->main_window);
if (app && wApplicationGetAppIcon(app)) {
wIconUpdate(wApplicationGetAppIcon(app)->icon);
wIconUpdate(wAppIconGetIcon(wApplicationGetAppIcon(app)));
wAppIconPaint(wApplicationGetAppIcon(app));
}
}
+5 -5
View File
@@ -655,8 +655,8 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
if (!wPreferences.flags.noclip && (wDockIsAutoCollapse(scr->workspaces[workspace]->clip) ||
wDockIsAutoRaiseLower(scr->workspaces[workspace]->clip))) {
/* to handle enter notify. This will also */
XUnmapWindow(dpy, scr->clip_icon->icon->core->window);
XMapWindow(dpy, scr->clip_icon->icon->core->window);
XUnmapWindow(dpy, wAppIconGetIcon(scr->clip_icon)->core->window);
XMapWindow(dpy, wAppIconGetIcon(scr->clip_icon)->core->window);
}
else if (scr->clip_icon != NULL) {
wClipIconPaint(scr->clip_icon);
@@ -929,9 +929,9 @@ void wWorkspaceRestoreState(WScreen *scr)
WAppIcon *aicon = wDockGetIcon(scr->workspaces[i]->clip, j);
int k;
if (!aicon || !aicon->omnipresent)
if (!aicon || !wAppIconIsOmnipresent(aicon))
continue;
aicon->omnipresent = 0;
wAppIconSetOmnipresent(aicon, 0);
if (wClipMakeIconOmnipresent(aicon, True) != WO_SUCCESS)
continue;
if (i == 0)
@@ -949,7 +949,7 @@ void wWorkspaceRestoreState(WScreen *scr)
if (wDockGetIcon(scr->workspaces[0]->clip, k) == NULL)
break;
wDockSetIcon(scr->workspaces[0]->clip, k, aicon);
aicon->dock = scr->workspaces[0]->clip;
wAppIconSetDock(aicon, scr->workspaces[0]->clip);
}
wDockAddIconCount(scr->workspaces[0]->clip, added_omnipresent_icons);
}
+4 -4
View File
@@ -207,7 +207,7 @@ static Bool acceptXDND(Window window)
if (dock) {
for (i = 0; i < wDockGetMaxIcons(dock); i++) {
if (wDockGetIcon(dock, i)
&& wDockGetIcon(dock, i)->icon->core->window == window) {
&& wAppIconGetIcon(wDockGetIcon(dock, i))->core->window == window) {
icon_pos = i;
break;
}
@@ -218,7 +218,7 @@ static Bool acceptXDND(Window window)
if (dock) {
for (i = 0; i < wDockGetMaxIcons(dock); i++) {
if (wDockGetIcon(dock, i)
&& wDockGetIcon(dock, i)->icon->core->window == window) {
&& wAppIconGetIcon(wDockGetIcon(dock, i))->core->window == window) {
icon_pos = i;
break;
}
@@ -228,10 +228,10 @@ static Bool acceptXDND(Window window)
if (icon_pos < 0)
return False;
if (isAwareXDND(wDockGetIcon(dock, icon_pos)->icon->icon_win))
if (isAwareXDND(wAppIconGetIcon(wDockGetIcon(dock, icon_pos))->icon_win))
return False;
if (wDockGetIcon(dock, icon_pos)->dnd_command != NULL)
if (wAppIconGetDnDCommand(wDockGetIcon(dock, icon_pos)) != NULL)
return True;
return False;
+5 -5
View File
@@ -210,14 +210,14 @@ Bool wAppIconTouchesHead(WAppIcon * aicon, int head)
WMRect rect;
int a;
if (!aicon || !aicon->icon)
if (!aicon || !wAppIconGetIcon(aicon))
return False;
scr = aicon->icon->core->screen_ptr;
scr = wAppIconGetIcon(aicon)->core->screen_ptr;
rect = wGetRectForHead(scr, head);
a = calcIntersectionArea(aicon->x_pos, aicon->y_pos,
aicon->icon->core->width,
aicon->icon->core->height,
a = calcIntersectionArea(wAppIconGetXPos(aicon), wAppIconGetYPos(aicon),
wAppIconGetIcon(aicon)->core->width,
wAppIconGetIcon(aicon)->core->height,
rect.pos.x, rect.pos.y, rect.size.width, rect.size.height);
return (a != 0);