1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

Moved 'workspace_name_font' from the Screen to a Workspace object in the global namespace

The new workspace struct 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.
This commit is contained in:
Rodolfo García Peñas (kix)
2013-10-08 00:56:29 +02:00
committed by Carlos R. Mafra
parent 4ac65ab260
commit f60e65001b
4 changed files with 12 additions and 9 deletions

View File

@@ -481,6 +481,11 @@ extern struct wmaker_global_variables {
} timestamp;
/* Workspace related */
struct {
WMFont *font_for_name; /* used during workspace switch */
} workspace;
/* definition for X Atoms */
struct {

View File

@@ -2587,10 +2587,10 @@ static int setLargeDisplayFont(WScreen *scr, WDefaultEntry *entry, void *tdata,
{
WMFont *font = tdata;
if (scr->workspace_name_font)
WMReleaseFont(scr->workspace_name_font);
if (w_global.workspace.font_for_name)
WMReleaseFont(w_global.workspace.font_for_name);
scr->workspace_name_font = font;
w_global.workspace.font_for_name = font;
return 0;
}

View File

@@ -163,8 +163,6 @@ typedef struct _WScreen {
needs to be a core font so we can
use it with a XORing GC */
WMFont *workspace_name_font;
WMColor *select_color;
WMColor *select_text_color;
/* foreground colors */

View File

@@ -278,8 +278,8 @@ static void showWorkspaceName(WScreen * scr, int workspace)
data = wmalloc(sizeof(WorkspaceNameData));
data->back = NULL;
w = WMWidthOfString(scr->workspace_name_font, name, len);
h = WMFontHeight(scr->workspace_name_font);
w = WMWidthOfString(w_global.workspace.font_for_name, name, len);
h = WMFontHeight(w_global.workspace.font_for_name);
#ifdef XINERAMA
head = wGetHeadForPointerLocation(scr);
@@ -351,7 +351,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
for (x = 0; x <= 4; x++)
for (y = 0; y <= 4; y++)
WMDrawString(scr->wmscreen, text, scr->white, scr->workspace_name_font, x, y, name, len);
WMDrawString(scr->wmscreen, text, scr->white, w_global.workspace.font_for_name, x, y, name, len);
XSetForeground(dpy, scr->mono_gc, 1);
XSetBackground(dpy, scr->mono_gc, 0);
@@ -363,7 +363,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
XFillRectangle(dpy, text, WMColorGC(scr->black), 0, 0, w + 4, h + 4);
WMDrawString(scr->wmscreen, text, scr->white, scr->workspace_name_font, 2, 2, name, len);
WMDrawString(scr->wmscreen, text, scr->white, w_global.workspace.font_for_name, 2, 2, name, len);
#ifdef SHAPE
XShapeCombineMask(dpy, scr->workspace_name, ShapeBounding, 0, 0, mask, ShapeSet);