Commit Graph

4554 Commits

Author SHA1 Message Date
Tony Crisci 45fa4b7d23 Change the names of parser result structs
Change the name of structs CommandResult and ConfigResult to
CommandResultIR and ConfigResultIR to show they are an intermediate
representation used during parsing.
2014-05-20 19:59:01 +02:00
Michael Stapelberg dda9a7f6e0 debian: require libyajl >= 2.0.4 (Thanks Koston) 2014-05-16 18:15:53 +02:00
Michael Stapelberg e41b11fa0a use size_t for strspn() return value 2014-05-16 18:03:31 +02:00
Jean-Philippe Ouellet 88114bc055 "somewhen" -> "some time" in i3-config-wizard(1) 2014-05-16 18:00:00 +02:00
Aleksi Blinnikka 89dd868e82 Separate border width for floating windows
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.

fixes #1244
2014-05-16 17:59:21 +02:00
Tony Crisci e707e0a5fa 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.

fixes #1131
2014-05-16 17:55:30 +02:00
Michael Stapelberg e2f47ef466 i3-input: fix (irrelevant) memory leak
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.
2014-05-15 23:50:09 +02:00
Michael Stapelberg 0d50658fa7 i3-dmenu-desktop: don’t use smartmatch (it’s experimental)
This commit should not change functionality at all (famous last words).
2014-05-15 22:52:35 +02:00
Michael Stapelberg b69b3fc572 docs/userguide: fix default key binding (Thanks Maxime) 2014-05-08 08:45:30 +02:00
Michael Stapelberg 79d92cb567 fix “make dist” target
This was broken in 13db562551
2014-05-04 23:07:53 +02:00
Tony Crisci b714878f52 Rerender on button press only when focus changes
On button press events, the only change in state that would presently
require rerendering the tree is when the focused window changes.
2014-05-04 22:55:50 +02:00
Tony Crisci 13db562551 Remove yajl major version conditionals
Yajl version ≥ 2 is required.

fixes #1156
2014-05-04 22:52:37 +02:00
Tony Crisci 22b4215d92 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.

http://standards.freedesktop.org/wm-spec/latest/ar01s03.html#idm140251368127856
2014-05-03 15:57:43 +02:00
Marco Hunsicker 7170afc2c7 Test workspace empty event semantics
This patchs provides testcases for the workspace "empty" event.
2014-05-03 15:37:25 +02:00
Tony Crisci 5fc1b5d02d 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
2014-05-03 15:34:33 +02:00
Tony Crisci c3d46c9145 i3bar: reinit colors on barconfig update
Allows bar colors to be updated on barconfig update events, such as with
the ipc command `reload`.
2014-05-03 15:09:02 +02:00
Tony Crisci 4126c87daf Dont include dock clients in ewmh lists
http://standards.freedesktop.org/wm-spec/latest/ar01s03.html#idm140251368149456

The _NET_CLIENT_LIST property of the root window:

> These arrays contain all X Windows managed by the Window Manager.

Dock clients are not managed windows, so they should not be included in
_NET_CLIENT_LIST or _NET_CLIENT_LIST_STACKING.
2014-05-03 15:08:31 +02:00
Michael Stapelberg ff94d28b85 improve error messages for i3-internal workspace names 2014-05-03 15:02:51 +02:00
Michael Stapelberg dba8c91eff add a testcase for the previous commit (internal workspaces) 2014-05-03 15:00:49 +02:00
Alexander Berntsen bc79884a9e Make all workspaces starting with "__" internal
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.

Fixes #1209.
2014-05-03 15:00:15 +02:00
Michael Stapelberg 144e3fba2a render resize windows retina-correctly 2014-05-02 17:11:48 +02:00
Michael Stapelberg 812f1d268d s/he/she/, s/his/her/ (Thanks lasers) 2014-04-30 09:43:32 +02:00
Tony Crisci 8146638320 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.
2014-04-30 09:35:31 +02:00
Tony Crisci 2f42fe61d9 Feature: send complete config on barconfig_update
Send all the options in the bar block on the barconfig_update event.

This will eventually allow for dynamically updating bar colors with the
`reload` command.
2014-04-30 09:33:29 +02:00
Tony Crisci ab0fae400b 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.
2014-04-30 09:31:42 +02:00
Tony Crisci 7a5cf4aa44 Bugfix: ipc window event crash with no window
The log message at the top of ipc_send_window_event would segfault when
no xcb window is present, such as for a split container.

The log now shows the con id which is more relevant anyway.
2014-04-30 09:22:46 +02:00
Tony Crisci 3171d7ebe5 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.
2014-04-30 09:18:53 +02:00
Michael Stapelberg 3760a48abe truncate DPI to an integer before multiplying (Thanks eeemsi)
This fixes i3bar workspace button rendering on non-DPI screens
(oldschool!)
2014-04-26 22:50:31 +02:00
Michael Stapelberg 350e2c5f55 do click handling and tray padding retina-correctly 2014-04-26 17:30:27 +02:00
Michael Stapelberg 9686dd4943 draw workspace buttons and padded text blocks retina-correctly 2014-04-26 17:27:57 +02:00
Michael Stapelberg 87110a87a8 i3bar: render separators retina-correctly 2014-04-26 17:20:21 +02:00
Michael Stapelberg bff72d653d Initialize default window border width retina-correctly 2014-04-26 17:18:21 +02:00
Michael Stapelberg c79c49f69d libi3: add logical_px() for Retina display support 2014-04-26 17:17:37 +02:00
Michael Stapelberg a0e979d097 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.”

fixes #1240
2014-04-26 14:25:12 +02:00
Michael Stapelberg 87c855f851 add missing docs/layout-saving-1.png 2014-04-26 12:46:25 +02:00
Michael Stapelberg cb37d1a140 debian: add docs/layout-saving 2014-04-26 12:40:30 +02:00
Tony Crisci 02ff10aadb Move check_for_duplicate_bindings to bindings.[ch]
Additionally add a check for the same input_type (mouse or keyboard).
Bindings with different input types cannot be duplicates.
2014-04-26 12:10:33 +02:00
Tony Crisci ea551e4d99 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.

fixes #1220
2014-04-26 12:10:05 +02:00
Petr Písař 2cc51841a5 Reset SIGIPE handler before executing a command
This commit:

commit fb6d117c42
Author: Axel Wagner <mail@merovius.de>
Date:   Thu Dec 30 21:09:32 2010 +0100

    Port sighandler to tree-branch

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:

$ perl -e 'print $SIG{PIPE}, qq{\n}'
IGNORE

fixes #1237
2014-04-26 12:09:45 +02:00
Michael Stapelberg 7deb23c727 add docs/layout-saving
Feedback on this new document is very much appreciated, please don’t
hesitate to state anything that is hard to understand/could be improved.
2014-04-23 19:49:50 +02:00
Michael Stapelberg 254e4d6f05 Fix i3.mk to not rebuild test.* all the time
This problem was introduced in 5181055a
2014-04-23 19:34:45 +02:00
Michael Stapelberg b966f3796f build i3-save-tree(1) manpage (Thanks xeen) 2014-04-23 19:33:22 +02:00
Julian Ospald 5181055aad fix parallel make
fixes #1232
2014-04-23 17:55:15 +02:00
Julian Ospald a2cbca7ae1 respect CFLAGS in linking command
fixes #1233
2014-04-23 17:55:15 +02:00
Michael Stapelberg 110b8d9557 Don’t overwrite existing windows with placeholder windows
This could happen when you appended a layout on a workspace where there
are already other windows.
2014-04-18 20:36:56 +02:00
Michael Stapelberg 524f20b8a0 layout restoring: append at the nearest split container (or workspace) (Thanks chris)
Before this commit, leaf containers (such as terminal emulators) would
get children appended, which is not intended.

fixes #1223
2014-04-18 20:30:27 +02:00
Tony Crisci 702906d0cf Move switch_mode to bindings.[ch] 2014-04-15 17:46:59 +02:00
Tony Crisci 05f0585817 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.

fixes #1167
2014-04-15 17:46:08 +02:00
Tony Crisci 819bc09375 Maintain the _NET_CLIENT_LIST property
Add and update the _NET_CLIENT_LIST property on the root window to
better comply with ewmh standards.

Information on this property can be found here:
http://standards.freedesktop.org/wm-spec/latest/ar01s03.html

> These arrays contain all X Windows managed by the Window Manager.
> _NET_CLIENT_LIST has initial mapping order, starting with the oldest window.

fixes #1099
2014-04-15 17:44:25 +02:00
Michael Stapelberg 77abb2ef19 Bugfix: clear wm_size_hints if they are not set
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.
2014-04-09 22:14:50 +02:00