Floating windows already had their own border style, but the width was
the same for all windows.
The configuration directives 'new_window' and 'new_float' can now be
used simultaneously to have different border widths for floating and
tiled windows.
Tony Crisci [Mon, 5 May 2014 17:56:47 +0000 (13:56 -0400)]
i3bar: implement custom workspace numbers config
Implement the configuration option within the bar config directive for
custom workspace numbers with the directive `strip_workspace_numbers
yes`.
This directive strips the workspace name of the number prefix and
delimiter. When the workspace name consists only of the number, it will
default to show the number.
For example:
* "2:5" -> "5"
* "4:$" -> "$"
* "8" -> "8"
This allows customization of i3bar for alternate ordering of workspaces
which has a legitimate use for alternate keyboard layouts such as
Dvorak.
Given that the code was exit(0)ing directly after using that memory,
it’s not like this has any effect. However, less false positives on the
clang-analyze report pages is a good thing.
Tony Crisci [Fri, 2 May 2014 20:27:26 +0000 (16:27 -0400)]
Feature: improve active window request handling
Allow client requests of type _NET_ACTIVE_WINDOW to switch workspaces if
they indicate they are a pager. Otherwise, set the urgency hint on that
con to indicate that something happened.
This allows task switchers like skippy-xd to work properly.
Tony Crisci [Fri, 2 May 2014 14:22:40 +0000 (10:22 -0400)]
Refactor binding accessor
Change the primary binding accessor to `get_binding_from_xcb_event`.
This function gets a binding from a generic xcb event of type KeyPress,
KeyRelease, ButtonPress, or ButtonRelease by determining the input type
(keyboard or mouse), the modifiers pressed from the filtered event
`state`, managing the proper fall back in case mode switch is enabled,
and finally querying the bindings for a binding that matches the event.
The logic of querying keyboard bindings is not intended to be altered by
this change.
The general accessor has been slightly modified to work with mouse
bindings and made private because it is only used in bindings.c
Workspaces won't work properly if they start with "__", so reserve that
namespace altogether. Disallow renaming workspaces to reserved namespace
and using reserved namespace in configuration.
Tony Crisci [Mon, 28 Apr 2014 22:38:06 +0000 (18:38 -0400)]
Implement the window::fullscreen_mode event
The fullscreen_mode event is a window with the "change" property set to
"fullscreen_mode". This event should be emitted whenever a window enters
or exits fullscreen mode.
This event can be used to turn off dpms off when a window is fullscreen
or display the fullscreen container name in the status line for
instance.
Tony Crisci [Wed, 30 Apr 2014 01:29:17 +0000 (21:29 -0400)]
Delegate click handling to dock clients
Do not handle click events on dock clients because they are not managed
windows. Dock clients are responsible for sending the message to i3 to
focus a workspace if that is appropriate. i3bar now sends the message to
focus the correct workspace when that is appropriate.
Otherwise, it could interfere with the dock clients own click handling,
which could be an action to focus a different workspace than i3 had
assumed, such as would be the case with a workspace widget.
Tony Crisci [Sun, 27 Apr 2014 05:48:28 +0000 (01:48 -0400)]
Implement bindsym mouse configuration
If a `bindsym` config directive specifies a symbol beginning with
"button", the binding will be given the type B_MOUSE for the indicated
button number.
Example:
bindsym $mod+button2 exec echo 'button two'
This will be interpreted as having input code (now `keycode`) 2 and type
B_MOUSE.
The mechanism to find and run mouse bindings on mouse events is not
implemented.
i3-dmenu-desktop: also quote the %c field code (Thanks bo)
The spec says:
“Implementations must take care not to expand field codes into multiple
arguments unless explicitly instructed by this specification. This means
that name fields, filenames and other replacements that can contain
spaces must be passed as a single argument to the executable program
after expansion.”
Tony Crisci [Fri, 18 Apr 2014 18:14:22 +0000 (14:14 -0400)]
Bugfix: resize window check should check for null
When checking the window type for a resize command, first check to see
if the window property is null before checking whether or not it is a
dock window. The window may be null in the case it is a branch
container.
blocks SIGPIPE. Unfortunatelly blocked signal set is preserved accross
execve()s, so any program executed by i3 inherited blocked SIGPIPE signal.
This leads to courious effects when pipe writer does not terminate after
exiting pipe reader.
Simple reproducer is to spawn a new xterm by a key shortcut and then run this
command there:
Tony Crisci [Thu, 10 Apr 2014 17:28:14 +0000 (13:28 -0400)]
Dont set input focus and send WM_TAKE_FOCUS
If input focus is set by the window manager, it is not necessary to send
WM_TAKE_FOCUS because it has already taken focus.
http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7
> The goal is to support window managers that want to assign the input
> focus to a top-level window in such a way that the top-level window
> either can assign it to one of its subwindows or can decline the offer
> of the focus. For example, a clock or a text editor with no currently
> open frames might not want to take focus even though the window
> manager generally believes that clients should take the input focus
> after being deiconified or raised.
Both setting input focus and sending WM_TAKE_FOCUS is effectively
setting focus on the window twice which is certainly against the spirit
of the spec, if not the letter.
Otherwise, we read random garbage. Found by the testsuite due to
t/185-scratchpad.t failing because a window was incorrectly recognized
as a floating window.
Tony Crisci [Sat, 29 Mar 2014 04:25:52 +0000 (00:25 -0400)]
Send last event timestamp with WM_TAKE_FOCUS msg
According to 4.1.7 of the iccm spec
http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7
> Windows with the atom WM_TAKE_FOCUS in their WM_PROTOCOLS property may
> receive a ClientMessage event from the window manager (as described in
> section 4.2.8) with WM_TAKE_FOCUS in its data[0] field and a valid
> timestamp (i.e. not CurrentTime ) in its data[1] field.
Adds the timestamp parameter to send_take_focus to avoid the dangerous
use of a global variable.
Tony Crisci [Wed, 19 Mar 2014 08:56:34 +0000 (04:56 -0400)]
Free owindow when no con_id match or window
This memory leak is related to matching on con_id or matching when the
container has a null window. In that case, windows that do not match
would leak the owindow struct.
Tony Crisci [Wed, 19 Mar 2014 08:34:42 +0000 (04:34 -0400)]
Free match after criteria initialization
This memory leak is associated with matching by a criteria that uses a
regular expression. Without freeing a regex before calling match_init,
it will definitely be lost.
Tony Crisci [Wed, 19 Mar 2014 03:07:01 +0000 (23:07 -0400)]
Test 175: use BAIL_OUT instead of `die`
BAIL_OUT produces a friendlier message explaining why the tests cannot
continue on the command line. `die` produces a cryptic message that some
test failed for some reason.
Tony Crisci [Mon, 10 Mar 2014 08:47:40 +0000 (04:47 -0400)]
Add valgrind suppression file to testcases
The suppression file makes valgrind output more readable by hiding
reports of memory leaks for GObject-related initialization functions in
Pango and Cairo.
Kernc [Sat, 15 Feb 2014 15:49:41 +0000 (16:49 +0100)]
Improved detection of windows that want floating
Windows that match the following criteria are floated by default:
- dialog, utility, toolbar, or splash windows,
- modal windows, or
- windows that have specified equal minimum and maximum size.
Tony Crisci [Sat, 8 Mar 2014 04:56:25 +0000 (23:56 -0500)]
Bugfix: ipc_receive_message reply leak
The function ipc_recv_message in libi3 allocates memory to the location
of the `message` reply in src/ipc_receive_message.c with malloc and must
be freed.
Tony Crisci [Sat, 22 Feb 2014 00:10:21 +0000 (19:10 -0500)]
Move keyboard binding accessor to bindings.[ch]
Rename `get_binding` to `get_keyboard_binding` and ensure that this
function only accesses bindings of type B_KEYBOARD. Other types of
bindings (e.g. mouse bindings) will be accessed by a different function.
Marco Hunsicker [Sat, 22 Feb 2014 10:52:01 +0000 (11:52 +0100)]
Send IPC window events for focus and title changes
This patch fixes ticket #1168 to extend the window IPC event mechanism
to send IPC events for window focus and title changes. The newly added
window events use the same format as the already established "new"
event.
Specifically this patch:
* Moves the ipc_send_window_event() function from src/manage.c into
src/ipc.c and adds an argument for the change property of the event
* Updates src/manage.c to use the new function signature. To ensure
that the "new" event does not send the same event data as the
"focus" event, setting focus now happens after the "new" event
has been sent
* Adds IPC focus event notification to src/x.c. To workaround a problem
during window close when accessing the window name, a function has been
added to query whether a window is actually attached to its parent. To
avoid obsolete focus notification, a new field has been added to keep
track of the focus without any interference by the click handling
* Adds IPC title event notification to src/handlers.c. To avoid
obsolete title notification, a function has been added to determine
whether a window title has actually changed
* Updates the IPC documentation to include the new events
* Updates testcases/t/205-ipc-windows.t to include the "focus" event
in order to ensure the correct event sequence
* Adds two new unit tests, b/testcases/t/219-ipc-window-focus.t and
b/testcases/t/220-ipc-window-title.t to ensure proper "focus" and
"title" events
To be honest, I’m not entirely sure where the race condition originates
from, but when making sure that there are no pending events
(which is what sync_with_i3 accomplishes) before warping the pointer, we
have less flaky testsuite runs.
This hopefully increases the reliability of the test. Empty containers
created by “open” sometimes get spurious UnmapNotify events, and in at
least one run, this test failed because of such an event.
handle ButtonPress events with child != XCB_NONE (Thanks xeen)
The X11 protocol description states:
The window the event is reported with respect to is called the event
window. The event window is found by starting with the source window
and looking up the hierarchy for the first window on which any client
has selected interest in the event.
For the case of urxvt with URxvt.internalBorder > 0, urxvt sets up a
subwindow for its actual contents that is placed “in the middle” of the
urxvt window. In terms of the X11 protocol, the source window is urxvt’s
window, but urxvt does not select ButtonPress events for that.
Therefore, X11 will go up in the hierarchy and deliver the event to i3
for i3’s window decoration, even though this was not actually a click on
the decoration, but into the managed window.
Therefore, we check whether child != XCB_NONE for clicks on window
decorations and then handle them as a click inside the window.
Steve Jones [Sat, 1 Feb 2014 16:09:51 +0000 (16:09 +0000)]
Set EWMH desktop properties on startup.
Calls ewmh_update_current_desktop on startup to set the
_NET_CURRENT_DESKTOP property. Without this change the property only
gets set after the workspaces have been manipulated. Also exclude
hidden workspaces (i.e. those starting with "__" from the workspace
index.
Tony Crisci [Tue, 4 Feb 2014 15:52:52 +0000 (10:52 -0500)]
Document the existence of a C ipc project
Add a link to https://github.com/acrisci/i3-ipc which is a new ipc
library in the design phase of development. When it is stable, it will
provide bindings to many high-level scripting languages with
GObject-introspection.
This project aims to replace the unmaintained Python library and offer
an ipc library in new languages such as Lua and JavaScript.