From eaba8c67152fcf149011c61c5e6b477b703ca159 Mon Sep 17 00:00:00 2001 From: Bastien Dejean Date: Sat, 29 Sep 2012 17:32:22 +0200 Subject: [PATCH] Revert previous commit --- README.md | 4 ++-- events.c | 16 ++++++---------- messages.c | 2 -- rules.c | 6 +----- rules.h | 2 +- types.c | 1 - types.h | 1 - 7 files changed, 10 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 652c319..4a6225e 100644 --- a/README.md +++ b/README.md @@ -155,8 +155,8 @@ The following messages are handled: toggle_locked Toggle the locked state of the current window (locked windows will not respond to the 'close' command). - rule PATTERN [DESKTOP_NAME] [floating] - Make a new rule that will apply the given states to the windows whose class name or instance name equals PATTERN (switch to the given desktop). + rule PATTERN floating + Make a new rule that will float the windows whose class name or instance name equals PATTERN. reload_autostart Reload the autostart file. diff --git a/events.c b/events.c index 3a31912..b05bec7 100644 --- a/events.c +++ b/events.c @@ -70,12 +70,8 @@ void map_request(xcb_generic_event_t *evt) update_floating_rectangle(c); bool floating = false, transient = false, fullscreen = false, takes_focus = true; - desktop_t *send_to = desk; - handle_rules(win, &floating, &transient, &fullscreen, &takes_focus, &send_to); - - if (send_to != desk) - select_desktop(send_to); + handle_rules(win, &floating, &transient, &fullscreen, &takes_focus); xcb_icccm_get_wm_class_reply_t reply; if (xcb_icccm_get_wm_class_reply(dpy, xcb_icccm_get_wm_class(dpy, win), &reply, NULL) == 1) { @@ -92,13 +88,13 @@ void map_request(xcb_generic_event_t *evt) if (floating) split_mode = MODE_MANUAL; - insert_node(send_to, birth); + insert_node(desk, birth); if (floating) toggle_floating(birth); - if (send_to->focus != NULL && send_to->focus->client->fullscreen) - toggle_fullscreen(send_to->focus->client); + if (desk->focus != NULL && desk->focus->client->fullscreen) + toggle_fullscreen(desk->focus->client); if (fullscreen) toggle_fullscreen(birth->client); @@ -106,9 +102,9 @@ void map_request(xcb_generic_event_t *evt) c->transient = transient; if (takes_focus) - focus_node(send_to, birth, false); + focus_node(desk, birth, false); - apply_layout(send_to, send_to->root, root_rect); + apply_layout(desk, desk->root, root_rect); window_show(c->window); diff --git a/messages.c b/messages.c index 6b8e069..e39ff52 100644 --- a/messages.c +++ b/messages.c @@ -168,8 +168,6 @@ void process_message(char *msg, char *rsp) while (arg != NULL) { if (strcmp(arg, "floating") == 0) rule->effect.floating = true; - else - rule->effect.send_to = find_desktop(arg); arg = strtok(NULL, TOKEN_SEP); } rule->next = rule_head; diff --git a/rules.c b/rules.c index cb41354..0f8c234 100644 --- a/rules.c +++ b/rules.c @@ -19,7 +19,7 @@ bool is_match(rule_t *r, xcb_window_t win) return false; } -void handle_rules(xcb_window_t win, bool *floating, bool *transient, bool *fullscreen, bool *takes_focus, desktop_t **send_to) +void handle_rules(xcb_window_t win, bool *floating, bool *transient, bool *fullscreen, bool *takes_focus) { xcb_ewmh_get_atoms_reply_t win_type; @@ -60,10 +60,6 @@ void handle_rules(xcb_window_t win, bool *floating, bool *transient, bool *fulls if (is_match(rule, win)) { if (rule->effect.floating) *floating = true; - if (rule->effect.send_to != NULL) { - *send_to = rule->effect.send_to; - rule->effect.send_to = NULL; /* serve only once */ - } } rule = rule->next; } diff --git a/rules.h b/rules.h index 93ac564..da10236 100644 --- a/rules.h +++ b/rules.h @@ -2,6 +2,6 @@ #define _RULES_H bool is_match(rule_t *, xcb_window_t); -void handle_rules(xcb_window_t, bool *, bool *, bool *, bool *, desktop_t **); +void handle_rules(xcb_window_t, bool *, bool *, bool *, bool *); #endif diff --git a/types.c b/types.c index 2aa03dc..ee30702 100644 --- a/types.c +++ b/types.c @@ -40,7 +40,6 @@ rule_t *make_rule(void) { rule_t *r = malloc(sizeof(rule_t)); r->effect.floating = false; - r->effect.send_to = NULL; r->next = NULL; return r; } diff --git a/types.h b/types.h index fc13a46..7b91657 100644 --- a/types.h +++ b/types.h @@ -110,7 +110,6 @@ typedef struct { typedef struct { bool floating; - desktop_t *send_to; } rule_effect_t; typedef struct rule_t rule_t;