On Sat, 05 Oct 2013, Christophe escribió:
>
> ----- Rodolfo García Peñas (kix) <[email protected]> a écrit :
> > The new struct wks_info includes the global information
> > for the workspaces. All information related with the workspaces
> > should be included here.
> >
> > The first variable moved is workspace_name_font, included in this
> > patch. This variable was included in the screen info, but the
> > screen and the font used in the workspace name don't have any
> > relationship.
> >
> > Signed-off-by: Rodolfo García Peñas (kix) <[email protected]>
> > ---
> > [...]
> >
> > diff --git a/src/workspace.h b/src/workspace.h
> > index 69d1b18..68cd275 100644
> > --- a/src/workspace.h
> > +++ b/src/workspace.h
> > @@ -23,12 +23,16 @@
> > #define WMWORKSPACE_H_
> >
> >
> > -
> > typedef struct WWorkspace {
> > char *name;
> > struct WDock *clip;
> > } WWorkspace;
> >
> > +typedef struct WWorkspace_info {
> > + /* Workspace stuff */
> > + WMFont *workspace_name_font;
> > +} WWorkspace_info;
> > +
>
> Hi,
>
> May I suggest, as this is a global variable, to place it the the global
> structure instead? You could define something like:
>
> struct {
> WMFont *font_for_name;
> } workspace;
>
> and put it somewhere around src/WindowMaker.h:483
> That way, the variable would be accessed via:
> w_global.workspace.font_for_name
> which would make it look a bit more expressive from my point of view.
Hi,
I was thinking about this idea, but I don't agree. The reason is not related to
write the patches again :-/ I will try to explain it.
Window Maker has some basic elements, like menus, appicons,... but these
elements has relationship between them (like a database). The most important
elemnts (IMO), are the Workspace and the Screen.
Workspace is the place when the windows, appicons, dock, clip,... are placed.
Workspaces are virtual, Screens are hardware related.
In the basic/common model, the user has only one screen. The screen has some
workspaces. Every Workspace has one Clip. All workspaces have one common Dock.
The workspaces share menus,... In this model, we can use the w_global variable.
But, the problem is with "complex" models:
- Type 1, extended screen. In this model, the user has multiple screens, but
the workspace is extended and use all the screens as only one. This model is
like the basic model. No problem.
- Type 2, independent screens. In this model, the screens are independent. The
user has multiple "basic" models. I didn't know this model, but in a previous
question about multiple docks, I discovered it, (thanks Zoltan).
If we use the w_global variable, we can use only the type 1, because this model
is oriented to global variables. If we want independent screens, or hold an
open model for the future, we should avoid use the w_global variable. The
current model is type 2:
startup.c:
/* manage the screens */
for (j = 0; j < max; j++) {
if (defaultScreenOnly || max == 1) {
wScreen[wScreenCount] = wScreenInit(DefaultScreen(dpy));
if (!wScreen[wScreenCount]) {
wfatal(_("it seems that there is already a
window manager running"));
Exit(1);
}
} else {
wScreen[wScreenCount] = wScreenInit(j);
if (!wScreen[wScreenCount]) {
wwarning(_("could not manage screen %i"), j);
continue;
}
}
wScreenCount++;
}
Cheers,
kix
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
--
To unsubscribe, send mail to [email protected].