Without padding between windows, it can be hard to distinguish which
window a border belongs to.
This commit adds some padding around windows to avoid this problem.
It's possible to deactivate Pango markup and/or move the bar from the
top to the bottom. Both are features that aren't necessary, so this
commit removes them.
Tags are a nice idea, but they were clearly not designed for environments
with multiple monitors. For example, in an environment with three screens,
moving a window from one screen to another can require as many as 7 key-
strokes (assuming neither the source nor the destination tag are selected).
To make the grouping of windows more intuitive, this commit introduces
workspaces. In simple terms, a workspace is a screenful of windows (or
monitorful of clients, in X parlance). There are 12 workspaces in the
default configuration. Unlike tags, there is only one set of workspaces,
and all monitors can display the same workspaces. Meaning if I have a set
of windows that I want to display on a different monitor, I can point that
monitor to the workspace and it will display the windows without the need
to move around windows.
Better yet, because layouts are still set on a per-monitor basis, it is
possible to use different monitors to view the same windows in a different
layout. However, note that two monitors cannot display the same workspace
at the same time, since that would mean that a window has two different
sizes and positions at the same time. Pointing a monitor to a workspace
that is being displayed on another monitor will make the monitors swap
workspaces instead.
The problems that occured in the past, when the pointer and focus were
set to follow eachother, were not caused by either of the two, but an
issue in the focusing code of dwm.
Since that problem has since been fixed, this commit re-introduces the
pointer-following focus.
Matthias Kruk [Sun, 28 Mar 2021 21:47:22 +0000 (06:47 +0900)]
Update status bar on all monitors
The status bar is not updated on all monitors when certain events occur.
This is particularly problematic if information is displayed that changes
frequently, and different screens show different information.
This commit modifies dwm so that the status bar on all monitors is redrawn
when its content changes.
Matthias Kruk [Sun, 28 Mar 2021 06:24:28 +0000 (15:24 +0900)]
Move the pointer to the correct window when changing focus
Changing the focus via the keyboard moves the pointer to the wrong window
because selmon->sel isn't changed where I expected it to be changed.
This commit addresses the issue by moving the pointer to the client passed
to the setfocus() function instead of using the client in selmon->sel.
Matthias Kruk [Fri, 19 Mar 2021 07:28:33 +0000 (16:28 +0900)]
Add experimental keyboard pointer
The pointer is typically very awkward to use, especially on devices with mice or
similar input devices. This commit adds an experimental keyboard pointer, which
allows the user to move the pointer and perform clicks through the keyboard.
The keyboard pointer follows this basic idea: The user can move the pointer in
four directions: North, East, South, West. The pointer has a horizontal stride
and a vertical stride (the size of a step in horizontal or vertical direction,
respectively). With each step, the respective stride is reduced by half.
The origin of the pointer is the center of the focused window, and the initial
horizontal and vertical stride are a quarter of the window's width and height,
respectively.
For example in a 100x100px window (the point (0, 0) being the top left corner),
the pointer's origin is (50, 50). If the pointer makes one step north, it will
be at (50, 25). Moving another step north will put the pointer at (50, 12.5).
The user can also hold the shift key while moving, which will cause the stride
to be reduced once before the movement and once after the movement (this seemed
useful for targets that are close to the origin).
This pointer behavior has two implications:
1. If the stride reaches zero, the pointer can't be moved anymore
2. The pointer can never leave the window (it asymptotically approaches the
outermost pixel, strictly speaking)
Re-centering the pointer also replenishes the stride. If a user misses their
target, they have to start over from the center of the window. If a user wants
to point at another window, they have to move the focus to that window first.
I'm not sure if this kind of pointer behavior is more or less annoying than
using a traditional pointing device. That's why this feature is experimental.
Matthias Kruk [Tue, 16 Mar 2021 08:39:40 +0000 (17:39 +0900)]
Remove systray
The systray is shown on only one screen, but the current implementation
cannot be easily adapted to show the systray on all screens. But since
the systray turns out not to be very important anyways, this commit
removes it altogether.
Matthias Kruk [Sat, 13 Mar 2021 05:35:23 +0000 (14:35 +0900)]
Split long lines
There are several lines in the source code that do not fit on a reasonably
sized screen. This commit breaks up all long lines so they fit within 95
columns.
Matthias Kruk [Sat, 13 Mar 2021 04:56:40 +0000 (13:56 +0900)]
Give more meaningful names to global two-letter variables
Without context, it's not obvious what sw or bl are supposed to mean.
This commit renames these variables so the meaning can be gleaned from
their names.
Matthias Kruk [Sat, 13 Mar 2021 04:24:59 +0000 (13:24 +0900)]
Remove code to toggle systray and bar visibility
There are functions to hide/unhide the bar and the systray, however
they are not bound to any keys and I do not need them. This commit
removes these functions and all related variables/fields.
Matthias Kruk [Fri, 12 Mar 2021 23:02:59 +0000 (08:02 +0900)]
Use kernel-style indentation
This changes the code to use kernel-style indentation. This makes the
source longer, but also improves readability, especially with regards
to nesting.
Matthias Kruk [Sun, 28 Feb 2021 22:17:46 +0000 (07:17 +0900)]
Stop the focus from following the pointer
The focus-following-the-pointer code and the pointer-following-the-focus
code sometimes negatively interact, causing dwm to keep cycling through
the clients of a tag. The behavior is not obviously reproduceable and
appears to be a bug in a different part of dwm. For the time being,
stop the focus from following the pointer.
Matthias Kruk [Sun, 28 Feb 2021 06:04:46 +0000 (15:04 +0900)]
Make the pointer follow the focus
When the pointer moves to a different client, the focus follows the
pointer, putting the client under the pointer in focus. However, when
the focus is changed using the keyboard, the pointer remains over the
client that is now out-of-focus. If using multiple screens, or if a
client decides to hide the pointer because it is over a text input,
this can make it very annoying to figure out the pointer location.
This commit makes sure that the pointer follows the focus when it
moves to a different client.
Matthias Kruk [Thu, 24 Dec 2020 13:19:34 +0000 (22:19 +0900)]
Draw the status bar on all screens
The status bar contains the clock and other information that should
be displayed on all screens. This commit makes sure it is drawn on
all screens, not just the selected one.
Matthias Kruk [Thu, 24 Dec 2020 00:08:43 +0000 (09:08 +0900)]
Don't draw window titles in the status bar
Certain UTF-8 glyphs cause issues with underlying libraries, causing
dwm to crash. Websites such as Twitter will frequently include such
glyphs in their title, causing dwm to try to render them in the status
bar. This commit keeps dwm from displaying window titles in the status
bar.
Matthias Kruk [Wed, 5 Aug 2020 06:56:08 +0000 (15:56 +0900)]
bookshelf, bookstack: Make sure applysizehints() does not mess with client dimensions, increase size of first window if the screen size can't be divided evenly