Tony Crisci [Sun, 6 Jul 2014 21:26:16 +0000 (17:26 -0400)]
Add testcase for EWMH desktop viewport
Test that the EWMH specified property _NET_DESKTOP_VIEWPORT is updated
properly on the root window. We interpret this as a list of x/y
coordinate pairs for the upper left corner of the respective outputs of
the workspaces.
Tony Crisci [Sat, 5 Jul 2014 13:57:33 +0000 (09:57 -0400)]
Add testcase for EWMH desktop names
Test that the EWMH specified property _NET_DESKTOP_NAMES is updated
properly on the root window. We interpret this as a list of the open
workspace names.
Turns out the change in behavior was unexpected by a number of users, so
let’s revert it and make those users that want this behavior configure
it explicitly.
Tony Crisci [Sat, 28 Jun 2014 01:20:12 +0000 (21:20 -0400)]
Explicitly set current border width when BS_PIXEL
When a window becomes managed, if the config specifies a pixel border
style, explicitly set the current border width so it does not change
when the container changes from tiling to floating.
Tony Crisci [Wed, 18 Jun 2014 08:23:00 +0000 (04:23 -0400)]
Handle WM_CHANGE_STATE requests for iconic state
http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.4
> IconicState - The client's top-level window is iconic (whatever that
> means for this window manager). The client can assume that its
> top-level window is not viewable, its icon_window (if any) will be
> viewable and, failing that, its icon_pixmap (if any) or its
> WM_ICON_NAME will be displayed.
Tony Crisci [Fri, 20 Jun 2014 11:26:36 +0000 (07:26 -0400)]
Consider motif border for floating geometry
When calculating the geometry of a floating window with motif hints that
specify a border style, take into account that this window will have a
different border style when calculating its position with
floating_enable() when the window becomes managed.
A nice side effect of this is that users can override motif hints with
`new_float` config directives when they are specified other than
`normal`.
> _NET_DESKTOP_NAMES
>
> _NET_DESKTOP_NAMES, UTF8_STRING[]
>
> The names of all virtual desktops. This is a list of NULL-terminated
> strings in UTF-8 encoding [UTF8]. This property MAY be changed by a
> Pager or the Window Manager at any time.
Tony Crisci [Sun, 22 Jun 2014 16:24:26 +0000 (12:24 -0400)]
Workspace command number selection
If a `workspace {N}` or `move to workspace {N}` command is given with N
as a plain number, the workspace of this number is selected for the
context of the command if one exists and there is no workspace with a
name that exactly matches N.
Tony Crisci [Thu, 19 Jun 2014 12:09:31 +0000 (08:09 -0400)]
Make command `move [direction]` work with criteria
A container selected with criteria should be moved with the `move
[direction]` command, instead of this command always acting on the
focused container.
(Okay, an Xlib dependency still comes in through other libraries that we
link against, but it’s not us. Our code is simpler by this change and
uses one less connection to X11.)
Tony Crisci [Tue, 17 Jun 2014 06:49:39 +0000 (02:49 -0400)]
bugfix: don't set input focus if not accepted
http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7
> Clients using the Globally Active model can only use a SetInputFocus request
> to acquire the input focus when they do not already have it on receipt of one
> of the following events:
> * ButtonPress
> * ButtonRelease
> * Passive-grabbed KeyPress
> * Passive-grabbed KeyRelease
Since managing a window happens on a MapNotify (which is absent from this
list), the window cannot accept input focus, so we should not try to focus
the window at all.
Fixes an issue with xfce4-notifyd which (correctly) declines focus when
we send WM_TAKE_FOCUS, which puts i3 in a state where i3 focus and X
focus are different when a notification appears.
This should be the last commit that formats a big bunch of files. From
here on, whenever I merge patches, I’ll run clang-format like described
in the title.
Tony Crisci [Sun, 15 Jun 2014 04:21:33 +0000 (00:21 -0400)]
userguide: document exit confirmation dialog
In the section "Exiting i3", document the confirmation dialog (nagbar)
that will show when the user presses the default keys to exit in such a
way to hint that it is configurable.
1) The i3 codebase is now consistently formatted. clang-format uncovered
plenty of places where inconsistent code made it into our code base.
2) When writing code, you don’t need to think or worry about our coding
style. Write it in yours, then run clang-format-3.5
3) When submitting patches, we don’t need to argue about coding style.
The basic idea is that we don’t want to care about _how_ we write the
code, but _what_ it does :). The coding style that we use is defined in
the .clang-format config file and is based on the google style, but
adapted in such a way that the number of modifications to the i3 code
base is minimal.
handle windows whose WM_TRANSIENT_FOR points to themselve
I consider this behavior broken and not respecting the standard, but it
happens in real life, and it’s better for i3 to not busy-loop in such a
situation :).
Tony Crisci [Sat, 7 Jun 2014 02:11:44 +0000 (22:11 -0400)]
Don't ELOG ipc EOF
Receiving EOF from a client is not an error, but rather a standard way a
client may disconnect from the IPC. This should rather be logged from
a consumer of the libi3 ipc_recv_message() function as a normal client
disconnect event.
Tony Crisci [Sat, 31 May 2014 15:00:02 +0000 (11:00 -0400)]
Add abstraction for running a binding
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().
Tony Crisci [Sat, 31 May 2014 16:06:39 +0000 (12:06 -0400)]
Set EWMH active window to None when none has focus
_NET_ACTIVE_WINDOW:
> The window ID of the currently active window or None if no window has
> the focus.
This fixes a bug that would not update _NET_ACTIVE_WINDOW when focus
changed to an i3 container without a window such as a branch or
workspace content container.
Tony Crisci [Wed, 28 May 2014 06:01:50 +0000 (02:01 -0400)]
Refactor parse_command
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.
Atte Peltomaki [Mon, 24 Mar 2014 17:03:05 +0000 (19:03 +0200)]
Add configuration option for disabling mouse warping
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.
Tony Crisci [Sun, 18 May 2014 04:44:19 +0000 (00:44 -0400)]
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.