Allow changing the layout of workspaces by storing it (Thanks mhcerri)
Before commit 4976fa33504907510f1ee9e44884c116af0d801b, setting the
layout of workspaces to something else than the default would just mess
up the parent container of the workspace (the content container).
After that commit, it would create an unnecessary split container when
you change the layout _before_ opening any containers. To avoid this, we
now store the layout (similar to how the 'workspace_layout'
configuration directive works) and apply it when the first container is
attached to the workspace.
Simon Elsbrock [Thu, 6 Sep 2012 06:08:46 +0000 (08:08 +0200)]
toggle fullscreen on 'scratchpad show'
If the focused application is in fullscreen mode and 'scratchpad show'
is executed, toggle the fullscreen mode before showing the scratchpad
application. Otherwise, the scratchpad app would not be visible anyways
but focus would be stolen.
Bugfix: Don’t focus the wrong workspace when moving to scratchpad (+test) (Thanks loblik)
The problem was that scratchpad_move() didn’t check whether the source
workspace was focused. Therefore, 'move scratchpad' only worked reliably
interactively , but not when used with criteria.
Then it will only be triggered if you hit $mod, hit x, release x,
release $mod. It will not be triggered if you hit $mod, hit x, release
$mod, release x. The reason is that the KeyRelease event in the latter
case will not have the modifier in its flags, so it doesn’t match the
configured binding.
rendering: ceil() instead of truncating for tabbed deco_rect width (Thanks szalik)
In tabbed mode, the available width (say 1280) is divided by the amount
of child containers (say 3). Before this commit, we just truncated the
result and would end up with 426 + 426 + 426 = 1278 pixels that we
render to. Now we render a bit too much, but that’ll at least not give
us graphics corruption on any side :).
bugfix: forgot to mark split containers as split = true (+test) (Thanks szalik)
When the workspace layout (formerly orientation) was forced to change
due to a move command, the split container we created was not marked as
split = true, which caused tree_flatten() to errnously kill the contents
of it and thus one window ended up unmanaged.
Also, the logic in tree_flatten() was inverted due to commit de94f6da.
startup-notifications: keep sequence around for 30s after completion
This changes the fact that Firefox would not be launched on the correct
workspace because it marked the startup sequence as completed *before*
actually mapping all of its windows.
To test this, go to workspace 3 and run this command in a terminal:
i3-msg 'exec iceweasel; workspace 4'
That will make i3 start iceweasel (and create a proper startup
notification context for it), then immediately switch to workspace 4
(before iceweasel could possibly start).
The iceweasel window(s) should appear on workspace 3.
Bugfix: Use _exit() instead of exit to avoid calling atexit functions (Thanks f8l)
Basically, this is the same fix as commit 914ca6cf :-/. Once again, we
called exit() instead of _exit(), but this time it lead to a kill(0,
SIGTERM), effectively killing all processes in the i3 process group,
including i3 itself. The cause for the kill(0) is that nagbar_pid is set
to 0 by fork(), signaling we’re in the child process. The cleanup
handler only checks for nagbar_pid being -1 as a special value, however.
con_set_layout: always use the parent container, handle workspaces properly
Previously, in case 'layout stacked' (for example) had been called
interactively, con_set_layout would be called with focused->parent,
while with for_window, it’d be called on the actual matching container.
This difference in behavior was the cause for the inability to use
'for_window [class="XTerm"] layout tabbed', which now works \o/, but
more on that below.
The change also allows us to handle the case of the user selecting a
CT_WORKSPACE container properly, that is, by using the special case and
creating a new split container on the workspace which gets all the
contents, but a new layout.
Now, before you are enthusiastic about the change and try to use
for_window magic in your config file, keep in mind: The 'layout' command
acts on the parent split container. That is, when using a line such as
this one:
for_window [class="XTerm"] layout tabbed
…and opening an XTerm when on a workspace with one single other window,
the whole workspace will be set tabbed (just as previously when you
opened an XTerm and sent 'layout tabbed' manually).
Therefore, to open XTerm in its own tabbed split container, you need to
split before:
for_window [class="XTerm"] split v, layout tabbed
The comma here is important! It says that the second command should not
be treated as an entirely unrelated command, but it should also relate
the matching window (while it does work with a ';', that is prone to
race-conditions and should be avoided).
Bugfix: fix flickering with 1pixel border tabbed layouts (Thanks julien)
When you have a tabbed container which has had more than one container
but currently has precisely one container, there was a bit of flickering
when switching workspaces occasionally. This commit fixes it by properly
setting the height of the deco_rect (and thus the X11 window) to not
make the old window contents show up for a minimum period of time.
Bugfix: Don’t allow ConfigureRequests while in fullscreen (Thanks Piotr)
This fixes a compatibility issue with gnome-terminal and xfce’s
terminal, where fullscreening would lead to moving the window and not
displaying the contents properly.
manpage: improve locale setup in example .xsession (Thanks Harald König)
Harald mentioned he was surprised about the locales we recommend in the
.xsession example, so I’ve re-investigated.
Here is the test program I have used:
#include <stdio.h>
#include <locale.h>
int main() {
/* SUSv2 setlocale(3) says:
* Internationalised programs must call setlocale() to initiate
* a specific language operation. This can be done by calling
* setlocale() as follows: */
setlocale(LC_ALL, "");
printf("LC_NUMERIC is %s\n", setlocale(LC_NUMERIC, NULL));
}
Joel Stemmer [Sat, 18 Aug 2012 13:25:00 +0000 (15:25 +0200)]
fix resizing floating windows by height
When resizing floating windows, changing the height was not correctly
handled. This commit fixes that and adds testcases for shrinking and
growing the width and height of floating windows.
Bugfix: don’t change tabbed/stacked cons to splitv/splith layout (Thanks Merovius)
To automagically do the right thing when rotating monitors with regards
to splith/splitv layout (depending on width/height of the monitor), we
change the orientation of existing workspaces and the first child.
If that first child happens to be a stacked/tabbed con, we cannot change
the layout unconditionally (previously, the orientation was not in the
layout, so we never noticed this problem).
i3 --moreversion: use readlink /proc/$pid/exe instead of realpath(argv[0])
The latter is actually wrong. For example, when running i3
--moreversion, it will print $(pwd)/i3 instead of $(which i3). In my
previous tests, this coincidentally was the same.
logging: make libi3 use verboselog()/errorlog(), provide it in each caller
While this is a bit ugly, it makes the log messages end up where they
are supposed to: in the shmlog/stdout in case of i3 and on stdout in
case of utilities such as i3-input