mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 05:48:01 +01:00
Icon painting moved to makeAppIconFor()
The icon painting is moved to the function makeAppIconFor() including the check for no_appicon. wAppIconCreate is now static because is only used in makeAppIconFor()
This commit is contained in:
committed by
Carlos R. Mafra
parent
ee450acb30
commit
089c99941f
@@ -67,6 +67,7 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event);
|
|||||||
static void iconDblClick(WObjDescriptor * desc, XEvent * event);
|
static void iconDblClick(WObjDescriptor * desc, XEvent * event);
|
||||||
static void iconExpose(WObjDescriptor * desc, XEvent * event);
|
static void iconExpose(WObjDescriptor * desc, XEvent * event);
|
||||||
static void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance, char *wm_class);
|
static void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance, char *wm_class);
|
||||||
|
static WAppIcon *wAppIconCreate(WWindow * leader_win);
|
||||||
|
|
||||||
/* This function is used if the application is a .app. It checks if it has an icon in it
|
/* This function is used if the application is a .app. It checks if it has an icon in it
|
||||||
* like for example /usr/local/GNUstep/Applications/WPrefs.app/WPrefs.tiff
|
* like for example /usr/local/GNUstep/Applications/WPrefs.app/WPrefs.tiff
|
||||||
@@ -161,12 +162,11 @@ void makeAppIconFor(WApplication * wapp)
|
|||||||
if (wapp->app_icon)
|
if (wapp->app_icon)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!WFLAGP(wapp->main_window_desc, no_appicon))
|
/* Create the icon */
|
||||||
wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
|
wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
|
||||||
else
|
|
||||||
wapp->app_icon = NULL;
|
|
||||||
|
|
||||||
/* Now, paint the icon */
|
/* Now, paint the icon */
|
||||||
|
if (!WFLAGP(wapp->main_window_desc, no_appicon))
|
||||||
paint_app_icon(wapp);
|
paint_app_icon(wapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ void removeAppIconFor(WApplication * wapp)
|
|||||||
wArrangeIcons(wapp->main_window_desc->screen_ptr, True);
|
wArrangeIcons(wapp->main_window_desc->screen_ptr, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
WAppIcon *wAppIconCreate(WWindow * leader_win)
|
static WAppIcon *wAppIconCreate(WWindow * leader_win)
|
||||||
{
|
{
|
||||||
WAppIcon *aicon;
|
WAppIcon *aicon;
|
||||||
WScreen *scr = leader_win->screen_ptr;
|
WScreen *scr = leader_win->screen_ptr;
|
||||||
@@ -991,6 +991,6 @@ void app_icon_create_from_docks(WWindow *wwin, WApplication *wapp, Window main_w
|
|||||||
wAppIconPaint(wapp->app_icon);
|
wAppIconPaint(wapp->app_icon);
|
||||||
wAppIconSave(wapp->app_icon);
|
wAppIconSave(wapp->app_icon);
|
||||||
} else {
|
} else {
|
||||||
wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
|
makeAppIconFor(wapp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ typedef struct WAppIcon {
|
|||||||
unsigned int lock:1; /* do not allow to be destroyed */
|
unsigned int lock:1; /* do not allow to be destroyed */
|
||||||
} WAppIcon;
|
} WAppIcon;
|
||||||
|
|
||||||
WAppIcon *wAppIconCreate(WWindow *leader_win);
|
|
||||||
WAppIcon *wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
|
WAppIcon *wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
|
||||||
char *wm_class, int tile);
|
char *wm_class, int tile);
|
||||||
|
|
||||||
|
|||||||
@@ -151,10 +151,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
|
|||||||
/* Save the app_icon in a file */
|
/* Save the app_icon in a file */
|
||||||
save_app_icon(wapp);
|
save_app_icon(wapp);
|
||||||
|
|
||||||
/* Now, paint the icon */
|
|
||||||
if (!WFLAGP(wapp->main_window_desc, no_appicon))
|
|
||||||
paint_app_icon(wapp);
|
|
||||||
|
|
||||||
return wapp;
|
return wapp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user