El 21.06.2012 18:02, Carlos R. Mafra escribió:
On Thu, 21 Jun 2012 at 14:26:42 +0200, Rodolfo kix Garcia wrote:
El 21.06.2012 13:29, Carlos R. Mafra escribió:
>On Thu, 21 Jun 2012 at  0:20:50 +0200, Rodolfo kix Garcia wrote:
>
>>With the new code, the wArrangeIcon checks if wwapp->icon
>>exists, If is
>>null, then doesn't exists and for this reason the icon is not
>>added in
>>the icon list. But with my patch, always exists, therefore,
>>wwapp->icon
>>is always true and then the icon is added, but, the icon is not
>>mapped
>>in X11, then you cannot see it.
>
>Ok, you seem to have understood the problem, but your patch last
>night
>didn't fix it. Strange. I will check that again.

Ok. Thanks a lot. Please, test it again and if you find a
reproducible problem I can check it here and try to write a better
patch.

The patch below fixes it for me. It seems like the problem exists because as the icon is always created no matter if no_appicon is set or not, it
is also added to the list of appicons.

So when the wArrangeIcons() is called it finds a position to place
all the appicons in that list, including the "phantom" no_appicons.

I have to think more about why your patch to check the no_appicon
property in wArrangeIcons() does not work though (I double checked it
this afternoon).

What do you think?

---
 src/appicon.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/appicon.c b/src/appicon.c
index d236313..594721c 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -248,12 +248,17 @@ static WAppIcon *wAppIconCreate(WWindow * leader_win)
        aicon->yindex = -1;
        aicon->xindex = -1;

-       aicon->prev = NULL;
-       aicon->next = scr->app_icon_list;
-       if (scr->app_icon_list)
-               scr->app_icon_list->prev = aicon;
+       /* 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)) {
+               aicon->prev = NULL;
+               aicon->next = scr->app_icon_list;
+               if (scr->app_icon_list)
+                       scr->app_icon_list->prev = aicon;

-       scr->app_icon_list = aicon;
+               scr->app_icon_list = aicon;
+       }

        if (leader_win->wm_class)
                aicon->wm_class = wstrdup(leader_win->wm_class);
--
1.7.7

Thanks,

I will try it later, but I am not sure if the patch is good. With this patch you are not including the icon in the appicon list, and this list is used in some places. Perhaps is correct, perhaps no. I will try it later.

I did this patch. It works here (I found the problem again). The idea is skip the icon from the icon list if the no_appicon flag is set (the printf can be removed ;-)):

kix@kentin:~/src/wmaker-crm/src$ git diff
diff --git a/src/actions.c b/src/actions.c
index 61be535..1f8de9f 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1757,8 +1757,13 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
                aicon = aicon->next;

        while (aicon) {
-               if (!aicon->docked) {
-                       /* CHECK: can icon be NULL here ? */
+               WApplication *wapp = NULL;
+               if (aicon && aicon->icon &&
+ aicon->icon->owner && aicon->icon->owner->main_window) + wapp = wApplicationOf(aicon->icon->owner->main_window);
+
+ if ((!aicon->docked) && (wapp && WFLAGP(wapp->main_window_desc, no_appicon))) {
+                       printf("Creando icono\n");
/* The intention here is to place the AppIcon on the head that * contains most of the applications _main_ window. */
                        head = wGetHeadForWindow(aicon->icon->owner);
@@ -1787,7 +1792,10 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
                wwin = wwin->prev;

        while (wwin) {
- if (wwin->icon && wwin->flags.miniaturized && !wwin->flags.hidden &&
+               if (wwin->icon &&
+                   !wwin->user_flags.no_appicon &&
+                   wwin->flags.miniaturized &&
+                   !wwin->flags.hidden &&
(wwin->frame->workspace == scr->current_workspace || IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)) {

kix
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/


--
To unsubscribe, send mail to [email protected].

Reply via email to