1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 14:08:06 +01:00

AppIcon helper functions.

Create wAppIconFor() and wAppIconTouchesHead() to match wWindowFor()
and wWindowTouchesHead().  These functions will allow us to locate the
window and head associated with a particular app icon or dock icon.
This commit is contained in:
Iain Patterson
2012-10-29 15:35:56 -07:00
committed by Carlos R. Mafra
parent 930e59dd31
commit 67f73e9d54
4 changed files with 39 additions and 0 deletions

View File

@@ -60,6 +60,7 @@
extern Cursor wCursor[WCUR_LAST];
extern WPreferences wPreferences;
extern WDDomain *WDWindowAttributes;
extern XContext wWinContext;
#define MOD_MASK wPreferences.modifier_mask
@@ -1016,3 +1017,19 @@ static void remove_from_appicon_list(WScreen *scr, WAppIcon *appicon)
appicon->prev = NULL;
appicon->next = NULL;
}
WAppIcon *wAppIconFor(Window window)
{
WObjDescriptor *desc;
if (window == None)
return NULL;
if (XFindContext(dpy, window, wWinContext, (XPointer *) & desc) == XCNOENT)
return NULL;
if (desc->parent_type == WCLASS_APPICON || desc->parent_type == WCLASS_DOCK_ICON)
return desc->parent;
return NULL;
}