Commit graph

1462 commits

Author SHA1 Message Date
Bastien Dejean
51983994fa Fix comment 2020-11-02 10:23:50 +01:00
Bastien Dejean
01107f974b Discard colons within references
Fixes #1218.
2020-11-01 21:07:47 +01:00
Bastien Dejean
ddb2d32788 Revert "Only handle stdout closure for subscribers"
This reverts commit 7aca1b6c4e.

Fixes #1212.
2020-10-23 21:25:27 +02:00
Bastien Dejean
7aca1b6c4e Only handle stdout closure for subscribers
Thanks to @ortango for the patch.

Fixes #1207.
2020-10-19 10:06:41 +02:00
Bastien Dejean
e13255e249 Handle standard output closure last
Fixes #1207.
2020-10-12 15:40:57 +02:00
Emanuele Torre
853bb73452 Add {,user}_LAYOUT modifiers to desktop selectors
`.tiled`, `.monocle`, `.user_tiled` and `.user_monocle` can now be used
in desktop selectors.
2020-09-08 11:12:15 +02:00
Emanuele Torre
09d86ca86c Fix asciidoc syntax in the manual
The last asterisk of this line should not be escaped since it is not
paired with another asterisk.

The backslash was being rendered in the man page.
2020-09-08 11:07:24 +02:00
Emanuele Torre
2571bddf67 Fix bspc rule -r <^n> completion for zsh
Indexes were offsetted by one and started from 0.
0 is not a valid index.

Fixes #1193.
2020-09-08 11:02:35 +02:00
Bastien Dejean
8e6f769d6f Initialize the destination location early
Fixes #1196.
Closes #1197.
2020-09-08 10:58:12 +02:00
Bastien Dejean
760b148a5f Update EWMH's current desktop in add_desktop
Fixes #1179.
2020-08-19 16:25:22 +02:00
Bastien Dejean
446ff985e1 Honor pointer_follows_focus when swapping nodes
Closes #1170.
2020-08-14 12:15:21 +02:00
Bastien Dejean
3f12328f26 Don't set a wrong border color when *_held_focus 2020-08-14 12:06:15 +02:00
Bastien Dejean
5298a91211 Arrange across all desktops when handling struts
Fixes #1165.
2020-08-03 14:06:57 +02:00
Bastien Dejean
d4dee3962f Set the input focus before unmapping windows
Fixes #811.
2020-08-03 13:37:54 +02:00
Bastien Dejean
2492695ad4 Version 0.9.10 2020-08-02 09:51:32 +02:00
Bastien Dejean
4abca9b41f Properly document the split type modifiers 2020-08-02 09:47:59 +02:00
Bastien Dejean
a9a2d00b26 Mention bspwmrc's argument in the right document 2020-08-01 20:23:02 +02:00
Bastien Dejean
1c795c3351 Resolve the rule consequence when scheduling rules
Fixes #1163.
2020-07-31 20:38:32 +02:00
Bastien Dejean
5d93323f30 Resolve the rule consequences passed to the erc 2020-07-31 10:42:28 +02:00
Emanuele Torre
7313b01fcc Don't store the split direction's csq as a string 2020-07-31 09:56:18 +02:00
Bastien Dejean
7d5f0a6acc Revert "Escape shell chars in the erc arguments"
This reverts commit 7a7b17ba28.
2020-07-31 09:45:59 +02:00
Bastien Dejean
7a7b17ba28 Escape shell characters in the erc arguments
Since `eval "$4"` is frequently used within the external rules command,
we want to avoid the possibility of unwanted code execution.

Fixes #1162.
Closes #1161.
2020-07-30 10:38:45 +02:00
Bastien Dejean
9ef79d76d4 Remove redundant tests 2020-07-28 18:28:44 +02:00
Bastien Dejean
d87e6c0f77 Generalize a few node descriptors
- `next` and `prev` might now return any node in the context of a
  depth-first in-order tree traversal.
- `biggest`, `smallest` and `pointed` now return leaves instead of
  windows. In particular, `pointed` can now be used to get the id of a
  pointed receptacle.

Fixes #1113.
2020-07-28 11:14:28 +02:00
Bastien Dejean
a54ab707cf Pass a *run level* argument to bspwmrc
Fixes #1158.
2020-07-27 18:36:08 +02:00
SeerLite
8f41d7989f Make the example bspwmrcs restart friendly 2020-07-27 11:36:41 +02:00
Bastien Dejean
d4804cd741 Catch descriptor-free incompatibilities in queries 2020-07-26 21:37:18 +02:00
Bastien Dejean
be4177b88d Honor all the descriptor-free constraints
Fixes #1094.
2020-07-26 21:19:37 +02:00
Bastien Dejean
c6d4e6e570 Revert "Transfer sticky nodes in move_client"
This is unnecessary since we're transferring to the active desktop of
the destination monitor.

So #1098 should in fact be fixed by 5df311b12c.
2020-07-26 20:42:21 +02:00
Bastien Dejean
6d6ac15217 Honor hidden nodes in set_{floating,fullscreen}
Fixes #1110.
2020-07-26 20:28:03 +02:00
Bastien Dejean
feeafe8ccb Reset some of the reference fields in query -{M,D}
Fixes #1111.
2020-07-26 19:28:43 +02:00
Bastien Dejean
c366c2c39a Transfer sticky nodes in move_client
Fixes #1098.
2020-07-26 18:18:31 +02:00
Bastien Dejean
5df311b12c Update the monitor's sticky count on unlink/insert 2020-07-26 17:57:20 +02:00
Bastien Dejean
c59491c19e Don't try to find the ancestors of NULL
Fixes #1089.
2020-07-26 15:34:37 +02:00
Emanuele Torre
dc303be2cc Escape single asterisks 2020-07-26 14:47:49 +02:00
Emanuele Torre
6c39ab0823 Port BSPWM to gcc10
GCC10 enables -fno-common by default.
This patch allows building BSPWM with -fno-common enabled.

Fixes #1119.
2020-07-26 14:36:52 +02:00
Emanuele Torre
eca4fbeb76 Move get_color_pixel() from helpers.h to bspwm.h 2020-07-26 14:36:52 +02:00
Emanuele Torre
8e0de51414 Fix a few typos 2020-07-26 14:20:17 +02:00
Jason Nader
440ab2b3b4 Amend typo in manpage 2020-07-26 14:10:47 +02:00
Justinien Bouron
3db5a66f19 Remove dead subscribers early
Fix bug in which "dead" subscribers would not be removed right away and would
consume resources *and* file descriptors which could lead to the bspwm process
running out of available file descriptors and not being able to accept new
incoming connections.

When a process subscribes to bspwm events (i.e. `bspc subscribe <event>`), bspwm
keeps some state about this subscriber such as the file descriptor in which to
write the events and which events are requested by the subscriber.

When a subscriber dies (i.e. the `bspc subscribe ...` process is killed) bspwm
does not know it right away. Instead, on the next event being logged, if bspwm
encounters an error when trying to write() into the file descriptor associated
to a subscriber bspwm will consider this subscriber dead and remove it from the
linked list (which will also close() the file descriptor of the subscriber).
This is done in the put_status() function defined in subscribe.c.

This means that bspwm keeps file descriptors on potentially closed streams for
some time.
Normally this is ok, because events are generated often (when focusing nodes,
switching desktop, etc ...), therefore those "dead" file descriptors are not
kept around for too long.
However, during a period of inactivity (i.e. the user is not actively using the
computer or never switching nodes or desktops) those file descriptors can be
kept for a long time.
This is especially problematic in the following scenario:
    1. User leaves the machine idle.
    2. A "churn" of subscribers happens, where subscribers come and go.
    3. Since the machine is idle, no events are happening and the file
       descriptor of all dead subscribers are not closed.
    4. bspwm consumes more and more file descriptors as new subscribers are
       created.
    5. At some point bspwm has too many opened file descriptors and cannot
       accepts new incoming connections. The accept() syscall in the mainloop
       fails (returning EMFILE) and bspwm is stuck in an infinite loop, not
       being able to serve new request. At this point bspwm needs to be killed
       and restarted.

While this could be deemed as unlikely (the maximum number of opened files being
1024 AFAIK (Arch Linux)), it turns out that this exact scenario can happen with
polybar (https://github.com/polybar/polybar) and the bspwm module. When a
laptop connected to an external monitor becomes idle, and the screen saver kicks
in, polybar periodically reloads itself (because of xrandr events) and therefore
periodically kill and re-create a subscriber. Since there is no activity on the
bspwm process, all dead instances of the polybar subscriber are not removed and
bspwm eventually runs out of file descriptors and gets stuck in the infinite
loop while consuming 100% cpu.
(Note: This is not a polybar issue, polybar does the right thing here).

The fix is as follows: In the main loop of bspwm, check for any dead subscribers
and remove them (if any). This is accomplished by a new function declared in
subscribe.h: prune_dead_subscribers().
prune_dead_subscribers() will iterate through the linked list of subscribers and
for each of them will try to call write() on their file descriptor with an empty
buffer (i.e. size == 0). If the write() fails (returns -1) then the subscriber
is declared dead and this function can remove it from the list and close the
associated file descriptor.
2020-07-26 12:37:26 +02:00
Matt Vollrath
a658f4ffae Fix inconsistent WM_CLASS field truncation
Fixes #1117
2020-07-26 12:26:19 +02:00
Matt Vollrath
6db8831e30 Add WM_NAME rule matching 2020-07-26 12:20:16 +02:00
Matt Vollrath
273e5097b1 Fix parsing hidden field
hidden was always set true if present, use the parsed value instead.
2020-05-15 00:54:43 -04:00
tobias
cf2d40772e Add node modifiers: horizontal, vertical 2020-03-16 12:19:24 +01:00
tobias
331902cc05 Add node descriptor: first_ancestor 2020-03-16 12:14:29 +01:00
Bastien Dejean
46ac471e42 Add an example that uses intermediate consequences 2020-02-03 18:41:25 +01:00
Danny Colin
d3a7768356 Add community information 2020-02-02 18:28:53 +01:00
Bastien Dejean
df7c6cc781 Pass --tags to git describe
Fixes #1003.
2019-08-26 17:07:49 +02:00
Bastien Dejean
f0558346b2 Fix GCC warnings 2019-08-19 16:08:08 +02:00
Bastien Dejean
89d3cd8a0e bspc: Write failure messages to standard error
Fixes #999.
2019-08-19 09:42:27 +02:00