Commit graph

536 commits

Author SHA1 Message Date
Reginald Kennedy
844720651c Increase buffer size used when bar_action_expand is enabled.
Fix some style (9) styling.
2020-05-24 19:38:44 +08:00
Reginald Kennedy
dd7b85eaa2 Add new restart_of_day action.
Same as restart but configuration file is loaded in full.
Unbound by default.

Closes #172
2020-02-21 10:30:28 -06:00
Reginald Kennedy
50ff69768e Fix border color issue when clicking to focus a window on an unfocused region. 2020-02-21 16:09:13 +08:00
Reginald Kennedy
56a1c842cb Fix clientmessage: _NET_ACTIVE_WINDOW.
Window should be activated (uniconified and focused) even when on an
unmapped workspace.

Fixes #242
2020-02-21 16:09:13 +08:00
Reginald Kennedy
a485f9a628 Fix focus issue when moving transient and related windows between workspaces.
Fixes #283
2020-02-21 16:09:13 +08:00
Björn Ketelaars
2657c691df Fix width calculation of a Xft glyph
XftTextExtentsUtf8 computes the pixel extents and stores them in a
XGlyphInfo data type. The true "width" of a Xft glyph is found in the
xOff member of the latter structure.

This fixes the (dis)appearing space when switching workspace (#264).
2020-02-02 22:37:12 +08:00
Reginald Kennedy
3d694d8354 Fix pr#256 pledge() too early.
expand_tilde() may be called multiple times.
2019-12-19 19:59:13 +08:00
Marco Peereboom
21266623b1 Fix copyright 2019-12-17 15:45:18 -06:00
Reginald Kennedy
6352cdbc3e Cleanup unneeded get_screen() calls. 2019-11-29 17:53:35 +08:00
Björn Ketelaars
7c5196d990 Address warnings found by static code code analysis
Warnings:
- unread variables
- shadowed declarations
- clarify calculations
- possible null pointer dereferences
2019-11-29 15:55:03 +08:00
Reginald Kennedy
71e41a8cd9 Fix cygwin compile issues. 2019-10-18 08:10:20 +08:00
Björn Ketelaars
64bee8acfc Reduce number of pledge(2) promises (OpenBSD only)
Restrict spectrwm even further following work from matthieu@ on font
caches: https://undeadly.org/cgi?action=article;sid=20180717074543
2019-09-24 07:30:53 -05:00
Björn Ketelaars
4aba2b2b6e Silence (Clang) static analyzer warnings.
line 1785 - Wrong type
line 2486 - Division by zero
line 2575 - Uninitialized argument value
line 2583 - Uninitialized argument value
line 2595 - Uninitialized argument value
line 2597 - Uninitialized argument value
line 3468 - Wrong type
line 3730 - Dereference of null pointer
line 6065 - Result of operation is garbage or undefined
line 9374 - Wrong type
line 12446 - Possible null pointer dereference
2019-08-13 19:38:58 +01:00
Charlie Root
44bd4da463 Fix buffer overflow in bar_strlcat_esc 2019-08-14 01:46:29 +08:00
Reginald Kennedy
a30bbbbdd6 Add support for XDG Base Directory Specification.
New conf search order:
1) $XDG_CONFIG_HOME/spectrwm/spectrwm.conf
2) ~/.config/spectrwm/spectrwm.conf
   (if $XDG_CONFIG_HOME is either not set or empty)
3) ~/.spectrwm.conf
4) $XDG_CONFIG_DIRS/spectrwm/spectrwm.conf
   (each colon-separated directory in $XDG_CONFIG_DIRS)
5) /etc/xdg/spectrwm/spectrwm.conf
   (if $XDG_CONFIG_DIRS is either not set or empty)
6) /etc/spectrwm.conf
2019-08-05 09:01:06 +01:00
cmanv
bdca10de91 Multi-section status bar, unicode icons, font and color text markup 2019-07-31 08:38:12 +01:00
Björn Ketelaars
ff1909e7f4 pledge() earlier 2019-07-25 18:04:32 +01:00
Reginald Kennedy
d720496250 Fix bar_format '++' should output as a literal '+'. 2019-07-05 14:43:57 +08:00
David Hill
a0c595fde4 Enable xinput2 on OpenBSD 2019-05-22 11:35:14 +08:00
Reginald Kennedy
e2c42a9de9 Tweak get_binding_keycode() fix.
Bail the loop if the unsigned counter gets reduced modulo to 0.
2019-01-21 11:35:35 +08:00
Sebastian Schwarz
84c356dfe6 Fix infinite loop due to unsigned integer overflow.
In get_binding_keycode() a uint8_t loop variable was incremented in a
for loop.  The variable would overflow right before the loop's
condition was met.  Therefore the loop would never terminate.

To avoid the infinite loop the condition has to be checked before the
increment operation and not afterwards.
2019-01-13 22:21:50 +01:00
Reginald Kennedy
c1479cfd78 Fix binding keysyms should be bound according to keyboard layout order.
xcb_key_symbols_get_keycode() returns a list of keycodes that is ordered
by keycode value instead of keyboard layout order.  If a keysym resolves
to multiple keycodes, the first keycode in the returned array may be from
the wrong layout.

For example, if the current keymap has two layouts: 'us, us(dvorak)', 'p'
will resolve to keycode 27 of the secondary 'dvorak' layout instead of
keycode 33 of the primary 'us' layout.

Instead of using xcb_key_symbols_get_keycode() to resolve keysyms to
keycodes, search each keysym column in the key map until there is a hit.
2019-01-11 04:15:29 +08:00
Björn Ketelaars
8801799618 Extend disable_border option with always.
Setting `disable_border = always` removes border from lone tiled
windows, regardless of the bar being enabled/disabled. This is an
addition to an existing feature, and does not change existing behaviour.
2019-01-11 03:39:34 +08:00
Reginald Kennedy
4c589aeb7d Silence clang static analyzer warnings. 2019-01-10 19:03:30 +08:00
David Hill
fa700434ef Update to latest pledge(2).
From bket@openbsd
2019-01-08 15:53:12 -06:00
Jaap Boender
6326e0c4cb Changes to build with NetBSD (#231) 2019-01-07 16:36:57 +00:00
bket
8fd58c53b3 Silence warning reported by the clang static analyzer. (#234) 2019-01-07 16:34:06 +00:00
William Orr
d619f904b9 Add initial pledge(2) support on OpenBSD (#217)
On other platforms, this will be a no-op. Fixes #164.
2019-01-07 15:25:43 +00:00
Björn Ketelaars
30f82ac5ea Remove unused function.
find_frame_window() has been introduced as part of commit da92f07e, and
has never been used.
2018-12-04 21:21:41 +08:00
Reginald Kennedy
f9bf40a23f Disable xinput2 for all but Linux and FreeBSD. 2018-09-08 01:07:31 +08:00
Reginald Kennedy
6331a294b3 Add new configurable status bar workspace list indicator.
Enable by adding +L to bar_format.

Add new bar_format character sequence: +L

Add new conf option: workspace_indicator

Closes #113 and closes #170
2018-09-07 22:49:22 +08:00
Reginald Kennedy
d781d4e881 Add new actions to directly switch layout:
layout_vertical
	layout_horizontal
	layout_max
Unbound by default.

Add "max" alias for "fullscreen" layout option and adjust man page.

Closes #210
2018-09-07 21:40:47 +08:00
Reginald Kennedy
712efd1c36 Add new ws_empty_move action.
Switches to the first empty workspace and moves the current window.
Unbound by default.
2018-09-07 12:29:37 +08:00
Reginald Kennedy
f9c4156217 Fix warp pointer issue when Coordinate Transformation Matrix is used.
Requires libxcb >= 1.9 and xinput2.

Fix screenchange should only be called if RandR is supported.

Fixes #208
2018-09-07 12:29:37 +08:00
Reginald Kennedy
9d64ae3a7c Fix bar focus color on screenchange.
Fixes #131
2018-09-07 12:29:37 +08:00
Reginald Kennedy
49297ff971 Use maximum screen depth when creating frame/bar windows.
Add refresh rate checks to appropriately limit move/resize update rate.

Change all times in debug output to hexadecimal.
2018-09-07 12:29:27 +08:00
Reginald Kennedy
1ed5783be7 Fix some styling. 2018-09-07 11:16:49 +08:00
Matthias von Faber
1291a720e1 Fix config file parsing on musl libc
On the musl libc, autorun, layout and workspace name settings were
always rejected as invalid. As it turns out, parsing those was relying
on sscanf incorrectly matching %Nc as long as there is at least one
character. This is fixed by matching only the initial part of the string
via sscanf and skipping ahead by the amount of bytes consumed. This also
avoids unnecessary zeroing, copying and possible implicit truncation.

Relevant glibc bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=12701
2018-03-28 18:31:43 +08:00
Reginald Kennedy
5804b95a71 Fix pointer offset calculation on move action. 2018-03-21 15:46:08 +08:00
Reginald Kennedy
82e40ed7a7 Fix windows in stacking area sometimes being hidden.
fixes #196
2018-03-03 16:12:48 +08:00
Reginald Kennedy
308f61d58d Cleanup and improve debug output by utilizing C99 __func__. 2018-02-20 22:52:22 +08:00
Christoph Weiss
cd44d668d6 fix segmentation fault in font creation 2017-12-27 22:41:01 +08:00
Tobias Stoeckmann
ea3e6da622 Fix OOB while reading bar input.
If the status bar script returns NUL as the first character through
stdin, spectrwm is prone to an out of boundary access. Depending on
the memory layout of the machine, it could turn into an OOB write.

The fix is simple: If the string is empty, do not further check for
newline character.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2017-10-14 16:39:44 +08:00
Reginald Kennedy
6b80d23815 Change bar_format +R region index to start at 1 for consistency. 2017-10-04 00:09:46 +08:00
Mike Meyer
79d583b791 Add +R for region index to bar formatting. 2017-10-03 23:52:42 +08:00
Reginald Kennedy
22167bcf2f Add new bar_color_selected and bar_font_color_selected options.
Allows for the convenient customization of dmenu selection colors.
Defaults to bar_border and bar_color, respectively.

closes #168
2017-10-03 21:36:33 +08:00
Reginald Kennedy
82efe69576 Add new 'ws_empty' action.
Switches to the first empty workspace.
Unbound by default.
2017-10-03 20:30:26 +08:00
Reginald Kennedy
ddf4d6609a Pacify Clang Static Analyzer false-positives.
Fix memory leak when parsing an invalid button bind.

Cleanup tree/queue init.
2017-10-03 16:22:46 +08:00
Reginald Kennedy
0a56e7740e Fix handling of invalid character sequences in bar_format.
fixes #35
2017-10-03 16:21:55 +08:00
K M Masum Habib
0b3636551c Enable padding in the bar_format using '_' character 2017-09-28 23:35:54 +08:00