>From 2904ae1ff83c700b33a882f6f896e71d1bf8d290 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Tue, 2 Jul 2012 20:47:39 +0200
Subject: [PATCH 11/13] Same interface for wAppIconCreate() and ForDock
The functions wAppIconCreate and wAppIconCreateForDock have now
the same interface:
WAppIcon *wAppIconCreate(WWindow *wwin, WScreen *scr, char *command,
char *wm_instance, char *wm_class, int tile);
WAppIcon *wAppIconCreateForDock(WWindow *wwin, WScreen *scr, char *command,
char *wm_instance, char *wm_class, int tile);
The other changes in this patch are call directly to the variables:
- if (leader_win->wm_class)
- aicon->wm_class = wstrdup(leader_win->wm_class);
+ if (wm_class)
+ aicon->wm_class = wstrdup(wm_class);
because now are included as argument.
---
src/appicon.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/appicon.c b/src/appicon.c
index be21ae0..72ef62f 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -67,7 +67,7 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event);
static void iconDblClick(WObjDescriptor * desc, XEvent * event);
static void iconExpose(WObjDescriptor * desc, XEvent * event);
static void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance,
char *wm_class);
-static WAppIcon *wAppIconCreate(WWindow * leader_win);
+static WAppIcon *wAppIconCreate(WWindow *wwin, WScreen *scr, char *command,
char *wm_instance, char *wm_class, int tile);
static void add_to_appicon_list(WScreen *scr, WAppIcon *appicon);
static void remove_from_appicon_list(WScreen *scr, WAppIcon *appicon);
@@ -144,12 +144,14 @@ WAppIcon *wAppIconCreateForDock(WWindow *wwin, WScreen
*scr, char *command, char
void makeAppIconFor(WApplication * wapp)
{
+ WWindow *wwin = wapp->main_window_desc;
+
/* If app_icon, work is done, return */
if (wapp->app_icon)
return;
/* Create the icon */
- wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
+ wapp->app_icon = wAppIconCreate(wwin, wwin->screen_ptr, NULL,
wwin->wm_instance, wwin->wm_class, TILE_NORMAL);
/* Now, paint the icon */
if (!WFLAGP(wapp->main_window_desc, no_appicon))
@@ -222,10 +224,9 @@ void removeAppIconFor(WApplication * wapp)
wArrangeIcons(wapp->main_window_desc->screen_ptr, True);
}
-static WAppIcon *wAppIconCreate(WWindow * leader_win)
+WAppIcon *wAppIconCreate(WWindow *wwin, WScreen *scr, char *command, char
*wm_instance, char *wm_class, int tile)
{
WAppIcon *aicon;
- WScreen *scr = leader_win->screen_ptr;
aicon = wmalloc(sizeof(WAppIcon));
wretain(aicon);
@@ -236,16 +237,16 @@ static WAppIcon *wAppIconCreate(WWindow * leader_win)
/* When no_appicon is set we want to avoid having it on the list
* because otherwise there will be a hole when the icons are
* arranged with wArrangeIcons() */
- if (!WFLAGP(leader_win, no_appicon))
+ if (!WFLAGP(wwin, no_appicon))
add_to_appicon_list(scr, aicon);
- if (leader_win->wm_class)
- aicon->wm_class = wstrdup(leader_win->wm_class);
+ if (wm_class)
+ aicon->wm_class = wstrdup(wm_class);
- if (leader_win->wm_instance)
- aicon->wm_instance = wstrdup(leader_win->wm_instance);
+ if (wm_instance)
+ aicon->wm_instance = wstrdup(wm_instance);
- aicon->icon = wIconCreate(leader_win, scr, NULL,
leader_win->wm_instance, leader_win->wm_class, TILE_NORMAL);
+ aicon->icon = wIconCreate(wwin, scr, NULL, wm_instance, wm_class,
TILE_NORMAL);
#ifdef XDND
wXDNDMakeAwareness(aicon->icon->core->window);
#endif
--
1.7.10
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From 2904ae1ff83c700b33a882f6f896e71d1bf8d290 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Tue, 2 Jul 2012 20:47:39 +0200
Subject: [PATCH 11/13] Same interface for wAppIconCreate() and ForDock
The functions wAppIconCreate and wAppIconCreateForDock have now
the same interface:
WAppIcon *wAppIconCreate(WWindow *wwin, WScreen *scr, char *command,
char *wm_instance, char *wm_class, int tile);
WAppIcon *wAppIconCreateForDock(WWindow *wwin, WScreen *scr, char *command,
char *wm_instance, char *wm_class, int tile);
The other changes in this patch are call directly to the variables:
- if (leader_win->wm_class)
- aicon->wm_class = wstrdup(leader_win->wm_class);
+ if (wm_class)
+ aicon->wm_class = wstrdup(wm_class);
because now are included as argument.
---
src/appicon.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/appicon.c b/src/appicon.c
index be21ae0..72ef62f 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -67,7 +67,7 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * event);
static void iconDblClick(WObjDescriptor * desc, XEvent * event);
static void iconExpose(WObjDescriptor * desc, XEvent * event);
static void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance, char *wm_class);
-static WAppIcon *wAppIconCreate(WWindow * leader_win);
+static WAppIcon *wAppIconCreate(WWindow *wwin, WScreen *scr, char *command, char *wm_instance, char *wm_class, int tile);
static void add_to_appicon_list(WScreen *scr, WAppIcon *appicon);
static void remove_from_appicon_list(WScreen *scr, WAppIcon *appicon);
@@ -144,12 +144,14 @@ WAppIcon *wAppIconCreateForDock(WWindow *wwin, WScreen *scr, char *command, char
void makeAppIconFor(WApplication * wapp)
{
+ WWindow *wwin = wapp->main_window_desc;
+
/* If app_icon, work is done, return */
if (wapp->app_icon)
return;
/* Create the icon */
- wapp->app_icon = wAppIconCreate(wapp->main_window_desc);
+ wapp->app_icon = wAppIconCreate(wwin, wwin->screen_ptr, NULL, wwin->wm_instance, wwin->wm_class, TILE_NORMAL);
/* Now, paint the icon */
if (!WFLAGP(wapp->main_window_desc, no_appicon))
@@ -222,10 +224,9 @@ void removeAppIconFor(WApplication * wapp)
wArrangeIcons(wapp->main_window_desc->screen_ptr, True);
}
-static WAppIcon *wAppIconCreate(WWindow * leader_win)
+WAppIcon *wAppIconCreate(WWindow *wwin, WScreen *scr, char *command, char *wm_instance, char *wm_class, int tile)
{
WAppIcon *aicon;
- WScreen *scr = leader_win->screen_ptr;
aicon = wmalloc(sizeof(WAppIcon));
wretain(aicon);
@@ -236,16 +237,16 @@ static WAppIcon *wAppIconCreate(WWindow * leader_win)
/* When no_appicon is set we want to avoid having it on the list
* because otherwise there will be a hole when the icons are
* arranged with wArrangeIcons() */
- if (!WFLAGP(leader_win, no_appicon))
+ if (!WFLAGP(wwin, no_appicon))
add_to_appicon_list(scr, aicon);
- if (leader_win->wm_class)
- aicon->wm_class = wstrdup(leader_win->wm_class);
+ if (wm_class)
+ aicon->wm_class = wstrdup(wm_class);
- if (leader_win->wm_instance)
- aicon->wm_instance = wstrdup(leader_win->wm_instance);
+ if (wm_instance)
+ aicon->wm_instance = wstrdup(wm_instance);
- aicon->icon = wIconCreate(leader_win, scr, NULL, leader_win->wm_instance, leader_win->wm_class, TILE_NORMAL);
+ aicon->icon = wIconCreate(wwin, scr, NULL, wm_instance, wm_class, TILE_NORMAL);
#ifdef XDND
wXDNDMakeAwareness(aicon->icon->core->window);
#endif
--
1.7.10