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:
committed by
Carlos R. Mafra
parent
930e59dd31
commit
67f73e9d54
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user