On Thu, 5 Sep 2013 at 21:08:22 +0200, Rodolfo García Peñas (kix) wrote:
> From: "Rodolfo García Peñas (kix)" <[email protected]>
>
> The new struct wks_nfo 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.
> ---
> src/defaults.c | 10 +++++-----
> src/main.c | 4 ++++
> src/screen.h | 2 --
> src/workspace.c | 9 +++++----
> src/workspace.h | 4 +++-
> 5 files changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/src/defaults.c b/src/defaults.c
> index 02f01a3..67ca62a 100644
> --- a/src/defaults.c
> +++ b/src/defaults.c
> @@ -76,6 +76,7 @@ extern WDDomain *WDWindowMaker;
> extern WDDomain *WDWindowAttributes;
> extern WDDomain *WDRootMenu;
> extern int wScreenCount;
> +extern wks_info wks_nfo;
> extern WShortKey wKeyBindings[WKBD_LAST];
>
> typedef struct _WDefaultEntry WDefaultEntry;
> @@ -2584,15 +2585,14 @@ static int setClipTitleFont(WScreen * scr,
> WDefaultEntry * entry, void *tdata, v
> return REFRESH_ICON_FONT;
> }
>
> -static int setLargeDisplayFont(WScreen * scr, WDefaultEntry * entry, void
> *tdata, void *foo)
> +static int setLargeDisplayFont(WScreen *scr, WDefaultEntry *entry, void
> *tdata, void *foo)
> {
> WMFont *font = tdata;
>
> - if (scr->workspace_name_font) {
> - WMReleaseFont(scr->workspace_name_font);
> - }
> + if (wks_nfo.workspace_name_font)
> + WMReleaseFont(wks_nfo.workspace_name_font);
>
> - scr->workspace_name_font = font;
> + wks_nfo.workspace_name_font = font;
>
> return 0;
> }
> diff --git a/src/main.c b/src/main.c
> index 69a68e2..18f6002 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -56,6 +56,7 @@
> #include "dialog.h"
> #include "main.h"
> #include "monitor.h"
> +#include "workspace.h"
>
> #include <WINGs/WUtil.h>
>
> @@ -129,6 +130,9 @@ Atom _XA_WM_IGNORE_FOCUS_EVENTS;
> /* cursors */
> Cursor wCursor[WCUR_LAST];
>
> +/* Workspace information */
> +wks_info wks_nfo;
This patch is a great idea, but I feel the naming convention is
on the borderline of too cryptic. Perhaps it's just me, but
wks_nfo
is a bit disturbing and distracts a bit while reading the code.
> --- a/src/workspace.h
> +++ b/src/workspace.h
> @@ -22,7 +22,9 @@
> #ifndef WMWORKSPACE_H_
> #define WMWORKSPACE_H_
>
> -
> +typedef struct wks_info {
> + WMFont *workspace_name_font;
> +} wks_info;
>
> typedef struct WWorkspace {
> char *name;
Perhaps 'typedef WWorkspace_info' would make
more sense? Note the extra "W" like in WWorkspace -- I think
it is good to have patterns like this.
And then we could have
WWorkspace_info wks_info;
instead of
wks_info wks_nfo;
May I suggest you to rename this? Perhaps it makes more sense to
redo your last series altogether. Remove the troublesome patch about
True vs False and do the above renaming.
Since it's on #next, I can freely substitute the old series by the new
one with rebase.
--
To unsubscribe, send mail to [email protected].