From The Compiler, 5 Years ago, written in Diff-output.
Embed
  1. From b304aa338050b10ff21441a99a089b97f60a5752 Mon Sep 17 00:00:00 2001
  2. From: Florian Bruhin <me@the-compiler.org>
  3. Date: Fri, 17 Aug 2012 14:14:19 +0200
  4. Subject: [PATCH] Add a new consequence focustag
  5.  
  6. ---
  7. src/rules.c | 13 ++++++++++++-
  8.  1 file changed, 12 insertions(+), 1 deletion(-)
  9.  
  10. diff --git a/src/rules.c b/src/rules.c
  11. index 640c1da..3d926e9 100644
  12. --- a/src/rules.c
  13. +++ b/src/rules.c
  14. @@ -9,6 +9,7 @@
  15.  #include "ewmh.h"
  16.  #include "clientlist.h"
  17.  #include "ipc-protocol.h"
  18. +#include "monitor.h"
  19.  
  20.  #include <glib.h>
  21.  #include <string.h>
  22. @@ -53,7 +54,8 @@ static void consequence_pseudotile(HSConsequence* cons, HSClient* client,
  23.                                     HSClientChanges* changes);
  24.  static void consequence_fullscreen(HSConsequence* cons, HSClient* client,
  25.                                     HSClientChanges* changes);
  26. -
  27. +static void consequence_focustag(HSConsequence* cons, HSClient* client,
  28. +                                 HSClientChanges* changes);
  29.  /// GLOBALS ///
  30.  
  31.  static HSConditionType g_condition_types[] = {
  32. @@ -76,6 +78,7 @@ static HSConsequenceType g_consequence_types[] = {
  33.      {   "manage",       consequence_manage },
  34.      {   "pseudotile",   consequence_pseudotile },
  35.      {   "fullscreen",   consequence_fullscreen },
  36. +    {   "focustag",     consequence_focustag },
  37.  };
  38.  
  39.  GQueue g_rules = G_QUEUE_INIT; // a list of HSRule* elements
  40. @@ -607,3 +610,11 @@ void consequence_fullscreen(HSConsequence* cons, HSClient* client,
  41.      changes->fullscreen = string_to_bool(cons->value.str, changes->fullscreen);
  42.  }
  43.  
  44. +void consequence_focustag(HSConsequence* cons, HSClient* client,
  45. +                          HSClientChanges* changes) {
  46. +    if (changes->tag_name) {
  47. +        HSMonitor* monitor = get_current_monitor();
  48. +        HSTag* tag = find_tag(changes->tag_name);
  49. +        monitor_set_tag(monitor, tag);
  50. +    }
  51. +}
  52. --
  53. 1.7.11.4
  54.