Re: Patches for the 2.3 branch

2013-05-24 Thread Gregor Best
On Thu, May 23, 2013 at 11:10:15AM +0200, Gregor Best wrote:
 [...]
 I have also attached another patch that sets the default mwfact for
 new tags to ~0.618, which is the inverse of the golden ratio. IMHO
 this yields a more pleasant split between master and slave windows.
 It's purely cosmetic though.
 [...]

Attached is another patch that fully changes the default mwfact from .5
to .618. I seem to have missed quite a few places in the first
iteration.

-- 
Gregor Best
From 5ca5ba895be25763a25358d366495d2cc1dd4850 Mon Sep 17 00:00:00 2001
From: Gregor Best g...@ring0.de
Date: Fri, 24 May 2013 12:16:17 +0200
Subject: [PATCH] Completely change the default mwfact to .618

The original changes to tag.c missed quite a bunch.

Signed-off-by: Gregor Best g...@ring0.de
---
 common/configopts.c | 2 +-
 config.c| 2 +-
 tag.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/configopts.c b/common/configopts.c
index e69c223..17b2b58 100644
--- a/common/configopts.c
+++ b/common/configopts.c
@@ -482,7 +482,7 @@ cfg_opt_t tag_opts[] =
 /** Default layout for this tag. */
 CFG_STR((char *) layout, (char *) tile, CFGF_NONE),
 /** Default master width factor for this tag. */
-CFG_FLOAT((char *) mwfact, 0.5, CFGF_NONE),
+CFG_FLOAT((char *) mwfact, 0.618, CFGF_NONE),
 /** Default number of master windows for this tag. */
 CFG_INT((char *) nmaster, 1, CFGF_NONE),
 /** Default number of window columns for this tag. */
diff --git a/config.c b/config.c
index 0176b0a..c2f9869 100644
--- a/config.c
+++ b/config.c
@@ -467,7 +467,7 @@ config_parse_screen(cfg_t *cfg, int screen)
 else
 {
 warn(fatal: no tags found in configuration file\n);
-tag = tag_new(default, virtscreen-layouts, 0.5, 1, 1);
+tag = tag_new(default, virtscreen-layouts, 0.618, 1, 1);
 tag_push_to_screen(tag, screen);
 }
 
diff --git a/tag.c b/tag.c
index f7acbcf..9de18a6 100644
--- a/tag.c
+++ b/tag.c
@@ -483,7 +483,7 @@ uicb_tag_create(int screen, char *arg)
 if(!a_strlen(arg))
 return;
 
-tag = tag_new(arg, globalconf.screens[screen].layouts, 0.5, 1, 1);
+tag = tag_new(arg, globalconf.screens[screen].layouts, 0.618, 1, 1);
 tag_append_to_screen(tag, screen);
 }
 
-- 
1.8.2.2



pgp7GLwDCdWZg.pgp
Description: PGP signature


Re: Patches for the 2.3 branch

2013-05-24 Thread Julien Danjou
On Fri, May 24 2013, Gregor Best wrote:

 Attached is another patch that fully changes the default mwfact from .5
 to .618. I seem to have missed quite a few places in the first
 iteration.

Pushed.

-- 
Julien Danjou
-- Free Software hacker - freelance consultant
-- http://julien.danjou.info


signature.asc
Description: PGP signature


Re: Patches for the 2.3 branch

2013-05-23 Thread Gregor Best
On Wed, May 22, 2013 at 03:03:13PM +0200, Julien Danjou wrote:
 [...]
 I wonder if you shouldn't change configure.ac, since I don't think we
 used to depend on Xkb.
 [...]

Of course. The attached version of the patch fixes that. I have also
attached another patch that sets the default mwfact for new tags to
~0.618, which is the inverse of the golden ratio. IMHO this yields a
more pleasant split between master and slave windows. It's purely
cosmetic though.

-- 
Gregor Best
From 86318201148fca7335ff69ea7939d8c5b5f87dbc Mon Sep 17 00:00:00 2001
From: Gregor Best g...@ring0.de
Date: Tue, 21 May 2013 19:19:15 +0200
Subject: [PATCH 1/2] Replace obsolete XKeycodeToKeysym

Signed-off-by: Gregor Best g...@ring0.de
---
 configure.ac | 2 ++
 event.c  | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 41c0a87..4f562cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,8 @@ PKG_CHECK_MODULES([xinerama], [xinerama],,
[AC_MSG_ERROR([awesome requires Xinerama.])])
 PKG_CHECK_MODULES([xrandr], [xrandr],,
[AC_MSG_ERROR([awesome requires Xrandr.])])
+PKG_CHECK_MODULES([xkb], [xkbui],,
+   [AC_MSG_ERROR([awesome requires XKB.])])
 AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [Build with gtk library 
(default: disabled)]))
 
 if test x$with_gtk == xyes; then
diff --git a/event.c b/event.c
index d03b0f9..ccc5410 100644
--- a/event.c
+++ b/event.c
@@ -20,6 +20,7 @@
  */
 
 #include X11/keysym.h
+#include X11/XKBlib.h
 #include X11/Xatom.h
 #include X11/Xutil.h
 #include X11/extensions/shape.h
@@ -350,7 +351,7 @@ event_handle_keypress(XEvent *e)
 break;
 }
 
-keysym = XKeycodeToKeysym(globalconf.display, (KeyCode) ev-keycode, 0);
+keysym = XkbKeycodeToKeysym(globalconf.display, (KeyCode) ev-keycode, 0, 
0);
 
 for(k = globalconf.keys; k; k = k-next)
 if(((k-keycode  ev-keycode == k-keycode) || (k-keysym  keysym 
== k-keysym)) 
-- 
1.8.2.2

From f1de02745537f2ae5cc0eb7f11f13362516ae3a1 Mon Sep 17 00:00:00 2001
From: Gregor Best g...@ring0.de
Date: Thu, 23 May 2013 11:07:30 +0200
Subject: [PATCH 2/2] Use inverse of the golden ratio for default mwfact

This makes for a more pleasant splitting between master and slave
windows.

Signed-off-by: Gregor Best g...@ring0.de
---
 tag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tag.c b/tag.c
index ee89685..f7acbcf 100644
--- a/tag.c
+++ b/tag.c
@@ -50,7 +50,7 @@ tag_new(const char *name, Layout *layout, double mwfact, int 
nmaster, int ncol)
 
 tag-mwfact = mwfact;
 if(tag-mwfact = 0 || tag-mwfact = 1)
-tag-mwfact = 0.5;
+tag-mwfact = 1.0 / 1.618; /* Reverse of the golden ratio */
 
 if((tag-nmaster = nmaster)  0)
 tag-nmaster = 1;
-- 
1.8.2.2



Re: Patches for the 2.3 branch

2013-05-23 Thread Julien Danjou
On Thu, May 23 2013, Gregor Best wrote:

 Of course. The attached version of the patch fixes that. I have also
 attached another patch that sets the default mwfact for new tags to
 ~0.618, which is the inverse of the golden ratio. IMHO this yields a
 more pleasant split between master and slave windows. It's purely
 cosmetic though.

Merged.

Of course if users start complaining about this change, I'll point at
you. ;-)

On Thu, May 23 2013, Gregor Best wrote:

 ... and because I'm on a run, yet another patch. It enables users to use
 -1 as an alias to all screens when running a UICB. Also, it replaces a
 usage of atoi with strtol and strtok with strsep, which are similar
 functions that allow more fine grained error detection and (with strsep)
 are implemented cleaner in most libc implementations.

Man, UICB, I forgot about those. Now I feel like 2007 again.

Pushed.

-- 
Julien Danjou
# Free Software hacker # freelance consultant
# http://julien.danjou.info


signature.asc
Description: PGP signature


Re: Patches for the 2.3 branch

2013-05-22 Thread Julien Danjou
On Tue, May 21 2013, Gregor Best wrote:

 As threatened on IRC, here's a bunch of patches to 2.3. I didn't yet get
 around to adding a systray widget, but that will come.

 Most of the patches are fairly self explanatory, I guess, but as
 always, suggestions and questions are welcome :)

Pushed, except:

 Subject: [PATCH 5/6] Replace obsolete XKeycodeToKeysym

I wonder if you shouldn't change configure.ac, since I don't think we
used to depend on Xkb.

-- 
Julien Danjou
/* Free Software hacker * freelance consultant
   http://julien.danjou.info */


signature.asc
Description: PGP signature