mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 02:01:42 -05:00
Add --activate
to window
This commit is contained in:
parent
ba973e8fdf
commit
22e0f6ce5b
7 changed files with 32 additions and 12 deletions
|
@ -2,12 +2,12 @@
|
|||
.\" Title: bspwm
|
||||
.\" Author: [see the "Author" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
||||
.\" Date: 11/05/2015
|
||||
.\" Date: 11/07/2015
|
||||
.\" Manual: Bspwm Manual
|
||||
.\" Source: Bspwm 0.9
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "BSPWM" "1" "11/05/2015" "Bspwm 0\&.9" "Bspwm Manual"
|
||||
.TH "BSPWM" "1" "11/07/2015" "Bspwm 0\&.9" "Bspwm Manual"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
|
@ -622,6 +622,11 @@ window [\fIWINDOW_SEL\fR] \fIOPTIONS\fR
|
|||
Focus the selected or given window\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-a\fR, \fB\-\-activate\fR [\fIWINDOW_SEL\fR]
|
||||
.RS 4
|
||||
Activate the selected or given window\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-d\fR, \fB\-\-to\-desktop\fR \fIDESKTOP_SEL\fR
|
||||
.RS 4
|
||||
Send the selected window to the given desktop\&.
|
||||
|
|
|
@ -408,6 +408,9 @@ Options
|
|||
*-f*, *--focus* ['WINDOW_SEL']::
|
||||
Focus the selected or given window.
|
||||
|
||||
*-a*, *--activate* ['WINDOW_SEL']::
|
||||
Activate the selected or given window.
|
||||
|
||||
*-d*, *--to-desktop* 'DESKTOP_SEL'::
|
||||
Send the selected window to the given desktop.
|
||||
|
||||
|
|
19
messages.c
19
messages.c
|
@ -134,6 +134,17 @@ int cmd_window(char **args, int num)
|
|||
return MSG_FAILURE;
|
||||
}
|
||||
focus_node(dst.monitor, dst.desktop, dst.node);
|
||||
} else if (streq("-a", *args) || streq("--activate", *args)) {
|
||||
coordinates_t dst = trg;
|
||||
if (num > 1 && *(args + 1)[0] != OPT_CHR) {
|
||||
num--, args++;
|
||||
if (!node_from_desc(*args, &trg, &dst))
|
||||
return MSG_FAILURE;
|
||||
}
|
||||
if (dst.desktop == mon->desk) {
|
||||
return MSG_FAILURE;
|
||||
}
|
||||
activate(dst.monitor, dst.desktop, dst.node);
|
||||
} else if (streq("-d", *args) || streq("--to-desktop", *args)) {
|
||||
num--, args++;
|
||||
coordinates_t dst;
|
||||
|
@ -1167,10 +1178,10 @@ bool parse_subscriber_mask(char *s, subscriber_mask_t *mask)
|
|||
*mask = SBSC_MASK_WINDOW_TRANSFER;
|
||||
} else if (streq("window_focus", s)) {
|
||||
*mask = SBSC_MASK_WINDOW_FOCUS;
|
||||
} else if (streq("window_resize", s)) {
|
||||
*mask = SBSC_MASK_WINDOW_RESIZE;
|
||||
} else if (streq("window_move", s)) {
|
||||
*mask = SBSC_MASK_WINDOW_MOVE;
|
||||
} else if (streq("window_activate", s)) {
|
||||
*mask = SBSC_MASK_WINDOW_ACTIVATE;
|
||||
} else if (streq("window_geometry", s)) {
|
||||
*mask = SBSC_MASK_WINDOW_GEOMETRY;
|
||||
} else if (streq("window_state", s)) {
|
||||
*mask = SBSC_MASK_WINDOW_STATE;
|
||||
} else if (streq("window_flag", s)) {
|
||||
|
|
|
@ -44,8 +44,8 @@ typedef enum {
|
|||
SBSC_MASK_WINDOW_SWAP = 1 << 15,
|
||||
SBSC_MASK_WINDOW_TRANSFER = 1 << 16,
|
||||
SBSC_MASK_WINDOW_FOCUS = 1 << 17,
|
||||
SBSC_MASK_WINDOW_RESIZE = 1 << 18,
|
||||
SBSC_MASK_WINDOW_MOVE = 1 << 19,
|
||||
SBSC_MASK_WINDOW_ACTIVATE = 1 << 18,
|
||||
SBSC_MASK_WINDOW_GEOMETRY = 1 << 19,
|
||||
SBSC_MASK_WINDOW_STATE = 1 << 20,
|
||||
SBSC_MASK_WINDOW_FLAG = 1 << 21,
|
||||
SBSC_MASK_WINDOW_LAYER = 1 << 22,
|
||||
|
|
5
tree.c
5
tree.c
|
@ -294,7 +294,7 @@ void insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
|
|||
put_status(SBSC_MASK_REPORT);
|
||||
}
|
||||
|
||||
void pseudo_focus(monitor_t *m, desktop_t *d, node_t *n)
|
||||
void activate(monitor_t *m, desktop_t *d, node_t *n)
|
||||
{
|
||||
if (n != NULL) {
|
||||
if (d->focus != NULL && n != d->focus && stack_cmp(n->client, d->focus->client) < 0) {
|
||||
|
@ -307,6 +307,7 @@ void pseudo_focus(monitor_t *m, desktop_t *d, node_t *n)
|
|||
}
|
||||
}
|
||||
d->focus = n;
|
||||
put_status(SBSC_MASK_WINDOW_ACTIVATE, "window_activate 0x%X\n", n->client->window);
|
||||
}
|
||||
|
||||
void focus_node(monitor_t *m, desktop_t *d, node_t *n)
|
||||
|
@ -1104,7 +1105,7 @@ bool transfer_node(monitor_t *ms, desktop_t *ds, node_t *ns, monitor_t *md, desk
|
|||
if (focused) {
|
||||
focus_node(md, dd, ns);
|
||||
} else if (active) {
|
||||
pseudo_focus(md, dd, ns);
|
||||
activate(md, dd, ns);
|
||||
}
|
||||
} else {
|
||||
if (focused) {
|
||||
|
|
2
tree.h
2
tree.h
|
@ -28,7 +28,7 @@
|
|||
void arrange(monitor_t *m, desktop_t *d);
|
||||
void apply_layout(monitor_t *m, desktop_t *d, node_t *n, xcb_rectangle_t rect, xcb_rectangle_t root_rect);
|
||||
void insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f);
|
||||
void pseudo_focus(monitor_t *m, desktop_t *d, node_t *n);
|
||||
void activate(monitor_t *m, desktop_t *d, node_t *n);
|
||||
void focus_node(monitor_t *m, desktop_t *d, node_t *n);
|
||||
void update_current(void);
|
||||
node_t *make_node(void);
|
||||
|
|
2
window.c
2
window.c
|
@ -171,7 +171,7 @@ void manage_window(xcb_window_t win, rule_consequence_t *csq, int fd)
|
|||
if (give_focus) {
|
||||
focus_node(m, d, n);
|
||||
} else if (csq->focus) {
|
||||
pseudo_focus(m, d, n);
|
||||
activate(m, d, n);
|
||||
} else {
|
||||
stack(n, false);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue