mirror of
https://github.com/vale981/bspwm
synced 2025-03-05 09:51:38 -05:00
Revert previous commit
This commit is contained in:
parent
b9cb79f55d
commit
eaba8c6715
7 changed files with 10 additions and 22 deletions
|
@ -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.
|
||||
|
|
16
events.c
16
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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
6
rules.c
6
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;
|
||||
}
|
||||
|
|
2
rules.h
2
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
|
||||
|
|
1
types.c
1
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;
|
||||
}
|
||||
|
|
1
types.h
1
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue