On Wed, 20 Jun 2012 at 22:47:52 +0200, Rodolfo kix Garcia wrote:
> On 20/06/12 22:12, Carlos R. Mafra wrote:
>
> > On Wed, 20 Jun 2012 at 21:17:15 +0200, Rodolfo kix Garcia wrote:
> >> On 20/06/12 16:01, Carlos R. Mafra wrote:
> >>
> >>> On Wed, 20 Jun 2012 at 14:54:05 +0100, Carlos R. Mafra wrote:
> >>>
> >>>> So I'd say the problem lies in the automatic start of applications
> >>>> which have no appicon.
> >>>>
> >>>> I have three xterms which automatically start (through the Save Session)
> >>>> and they all have no_appicon set. It seems that the space corresponding
> >>>> to three appicons is in use, and if I start some other application
> >>>> then its appicon is placed in a shifted position which is equivalent
> >>>> to 3 appicons.
> >>>>
> >>>> And I bisected the problem to this commit.
> >>>
> >>> It doesn't matter if the automatically start or not. My xterms
> >>> have no appicon. After I start one, the space which would be
> >>> occupied by its icon is not used by other appicons.
> >>>
> >>> So if I start one xterm than another app (with appicon) and
> >>> so forth, the icons of the application are placed 64 pixels
> >>> apart.
> >>>
> >>>
> >>
> >>
> >> I found the problem. The problem is that the wArrangeIcon function
> >> checks if the icon exists. Now, the icon always exists, then is added
> >> space for the appicon. The function now should check the flag:
> >>
> >> !wwin->user_flags.no_appicon
> >>
> >> instead "wwin->icon".
> >
> > No, the patch does not fix it. I will revert the patch which causes
> > this in the first place.
>
> Carlos,
>
> if you want to revert the patch, do it, no problem. But IMO, here, the
> patch solves the problem :-/
You are seeing some other issue then. I also noticed something strange
related to changing workspaces and rearranging icons when trying to
reproduce the bug with a clean GNUstep/
But it definitely does not solve what I'm seeing here.
> > It does not really make sense to do work if we know that no_appicon
> > is set, it is a waste.
>
>
> Now, the wApplicationCreate creates wapp and wapp->icon, always!
I don't understand why you are saying this. Your patch was named
"Create WAppIcon always", wasn't it? What's the difference from
now? Look at the revert patch:
diff --git a/src/appicon.c b/src/appicon.c
index 6cc2bca..c77633d 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -956,9 +956,6 @@ void create_appicon_from_dock(WWindow *wwin, WApplication
*wapp, Window main_win
{
WScreen *scr = wwin->screen_ptr;
- /* Create the application icon */
- wapp->app_icon = NULL;
-
if (scr->last_dock)
wapp->app_icon = findDockIconFor(scr->last_dock, main_window);
diff --git a/src/application.c b/src/application.c
index f0122f0..c98a3e8 100644
--- a/src/application.c
+++ b/src/application.c
@@ -143,13 +143,21 @@ WApplication *wApplicationCreate(WWindow * wwin)
/* application descriptor */
XSaveContext(dpy, main_window, wAppWinContext, (XPointer) wapp);
- /* Create the application icon using the icon from docks
- * If not found in docks, create a new icon
- * using the function wAppIconCreate() */
- create_appicon_from_dock(wwin, wapp, main_window);
+ /* Create the application icon */
+ wapp->app_icon = NULL;
- /* Save the app_icon in a file */
- save_app_icon(wapp);
+ if (!WFLAGP(wapp->main_window_desc, no_appicon)) {
+ /* Create the application icon using the icon from docks
+ * If not found in docks, create a new icon
+ * using the function wAppIconCreate() */
+ create_appicon_from_dock(wwin, wapp, main_window);
+
+ /* Now, paint the icon */
+ paint_app_icon(wapp);
+
+ /* Save the app_icon in a file */
+ save_app_icon(wapp);
+ }
return wapp;
}
You were creating the icon
/* Create the application icon */
wapp->app_icon = NULL;
from inside create_appicon_from_dock(), which btw was always called.
But now the work is done inside the check if no_appicon is set, and
that makes a lot of sense to me.
> Then, the checks about "if (wwin->icon)" don't make sense.
?
> If the icon is created always, we don't need check if exists, we don't
> need create the icon or destroy,... the code is more easy, we need less
> code, and IMO better.
I'm not following you. I just moved the
create_appicon_from_dock()
paint_app_icon()
save_app_icon()
to inside the no_appicon check.
The wapp->app_icon = NULL is being always set, with or without the
revert patch.
> Please, if you want revert the patch, perfect, but try to reproduce the
> bug, and I will try to do it too. I can launch the applications, restart
> wmaker,... and I don't have the hole. Your help is very appreciated.
Right, I didn't fully understand why the bug was happening with your patch.
But seeing that you were calling the above three functions even if
the no_appicon was set I realized that it didn't make much sense.
So I didn't want to spend more time on this.
But your reaction to the above patch makes me wonder if I'm missing
something.
--
To unsubscribe, send mail to [email protected].