Tony Crisci [Sun, 5 Oct 2014 18:50:30 +0000 (14:50 -0400)]
Bugfix: check symbol for NULL in binding json dump
When dumping a binding, as is done during the binding event, check
symbol for NULL. If it is, dump json null. This prevents a crash when
running a binding that was configured with bindcode.
Tony Crisci [Wed, 1 Oct 2014 23:26:52 +0000 (19:26 -0400)]
Testcases: Use Xephyr instead of XDummy
Replace the XDummy script with Xephyr. This is done because of some
changes in the Xorg server that make XDummy difficult to use.
Rename library internal variables and function names to replace "xdummy"
with "xserver" to show this change (except for renaming the package and
lib file for better git history).
Rename the switch `--keep-xdummy-output` to `--keep-xserver-output`.
This switch should now be rarely used because Xephyr requires less set
up.
Replace "xdummy" with "xephyr" in comments and utility help
information. Update docs to show the new dependency.
The rectangles for the right and lower border had a width and height,
respectively, greater than the actual border width.
Furthermore, offset the bottom border to not overlap with the right one
and, for the top border, use r->width instead of con->rect.width as with
the other borders.
Tony Crisci [Mon, 22 Sep 2014 05:09:25 +0000 (01:09 -0400)]
IPC: set ws reply "num" member to -1 when named
When a named workspace (i.e., a workspace that has a name that does not
begin with text that can be parsed as an integer greater than or equal
to zero) is represented by the ipc as a workspace json object such as
can be queried with `i3-msg -t get_workspaces`, set the num property to
-1 instead of json null.
This is for convenience of ipc consumers using type-constrained
languages such as C which have difficulty cleanly expressing nullable
integers.
Tony Crisci [Sat, 20 Sep 2014 21:21:08 +0000 (17:21 -0400)]
Do not resend focus on click
Do not set focused_id to XCB_NONE in route click to force resend focus,
in some cases to an already focused window.
Sending focus again on click is not necessary and may cause problems
with certain wine or mono apps. Resending focus makes combo boxes not
work in Office 2010.
This effectively reverts commit 250577da, so in case this commit causes
any problems with Eclipse to resurface, we’ll revert this commit in
favor of 250577da (the Eclipse-related bug fix).
aszlig [Sat, 2 Aug 2014 05:01:15 +0000 (07:01 +0200)]
Allow to validate the config file without X.
We're going to call parse_configuration() very early if -C is given on
the command line. Instead of the previous "only_check_config", which has
been a global variable, we now simply pass use_nagbar as false if we're
just validating.
This causes the whole parsing to run without X and of course without
starting nagbar and displaying the errors to standard out/error instead.
The return code of parse_configuration() is now a boolean which
represents whether an error occured during parsing and the programs exit
code is returned accordingly.
Although the config parser still has a lot of side-effects, we now can
parse without the need to have an XCB connection. A nicer implementation
would be to just set the new font and load it just after we're done
parsing, but to ensure we don't break functionality we just load a dummy
FONT_TYPE_NONE if XCB isn't available. The main reason for going this
route is that it's a bit difficult to test fonts in a distribution
agnostic way without bundling fonts with i3 (or Xdummy to be more
exact).
Mats [Fri, 1 Aug 2014 18:07:04 +0000 (20:07 +0200)]
Align lower line of bar decoration to border width
In normal border style, two horizontal lines are drawn to outline the
bar decoration. The lower line leaves a gap to the left and right to
align with the border. This gap was hardcoded to 2 pixels. Now it
matches the current border width, if any.
In stacked layout, only the bottommost bar is aligned. In tabbed layout,
no gaps are left in order to close the outline and make the notion of a
tab more clear.
Tony Crisci [Mon, 28 Jul 2014 02:32:50 +0000 (22:32 -0400)]
Raise floating windows on `focus [direction]`
Raise a window when cycling focus between floating windows with `focus
[direction]` command so that newly focused windows are rendered on top
of other windows.
This is done by placing the window last in the floating nodes of the
parent and reordering the stack so the relative order is preserved.
Bugfix: add a sync call to i3bar to confirm reparents before exiting
Without this call, sometimes the tray icon windows are reparented into
i3’s container around the i3bar window, i.e. into the next remaining
window in the window hierarchy. Since i3 then closes that container
(since the i3bar window itself was closed), the tray window will also
get closed. In general, this weird interaction (getting reparented and
then closed) is not well received by tray icon providers :).
Remove TODO for cycling through the floating z-index.
I think this is not a good feature to have. It shouldn’t be necessary
for a tiling window manager that explicitly discourages the use of
floating windows.
Tony Crisci [Sat, 12 Jul 2014 02:23:23 +0000 (22:23 -0400)]
Handle WM_CLASS changes
http://tronche.com/gui/x/icccm/sec-4.html
> The WM_CLASS property (of type STRING without control characters)
> contains two consecutive null-terminated strings. These specify the
> Instance and Class names to be used by both the client and the window
> manager for looking up resources for the application or as identifying
> information.
i3 processes changes to WM_CLASS by updating the cached property and
running assignments. This allows the property to be used in criteria
selection.
Tony Crisci [Tue, 8 Jul 2014 01:01:14 +0000 (21:01 -0400)]
Always explicitly set border widths on manage
When a window becomes managed, explicitly set the current border width
to the default instead of relying on the default value of -1 to apply
the correct value.
Now that there are two different kinds of default borders, a border
width value of -1 is ambiguous. This can lead to different border widths
effectively being applied when the container changes from tiling to
floating, which is surprising behavior.
This commit extends behavior introduced in this commit to normal
borders:
Tony Crisci [Fri, 4 Jul 2014 09:53:22 +0000 (05:53 -0400)]
i3bar: implement custom mouse wheel commands
Users can specify a command to run when a button was pressed on i3bar to
override the default behavior. Currently only the mouse wheel buttons
are supported. This is useful for disabling the scroll wheel action or
running scripts that implement custom behavior for these buttons.
Example:
bar {
wheel_up_cmd nop
wheel_down_cmd exec ~/.i3/scripts/custom_wheel_down
}
Tony Crisci [Fri, 4 Jul 2014 09:39:07 +0000 (05:39 -0400)]
Handle EWMH requests to change current desktop
This request is used by pagers and bars to change the current
desktop likely as a result of some user action. We interpret this as
a request to focus the given workspace.
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.