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
This changes the SHM log format, it doesn’t use 0-bytes to separate
entries anymore. Instead of using lots of printf() calls in i3-dump-log,
we now do precisely one big write().
So, to be clear: i3-dump-log and i3 both need to be upgraded.
Mismatching versions will lead to garbage output (no crashes of i3, just
garbage output).
The -f flag uses an inter-process pthread_cond_t in the shared memory
header to broadcast the arrival of new messages to all i3-dump-log
processes. This internally uses futexes and thus doesn’t even mean a
kernel call in most cases. inter-process pthread_cond_ts require NPTL
(the Native Posix Thread Library, introduce in Linux 2.6).
Connects to i3 to find out the currently running version. Useful since it
might be different from the version compiled into this binary (maybe the
user didn’t correctly install i3 or forgot te restart it).
See also commit 0e752070ac2bed02d0858bbc450ddcee36e3b9b5, which broke
source code listings in gdb unless you cd into i3/src. This should give
us best of both :-).
When starting i3 initially (and after each change to the connected
outputs), this function fixes the resolution of the __i3
pseudo-output. When that resolution is not set to a function which
shares a common divisor with every active output’s resolution,
floating point calculation errors will lead to the scratchpad window
moving when shown repeatedly.
Since we advertise _NET_ACTIVE_WINDOW support (but only set the
corresponding atom currently), it makes sense to also support the
ClientMessage. Apps such as Gajim use it to set focus to the roster
window when clicking on the tray icon for example.
Compilers store the path with which they were called in the debug
symbols. Therefore, this will make backtraces show something like
../i3-4.2/src/main.c instead of src/main.c.
See also http://stackoverflow.com/questions/6473561/
$ time CC=clang make -j16
CC=clang make -j16 6,04s user 0,86s system 468% cpu 1,471 total
CC=clang make -j16 6,05s user 0,87s system 468% cpu 1,477 total
CC=clang make -j16 6,15s user 0,86s system 464% cpu 1,510 total
CC=clang make -j16 6,05s user 0,93s system 467% cpu 1,493 total
CC=clang make -j16 6,10s user 0,84s system 461% cpu 1,507 total
$ time CC=gcc make -j16
CC=gcc make -j16 9,91s user 1,43s system 508% cpu 2,231 total
CC=gcc make -j16 10,02s user 1,37s system 500% cpu 2,275 total
CC=gcc make -j16 9,80s user 1,60s system 507% cpu 2,245 total
CC=gcc make -j16 10,02s user 1,44s system 506% cpu 2,264 total
CC=gcc make -j16 9,99s user 1,45s system 505% cpu 2,261 total
after:
$ time CC=clang make -j16
CC=clang make -j16 3,41s user 0,83s system 375% cpu 1,131 total
CC=clang make -j16 3,29s user 0,90s system 373% cpu 1,122 total
CC=clang make -j16 3,35s user 0,77s system 369% cpu 1,116 total
CC=clang make -j16 3,36s user 0,78s system 374% cpu 1,105 total
CC=clang make -j16 3,46s user 0,75s system 373% cpu 1,126 total
$ time CC=gcc make -j16
CC=gcc make -j16 10,74s user 1,44s system 494% cpu 2,462 total
CC=gcc make -j16 10,68s user 1,54s system 497% cpu 2,453 total
CC=gcc make -j16 10,60s user 1,60s system 488% cpu 2,499 total
CC=gcc make -j16 10,63s user 1,51s system 485% cpu 2,502 total
CC=gcc make -j16 10,70s user 1,51s system 497% cpu 2,453 total
Therefore, we enable pre-compiled headers only when CC=clang.