git.iko.soy/typeable/nixpkgs
on master help sign in
notion: init at 3-2015061300

The notion (not-ion) window manager [1], plus optional (defaulted to true) Xft/pango support (via [2]). Defined a license (notion uses a modified LGPL). As per [3], changes: 1. renamed option from pango -> xft, better to reflect the actual nature of the patch; 2. modified the patch to replace the postPatch changes to system-autodeteck.mk; 3. commited the patch to the nixpkgs repo; 4. removed 'fallbackFont' as an option. Use a sensible default, instead. Many stylistic changes, thanks to @lethalman. [1] http://notion.sourceforge.net [2] http://sourceforge.net/p/notion/feature-requests/47/ [3] https://github.com/NixOS/nixpkgs/pull/8789

commit9b863fac6b812f78754b1fcc89e64e93f59acd42 authorJames Felix Black <james_black@apple.com> dateSun 12 Jul 2015, 20:00 (11 years ago) parent54f308c
5 files changed+703
lib/licenses.nix+5 lib/maintainers.nix+1 pkgs/applications/window-managers/notion/default.nix+33 pkgs/applications/window-managers/notion/notion-xft_nixos.diff+662 pkgs/top-level/all-packages.nix+2
lib/licenses.nix+5
@@ -327,6 +327,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
327327 fullName = "University of Illinois/NCSA Open Source License";
328328 };
329329
330+ notion_lgpl = {
331+ url = "https://raw.githubusercontent.com/raboof/notion/master/LICENSE";
332+ fullName = "Notion modified LGPL";
333+ };
334+
330335 ofl = spdx {
331336 spdxId = "OFL-1.1";
332337 fullName = "SIL Open Font License 1.1";
lib/maintainers.nix+1
@@ -117,6 +117,7 @@
117117 jagajaga = "Arseniy Seroka <ars.seroka@gmail.com>";
118118 jb55 = "William Casarin <bill@casarin.me>";
119119 jcumming = "Jack Cummings <jack@mudshark.org>";
120+ jfb = "James Felix Black <james@yamtime.com>";
120121 jgeerds = "Jascha Geerds <jg@ekby.de>";
121122 jirkamarsik = "Jirka Marsik <jiri.marsik89@gmail.com>";
122123 joachifm = "Joachim Fasting <joachifm@fastmail.fm>";
pkgs/applications/window-managers/notion/default.nixnew file+33
@@ -0,0 +1,33 @@
1+{
2+ enableXft ? true, libXft ? null,
3+ patches ? [],
4+ stdenv, fetchurl,
5+ lua, gettext, groff,
6+ pkgconfig, busybox,
7+ x11, libXinerama, libXrandr, libX11
8+}:
9+
10+assert enableXft -> libXft != null;
11+
12+stdenv.mkDerivation {
13+ name = "notion";
14+ version = "3-2015061300";
15+ meta = with stdenv.lib; {
16+ description = "Tiling tabbed window manager, follow-on to the ion window manager";
17+ homepage = http://notion.sourceforge.net;
18+ platforms = platforms.linux;
19+ license = licenses.notion_lgpl;
20+ maintainers = [maintainers.jfb];
21+ };
22+ src = fetchurl {
23+ url = https://github.com/raboof/notion/archive/3-2015061300.tar.gz;
24+ sha256 = "3c9d9f35a9fb0d17c263b76fe28f7a1a4a05b7d6140545524cc1effd98c5c305";
25+ };
26+
27+ patches = patches ++ stdenv.lib.optional enableXft ./notion-xft_nixos.diff;
28+ postPatch = "substituteInPlace system-autodetect.mk --replace '#PRELOAD_MODULES=1' 'PRELOAD_MODULES=1'";
29+ buildInputs = [x11 lua gettext groff pkgconfig busybox libXinerama libXrandr libX11] ++ stdenv.lib.optional enableXft libXft;
30+
31+ buildFlags = "LUA_DIR=${lua} X11_PREFIX=/no-such-path PREFIX=\${out}";
32+ installFlags = "PREFIX=\${out}";
33+}
pkgs/applications/window-managers/notion/notion-xft_nixos.diffnew file+662
@@ -0,0 +1,662 @@
1+diff -ur notion-3-2015061300/de/brush.c notion-3-2015061300-PATCHED/de/brush.c
2+--- notion-3-2015061300/de/brush.c 2015-06-13 10:37:26.000000000 -0400
3++++ notion-3-2015061300-PATCHED/de/brush.c 2015-07-13 10:37:23.093298917 -0400
4+@@ -48,6 +48,9 @@
5+
6+ gr_stylespec_init(&brush->current_attr);
7+
8++#ifdef XFT
9++ brush->draw=NULL;
10++#endif /* XFT */
11+ style->usecount++;
12+
13+ if(!grbrush_init(&(brush->grbrush))){
14+@@ -128,6 +131,10 @@
15+ {
16+ destyle_unref(brush->d);
17+ brush->d=NULL;
18++#ifdef XFT
19++ if(brush->draw!=NULL)
20++ XftDrawDestroy(brush->draw);
21++#endif /* XFT */
22+ gr_stylespec_unalloc(&brush->current_attr);
23+ grbrush_deinit(&(brush->grbrush));
24+ }
25+@@ -139,6 +146,21 @@
26+ }
27+
28+
29++#ifdef XFT
30++XftDraw *debrush_get_draw(DEBrush *brush, Drawable d)
31++{
32++ if(brush->draw==NULL)
33++ brush->draw=XftDrawCreate(ioncore_g.dpy, d,
34++ XftDEDefaultVisual(),
35++ DefaultColormap(ioncore_g.dpy,
36++ 0));
37++ else
38++ XftDrawChange(brush->draw, d);
39++
40++ return brush->draw;
41++}
42++#endif
43++
44+ /*}}}*/
45+
46+
47+diff -ur notion-3-2015061300/de/brush.h notion-3-2015061300-PATCHED/de/brush.h
48+--- notion-3-2015061300/de/brush.h 2015-06-13 10:37:26.000000000 -0400
49++++ notion-3-2015061300-PATCHED/de/brush.h 2015-07-13 10:37:23.096298747 -0400
50+@@ -15,6 +15,10 @@
51+ #include <ioncore/gr.h>
52+ #include <ioncore/rectangle.h>
53+
54++#ifdef XFT
55++#include <X11/Xft/Xft.h>
56++#endif /* XFT */
57++
58+ INTRCLASS(DEBrush);
59+
60+ #include "style.h"
61+@@ -33,6 +37,9 @@
62+ DECLCLASS(DEBrush){
63+ GrBrush grbrush;
64+ DEStyle *d;
65++#ifdef XFT
66++ XftDraw *draw;
67++#endif
68+ DEBrushExtrasFn *extras_fn;
69+ int indicator_w;
70+ Window win;
71+@@ -108,5 +115,8 @@
72+ extern void debrush_fill_area(DEBrush *brush, const WRectangle *geom);
73+ extern void debrush_clear_area(DEBrush *brush, const WRectangle *geom);
74+
75++#ifdef XFT
76++XftDraw *debrush_get_draw(DEBrush *brush, Drawable d);
77++#endif
78+
79+ #endif /* ION_DE_BRUSH_H */
80+diff -ur notion-3-2015061300/de/colour.c notion-3-2015061300-PATCHED/de/colour.c
81+--- notion-3-2015061300/de/colour.c 2015-06-13 10:37:26.000000000 -0400
82++++ notion-3-2015061300-PATCHED/de/colour.c 2015-07-13 10:37:23.098298633 -0400
83+@@ -12,9 +12,21 @@
84+
85+ bool de_alloc_colour(WRootWin *rootwin, DEColour *ret, const char *name)
86+ {
87++#ifndef XFT
88+ XColor c;
89+ bool ok=FALSE;
90++#else /* XFT */
91++ if(name==NULL)
92++ return FALSE;
93++ return XftColorAllocName(
94++ ioncore_g.dpy,
95++ XftDEDefaultVisual(),
96++ rootwin->default_cmap,
97++ name,
98++ ret);
99++#endif /* XFT */
100+
101++#ifndef XFT
102+ if(name==NULL)
103+ return FALSE;
104+
105+@@ -25,11 +37,13 @@
106+ }
107+
108+ return ok;
109++#endif /* ! XFT */
110+ }
111+
112+
113+ bool de_duplicate_colour(WRootWin *rootwin, DEColour in, DEColour *out)
114+ {
115++#ifndef XFT
116+ XColor c;
117+ c.pixel=in;
118+ XQueryColor(ioncore_g.dpy, rootwin->default_cmap, &c);
119+@@ -38,11 +52,20 @@
120+ return TRUE;
121+ }
122+ return FALSE;
123++#else /* XFT */
124++ return XftColorAllocName(
125++ ioncore_g.dpy,
126++ XftDEDefaultVisual(),
127++ rootwin->default_cmap,
128++ &(in.color),
129++ out);
130++#endif /* XFT */
131+ }
132+
133+
134+ void de_free_colour_group(WRootWin *rootwin, DEColourGroup *cg)
135+ {
136++#ifndef XFT
137+ DEColour pixels[5];
138+
139+ pixels[0]=cg->bg;
140+@@ -54,15 +77,26 @@
141+ XFreeColors(ioncore_g.dpy, rootwin->default_cmap, pixels, 5, 0);
142+
143+ gr_stylespec_unalloc(&cg->spec);
144++#else /* XFT */
145++ de_free_colour(rootwin, cg->bg);
146++ de_free_colour(rootwin, cg->fg);
147++ de_free_colour(rootwin, cg->hl);
148++ de_free_colour(rootwin, cg->sh);
149++ de_free_colour(rootwin, cg->pad);
150++#endif /* XFT */
151+ }
152+
153+
154+ void de_free_colour(WRootWin *rootwin, DEColour col)
155+ {
156++#ifndef XFT
157+ DEColour pixels[1];
158+
159+ pixels[0]=col;
160+
161+ XFreeColors(ioncore_g.dpy, rootwin->default_cmap, pixels, 1, 0);
162++#else /* XFT */
163++ XftColorFree(ioncore_g.dpy, XftDEDefaultVisual(), rootwin->default_cmap, &col);
164++#endif /* XFT */
165+ }
166+
167+diff -ur notion-3-2015061300/de/colour.h notion-3-2015061300-PATCHED/de/colour.h
168+--- notion-3-2015061300/de/colour.h 2015-06-13 10:37:26.000000000 -0400
169++++ notion-3-2015061300-PATCHED/de/colour.h 2015-07-13 10:37:23.099298576 -0400
170+@@ -12,12 +12,19 @@
171+ #include <ioncore/common.h>
172+ #include <ioncore/global.h>
173+ #include <ioncore/rootwin.h>
174++#ifdef XFT
175++#include <X11/Xft/Xft.h>
176++#endif /* XFT */
177+
178+
179+ INTRSTRUCT(DEColourGroup);
180+
181+
182++#ifndef XFT
183+ typedef unsigned long DEColour;
184++#else /* XFT */
185++typedef XftColor DEColour;
186++#endif /* XFT */
187+
188+
189+ DECLSTRUCT(DEColourGroup){
190+@@ -34,5 +41,6 @@
191+ bool de_duplicate_colour(WRootWin *rootwin, DEColour in, DEColour *out);
192+ void de_free_colour_group(WRootWin *rootwin, DEColourGroup *cg);
193+ void de_free_colour(WRootWin *rootwin, DEColour col);
194++#define XftDEDefaultVisual() DefaultVisual(ioncore_g.dpy, 0)
195+
196+ #endif /* ION_DE_COLOUR_H */
197+diff -ur notion-3-2015061300/de/draw.c notion-3-2015061300-PATCHED/de/draw.c
198+--- notion-3-2015061300/de/draw.c 2015-06-13 10:37:26.000000000 -0400
199++++ notion-3-2015061300-PATCHED/de/draw.c 2015-07-13 10:37:23.109298008 -0400
200+@@ -20,6 +20,14 @@
201+ #include <X11/extensions/shape.h>
202+
203+
204++#ifndef XFT
205++#define PIXEL(x) x
206++#else /* XFT */
207++#define PIXEL(x) x.pixel
208++#endif /* XFT */
209++
210++
211++
212+ /*{{{ Colour group lookup */
213+
214+
215+@@ -84,8 +92,7 @@
216+ w--;
217+ h--;
218+
219+- XSetForeground(ioncore_g.dpy, gc, tlc);
220+-
221++ XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc));
222+
223+ a=(br!=0);
224+ b=0;
225+@@ -104,7 +111,7 @@
226+ }
227+
228+
229+- XSetForeground(ioncore_g.dpy, gc, brc);
230++ XSetForeground(ioncore_g.dpy, gc, PIXEL(brc));
231+
232+ a=(tl!=0);
233+ b=0;
234+@@ -141,23 +148,23 @@
235+ GrBorderLine line)
236+ {
237+ if(line==GR_BORDERLINE_LEFT && geom->h>0 && tl>0){
238+- XSetForeground(ioncore_g.dpy, gc, tlc);
239+- XSetBackground(ioncore_g.dpy, gc, tlc);
240++ XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc));
241++ XSetBackground(ioncore_g.dpy, gc, PIXEL(tlc));
242+ XFillRectangle(ioncore_g.dpy, win, gc, geom->x, geom->y, tl, geom->h);
243+ geom->x+=tl;
244+ }else if(line==GR_BORDERLINE_TOP && geom->w>0 && tl>0){
245+- XSetForeground(ioncore_g.dpy, gc, tlc);
246+- XSetBackground(ioncore_g.dpy, gc, tlc);
247++ XSetForeground(ioncore_g.dpy, gc, PIXEL(tlc));
248++ XSetBackground(ioncore_g.dpy, gc, PIXEL(tlc));
249+ XFillRectangle(ioncore_g.dpy, win, gc, geom->x, geom->y, geom->w, tl);
250+ geom->y+=tl;
251+ }else if(line==GR_BORDERLINE_RIGHT && geom->h>0 && br>0){
252+- XSetForeground(ioncore_g.dpy, gc, brc);
253+- XSetBackground(ioncore_g.dpy, gc, brc);
254++ XSetForeground(ioncore_g.dpy, gc, PIXEL(brc));
255++ XSetBackground(ioncore_g.dpy, gc, PIXEL(brc));
256+ XFillRectangle(ioncore_g.dpy, win, gc, geom->x+geom->w-br, geom->y, br, geom->h);
257+ geom->w-=br;
258+ }else if(line==GR_BORDERLINE_BOTTOM && geom->w>0 && br>0){
259+- XSetForeground(ioncore_g.dpy, gc, brc);
260+- XSetBackground(ioncore_g.dpy, gc, brc);
261++ XSetForeground(ioncore_g.dpy, gc, PIXEL(brc));
262++ XSetBackground(ioncore_g.dpy, gc, PIXEL(brc));
263+ XFillRectangle(ioncore_g.dpy, win, gc, geom->x, geom->y+geom->h-br, geom->w, br);
264+ geom->h-=br;
265+ }
266+@@ -388,7 +395,7 @@
267+ }
268+
269+ if(ISSET(a2, GR_ATTR(tagged)) || ISSET(a1, GR_ATTR(tagged))){
270+- XSetForeground(ioncore_g.dpy, d->copy_gc, cg->fg);
271++ XSetForeground(ioncore_g.dpy, d->copy_gc, PIXEL(cg->fg));
272+
273+ copy_masked(brush, d->tag_pixmap, brush->win, 0, 0,
274+ d->tag_pixmap_w, d->tag_pixmap_h,
275+@@ -437,7 +444,7 @@
276+ GC gc=brush->d->normal_gc;
277+
278+ if(TRUE/*needfill*/){
279+- XSetForeground(ioncore_g.dpy, gc, cg->bg);
280++ XSetForeground(ioncore_g.dpy, gc, PIXEL(cg->bg));
281+ XFillRectangle(ioncore_g.dpy, brush->win, gc, geom->x, geom->y,
282+ geom->w, geom->h);
283+ }
284+@@ -605,7 +612,7 @@
285+ attr.background_pixmap=ParentRelative;
286+ }else{
287+ attrflags=CWBackPixel;
288+- attr.background_pixel=brush->d->cgrp.bg;
289++ attr.background_pixel=brush->d->PIXEL(cgrp.bg);
290+ }
291+
292+ XChangeWindowAttributes(ioncore_g.dpy, brush->win, attrflags, &attr);
293+@@ -621,7 +628,7 @@
294+ if(cg==NULL)
295+ return;
296+
297+- XSetForeground(ioncore_g.dpy, gc, cg->bg);
298++ XSetForeground(ioncore_g.dpy, gc, PIXEL(cg->bg));
299+ XFillRectangle(ioncore_g.dpy, brush->win, gc,
300+ geom->x, geom->y, geom->w, geom->h);
301+ }
302+diff -ur notion-3-2015061300/de/font.c notion-3-2015061300-PATCHED/de/font.c
303+--- notion-3-2015061300/de/font.c 2015-06-13 10:37:26.000000000 -0400
304++++ notion-3-2015061300-PATCHED/de/font.c 2015-07-13 10:37:23.118297497 -0400
305+@@ -13,7 +13,9 @@
306+ #include <ioncore/common.h>
307+ #include <ioncore/log.h>
308+ #include "font.h"
309++#ifndef XFT
310+ #include "fontset.h"
311++#endif /* ! XFT */
312+ #include "brush.h"
313+ #include "precompose.h"
314+
315+@@ -106,6 +108,9 @@
316+
317+ DEFont *de_load_font(const char *fontname)
318+ {
319++#ifdef XFT
320++ XftFont *font;
321++#endif
322+ DEFont *fnt;
323+ XFontSet fontset=NULL;
324+ XFontStruct *fontstruct=NULL;
325+@@ -120,7 +125,8 @@
326+ return fnt;
327+ }
328+ }
329+-
330++
331++#ifndef XFT
332+ if(ioncore_g.use_mb && !(ioncore_g.enc_utf8 && iso10646_font(fontname))){
333+ LOG(DEBUG, FONT, "Loading fontset %s", fontname);
334+ fontset=de_create_font_set(fontname);
335+@@ -149,13 +155,34 @@
336+ return NULL;
337+ }
338+
339++#else /* XFT */
340++ if(strncmp(fontname, "xft:", 4)==0){
341++ font=XftFontOpenName(ioncore_g.dpy, DefaultScreen(ioncore_g.dpy),
342++ fontname+4);
343++ }else{
344++ font=XftFontOpenXlfd(ioncore_g.dpy, DefaultScreen(ioncore_g.dpy), fontname);
345++ }
346++
347++ if(font==NULL){
348++ if(strcmp(fontname, CF_FALLBACK_FONT_NAME)!=0){
349++ warn(TR("Could not load font \"%s\", trying \"%s\""),
350++ fontname, CF_FALLBACK_FONT_NAME);
351++ return de_load_font(CF_FALLBACK_FONT_NAME);
352++ }
353++ return NULL;
354++ }
355++#endif /* XFT */
356+ fnt=ALLOC(DEFont);
357+
358+ if(fnt==NULL)
359+ return NULL;
360+
361++#ifndef XFT
362+ fnt->fontset=fontset;
363+ fnt->fontstruct=fontstruct;
364++#else
365++ fnt->font=font;
366++#endif
367+ fnt->pattern=scopy(fontname);
368+ fnt->next=NULL;
369+ fnt->prev=NULL;
370+@@ -175,11 +202,13 @@
371+ style->font=font;
372+ font->refcount++;
373+
374++#ifndef XFT
375+ if(style->font->fontstruct!=NULL){
376+ XSetFont(ioncore_g.dpy, style->normal_gc,
377+ style->font->fontstruct->fid);
378+ }
379+
380++#endif /* ! XFT */
381+ return TRUE;
382+ }
383+
384+@@ -194,11 +223,13 @@
385+ if(style->font==NULL)
386+ return FALSE;
387+
388++#ifndef XFT
389+ if(style->font->fontstruct!=NULL){
390+ XSetFont(ioncore_g.dpy, style->normal_gc,
391+ style->font->fontstruct->fid);
392+ }
393+
394++#endif /* ! XFT */
395+ return TRUE;
396+ }
397+
398+@@ -208,10 +239,15 @@
399+ if(--font->refcount!=0)
400+ return;
401+
402++#ifndef XFT
403+ if(font->fontset!=NULL)
404+ XFreeFontSet(ioncore_g.dpy, font->fontset);
405+ if(font->fontstruct!=NULL)
406+ XFreeFont(ioncore_g.dpy, font->fontstruct);
407++#else /* XFT */
408++ if(font->font!=NULL)
409++ XftFontClose(ioncore_g.dpy, font->font);
410++#endif /* XFT */
411+ if(font->pattern!=NULL)
412+ free(font->pattern);
413+
414+@@ -239,6 +275,7 @@
415+
416+ void defont_get_font_extents(DEFont *font, GrFontExtents *fnte)
417+ {
418++#ifndef XFT
419+ if(font->fontset!=NULL){
420+ XFontSetExtents *ext=XExtentsOfFontSet(font->fontset);
421+ if(ext==NULL)
422+@@ -254,7 +291,14 @@
423+ fnte->baseline=fnt->ascent;
424+ return;
425+ }
426+-
427++#else /* XFT */
428++ if(font->font!=NULL){
429++ fnte->max_height=font->font->ascent+font->font->descent;
430++ fnte->max_width=font->font->max_advance_width;
431++ fnte->baseline=font->font->ascent;
432++ return;
433++ }
434++#endif /* XFT */
435+ fail:
436+ DE_RESET_FONT_EXTENTS(fnte);
437+ }
438+@@ -271,6 +315,7 @@
439+
440+ uint defont_get_text_width(DEFont *font, const char *text, uint len)
441+ {
442++#ifndef XFT
443+ if(font->fontset!=NULL){
444+ XRectangle lext;
445+ #ifdef CF_DE_USE_XUTF8
446+@@ -298,6 +343,18 @@
447+ }else{
448+ return 0;
449+ }
450++#else /* XFT */
451++ if(font->font!=NULL){
452++ XGlyphInfo extents;
453++ if(ioncore_g.enc_utf8)
454++ XftTextExtentsUtf8(ioncore_g.dpy, font->font, (XftChar8 *)text, len, &extents);
455++ else
456++ XftTextExtents8(ioncore_g.dpy, font->font, (XftChar8 *)text, len, &extents);
457++ return extents.xOff;
458++ }else{
459++ return 0;
460++ }
461++#endif /* XFT */
462+ }
463+
464+
465+@@ -307,6 +364,7 @@
466+ /*{{{ String drawing */
467+
468+
469++#ifndef XFT
470+ void debrush_do_draw_string_default(DEBrush *brush, int x, int y,
471+ const char *str, int len, bool needfill,
472+ DEColourGroup *colours)
473+@@ -366,6 +424,43 @@
474+ }
475+ }
476+
477++#else /* XFT */
478++void debrush_do_draw_string_default(DEBrush *brush,
479++ int x, int y, const char *str,
480++ int len, bool needfill,
481++ DEColourGroup *colours)
482++{
483++ Window win = brush->win;
484++ GC gc=brush->d->normal_gc;
485++ XftDraw *draw;
486++ XftFont *font;
487++
488++ if(brush->d->font==NULL)
489++ return;
490++
491++ font=brush->d->font->font;
492++ draw=debrush_get_draw(brush, win);
493++
494++ if(needfill){
495++ XGlyphInfo extents;
496++ if(ioncore_g.enc_utf8){
497++ XftTextExtentsUtf8(ioncore_g.dpy, font, (XftChar8 *)str, len,
498++ &extents);
499++ }else{
500++ XftTextExtents8(ioncore_g.dpy, font, (XftChar8 *)str, len, &extents);
501++ XftDrawRect(draw, &(colours->bg), x-extents.x, y-extents.y,
502++ extents.width+10, extents.height);
503++ }
504++ }
505++
506++ if(ioncore_g.enc_utf8){
507++ XftDrawStringUtf8(draw, &(colours->fg), font, x, y, (XftChar8 *)str,
508++ len);
509++ }else{
510++ XftDrawString8(draw, &(colours->fg), font, x, y, (XftChar8 *)str, len);
511++ }
512++}
513++#endif /* XFT */
514+
515+ void debrush_do_draw_string(DEBrush *brush, int x, int y,
516+ const char *str, int len, bool needfill,
517+diff -ur notion-3-2015061300/de/font.h notion-3-2015061300-PATCHED/de/font.h
518+--- notion-3-2015061300/de/font.h 2015-06-13 10:37:26.000000000 -0400
519++++ notion-3-2015061300-PATCHED/de/font.h 2015-07-13 10:37:23.119297440 -0400
520+@@ -12,6 +12,9 @@
521+
522+ #include <ioncore/common.h>
523+ #include <ioncore/gr.h>
524++#ifdef XFT
525++#include <X11/Xft/Xft.h>
526++#endif /* XFT */
527+
528+ INTRSTRUCT(DEFont);
529+
530+@@ -27,6 +30,9 @@
531+ int refcount;
532+ XFontSet fontset;
533+ XFontStruct *fontstruct;
534++#ifdef XFT /* XFT */
535++ XftFont *font;
536++#endif /* XFT */
537+ DEFont *next, *prev;
538+ };
539+
540+diff -ur notion-3-2015061300/de/init.c notion-3-2015061300-PATCHED/de/init.c
541+--- notion-3-2015061300/de/init.c 2015-06-13 10:37:26.000000000 -0400
542++++ notion-3-2015061300-PATCHED/de/init.c 2015-07-13 10:37:23.122297270 -0400
543+@@ -165,17 +165,26 @@
544+ {
545+ bool bgset;
546+ DEColour padinh;
547+-
548++ DEColour black, white;
549++
550++#ifdef XFT
551++ de_alloc_colour(rootwin, &black, "black");
552++ de_alloc_colour(rootwin, &white, "white");
553++#else
554++ black=DE_BLACK(rootwin);
555++ white=DE_WHITE(rootwin);
556++#endif
557++
558+ de_get_colour(rootwin, &(cg->hl), tab, "highlight_colour",
559+- (based_on ? based_on->cgrp.hl : DE_WHITE(rootwin)));
560++ (based_on ? based_on->cgrp.hl : white));
561+ de_get_colour(rootwin, &(cg->sh), tab, "shadow_colour",
562+- (based_on ? based_on->cgrp.sh : DE_WHITE(rootwin)));
563++ (based_on ? based_on->cgrp.sh : white));
564+ de_get_colour(rootwin, &(cg->fg), tab, "foreground_colour",
565+- (based_on ? based_on->cgrp.fg : DE_WHITE(rootwin)));
566++ (based_on ? based_on->cgrp.fg : white));
567+ bgset=de_get_colour(rootwin, &(cg->bg), tab, "background_colour",
568+- (based_on ? based_on->cgrp.bg : DE_BLACK(rootwin)));
569++ (based_on ? based_on->cgrp.bg : black));
570+
571+- padinh=(based_on ? based_on->cgrp.pad : DE_WHITE(rootwin));
572++ padinh=(based_on ? based_on->cgrp.pad : white);
573+
574+ de_get_colour_(rootwin, &(cg->pad), tab, "padding_colour",
575+ (bgset ? cg->bg : padinh), padinh);
576+diff -ur notion-3-2015061300/de/style.c notion-3-2015061300-PATCHED/de/style.c
577+--- notion-3-2015061300/de/style.c 2015-06-13 10:37:26.000000000 -0400
578++++ notion-3-2015061300-PATCHED/de/style.c 2015-07-13 10:37:23.128296929 -0400
579+@@ -70,10 +70,17 @@
580+ /*gcv.function=GXclear;*/
581+ gcv.stipple=stipple_pixmap;
582+ gcvmask=GCFillStyle|GCStipple/*|GCFunction*/;
583++#ifndef XFT
584+ if(style->font!=NULL && style->font->fontstruct!=NULL){
585+ gcv.font=style->font->fontstruct->fid;
586+ gcvmask|=GCFont;
587+ }
588++#else /* XFT */
589++// if(style->font!=NULL){
590++// gcv.font=style->font;
591++// gcvmask|=GCFont;
592++// }
593++#endif /* XFT */
594+
595+ style->stipple_gc=XCreateGC(dpy, root, gcvmask, &gcv);
596+ XCopyGC(dpy, style->normal_gc,
597+@@ -201,6 +208,14 @@
598+
599+ bool destyle_init(DEStyle *style, WRootWin *rootwin, const char *name)
600+ {
601++ DEColour black, white;
602++#ifdef XFT
603++ de_alloc_colour(rootwin, &black, "black");
604++ de_alloc_colour(rootwin, &white, "white");
605++#else
606++ black=DE_BLACK(rootwin);
607++ white=DE_WHITE(rootwin);
608++#endif /* XFT */
609+ if(!gr_stylespec_load(&style->spec, name))
610+ return FALSE;
611+
612+@@ -223,11 +238,11 @@
613+ style->textalign=DEALIGN_CENTER;
614+
615+ style->cgrp_alloced=FALSE;
616+- style->cgrp.bg=DE_BLACK(rootwin);
617+- style->cgrp.pad=DE_BLACK(rootwin);
618+- style->cgrp.fg=DE_WHITE(rootwin);
619+- style->cgrp.hl=DE_WHITE(rootwin);
620+- style->cgrp.sh=DE_WHITE(rootwin);
621++ style->cgrp.bg=black;
622++ style->cgrp.pad=black;
623++ style->cgrp.fg=white;
624++ style->cgrp.hl=white;
625++ style->cgrp.sh=white;
626+ gr_stylespec_init(&style->cgrp.spec);
627+
628+ style->font=NULL;
629+diff -ur notion-3-2015061300/de/style.h notion-3-2015061300-PATCHED/de/style.h
630+--- notion-3-2015061300/de/style.h 2015-06-13 10:37:26.000000000 -0400
631++++ notion-3-2015061300-PATCHED/de/style.h 2015-07-13 10:37:23.130296815 -0400
632+@@ -80,6 +80,7 @@
633+ Pixmap tag_pixmap;
634+ int tag_pixmap_w;
635+ int tag_pixmap_h;
636++ int xft_style;
637+
638+ DEStyle *next, *prev;
639+ };
640+diff -ur notion-3-2015061300/system-autodetect.mk notion-3-2015061300-PATCHED/system-autodetect.mk
641+--- notion-3-2015061300/system-autodetect.mk 2015-06-13 10:37:26.000000000 -0400
642++++ notion-3-2015061300-PATCHED/system-autodetect.mk 2015-07-13 10:38:14.921332013 -0400
643+@@ -103,6 +103,19 @@
644+
645+
646+ ##
647++## Xft support
648++##
649++
650++USE_XFT=1
651++
652++ifeq ($(USE_XFT),1)
653++EXTRA_INCLUDES += `pkg-config xft --cflags`
654++EXTRA_LIBS += `pkg-config xft --libs`
655++DEFINES += -DXFT -DCF_FALLBACK_FONT_NAME=\"Sans\"
656++endif
657++
658++
659++##
660+ ## Localisation
661+ ##
662+
pkgs/top-level/all-packages.nix+2
@@ -12112,6 +12112,8 @@ let
1211212112
1211312113 mutt-kz = callPackage ../applications/networking/mailreaders/mutt-kz { };
1211412114
12115+ notion = callPackage ../applications/window-managers/notion { };
12116+
1211512117 openshift = callPackage ../applications/networking/cluster/openshift { };
1211612118
1211712119 panamax_api = callPackage ../applications/networking/cluster/panamax/api {