Add run_binding function to bindings.h.
> Runs the given binding and handles parse errors. Returns a
> CommandResult for running the binding's command. Caller should render
> tree if needs_tree_render is true. Free with command_result_free().
parse_command returns a struct that contains useful information about
the result of a command as a whole (instead of the intermediate
representation used during parsing).
parse_command now requires the caller to allocate the yajl_gen used for
generating a json reply. This is passed as the second parameter to
parse_command. If NULL is passed, no json reply will be generated.
This patch adds a new configuration option "mouse_warping [output|none]".
When mouse warping is disabled, mouse cursor does not jump to middle of current
screen when changing workspaces between multiple outputs. This introduces a
"special" cursor state, where focus is in one window and cursor on another.
Useful for eg. scrolling a web page with mouse wheel while typing into another
window on keyboard.
Workspace assignments with bare numbers assign all workspaces with that
number to the specified output.
Workspace assignment by number is overridden by workspace assignment by
name.
Change the name of structs CommandResult and ConfigResult to
CommandResultIR and ConfigResultIR to show they are an intermediate
representation used during parsing.
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
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
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
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.
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.
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
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.
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.
closes#1182
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.
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
Create files bindings.[ch] to contain functions for configuring,
finding, and running bindings.
Use the new function `configure_binding` for binding configuration. This
function adds a binding from config parameters.
Export the function `modifiers_from_str` from config_directives.h.
This change is made in preparation for the new bindmouse functionality.
When the _MOTIF_WM_HINTS property of a window specifies it should have
no title bar, or no decorations at all, respond by setting the border
style of that container to BS_PIXEL or BS_NONE respectively.
This comes from the old Motif window manager. It was originally intended
to specify exactly what sort of decorations a window should have, and
exactly what sort of user input it should respond to. The EWMH spec
intended to replace Motif hints with _NET_WM_WINDOW_TYPE, but it is
still in use by popular widget toolkits such as GTK+ and Java AWT.
i3's implementation simply mirrors Gnome's Metacity. Official
documentation of this hint is nowhere to be found.
For more information see:
https://people.gnome.org/~tthurman/docs/metacity/xprops_8h-source.htmlhttp://stackoverflow.com/questions/13787553/detect-if-a-x11-window-has-decorationsfixes#832
Make sure the command `move <direction>` properly sends the workspace
focus ipc event required for i3bar to be properly updated and redrawn.
Make `ipc_send_workspace_focus_event publicly available from ipc.h for
more flexible event sending.
An input type of B_KEYBOARD will indicated this binding was created with
"bindsym", "bindcode", or "bind" and should only run on key press
events.
An input type of B_MOUSE will indicate this binding was created with
"bindmouse" and should only run on button press events (not yet
implemented).
For more information see #558.
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it’s actually
relevant (upon DPI changes).
fixes#1115
This is done by installing a new check watcher that replaces the main
X11 event handler and calling ev_run with EVRUN_ONCE until the dragging
loop left state DRAGGING.
With this commit, other handlers, most notably the redraw handler for
placeholder windows, get a chance to run when dragging (placeholder!)
windows around.
Since the macro PATH_MAX is not defined on every system (GNU/Hurd being
one of those who do not define it), we remove all references to this
macro. Instead, we use a buffer of arbitraty size and grow it when
needed to contain paths.
This removes code duplication, which will be useful for a subsequent
commit.
Furthermore, we now don’t open X11 connections unnecessarily in some
corner cases.
Add DRAG_ABORT to enum drag_result_t. DRAG_ABORT will indicate the drag
operation cannot be completed.
Return DRAG_ABORT on UnmapNotify, or when the keyboard or pointer cannot
be grabbed.
Add DRAGGING to return value for drag_result_t. DRAGGING is used
internally by drag_pointer to indicate the drag is in progress.
Change DRAG_CANCEL to DRAG_REVERT to clarify the distinction between
"abort" and "revert/cancel" actions.
Fixes an issue that caused i3 to crash when a user is dragging or
resizing a floating window that becomes destroyed.
i3 current behavior hides the binding mode indicator when
workspace buttons are disabled.
This patch adds a new configuration for i3bar called
'binding_mode_indicator' which acts like the workspace_buttons.
It is now possible to configure i3bar to hide the
workspace buttons and keep showing the binding mode indicator.
This should make the hide workspace buttons configuration
more convenient for those who are heavily using binding
modes.
Default value for binding_mode_indicator is true.
This reverts commit 0659a0d98c.
It was a fix for dzen2 setups, but broke several other use cases.
Because dzen2 is not really important since most people use i3bar
nowadays, let’s revert this.
fixes#1062fixes#1068fixes#1070