Commit Graph

130 Commits

Author SHA1 Message Date
b3d7531947 refactor both i3-nagbar starts into src/util.c
With this change, libev >= 4 is a hard dependency. It should be present
in all major linux distributions (even the latest ubuntu LTS).
2012-12-24 16:53:20 +01:00
8d2799c251 Merge branch 'master' into next 2012-09-05 17:09:43 +02:00
f5a7492a11 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.
2012-09-05 17:09:23 +02:00
884627ef20 use I3__FILE__ for DLOG, leave __FILE__ as is
See also commit 0e752070ac, which broke
source code listings in gdb unless you cd into i3/src. This should give
us best of both :-).
2012-08-12 12:19:47 +02:00
0e752070ac explicitly set filenames to $(basename __FILE__)
This makes the debug log a bit more readable, especially since commit
48f1e383ca
2012-08-07 09:55:52 +02:00
cc7f16007a Display i3-nagbar when commands lead to an error
e.g. pressing Mod1+x when having the following in your configfile:

    bindsym Mod1+x some invalid command

will lead to an i3-nagbar instance popping up, offering you to view the
error log (which will contain parser errors from this commit on).
2012-08-02 17:45:09 +02:00
206b96202c Use (void) instead of () for functions without args (Thanks fernandotcl)
See also:
http://article.gmane.org/gmane.linux.kernel/1268792

The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors, such
as the one which was fixed with commit 0ea64ae4.
2012-03-31 10:53:04 +02:00
1f2c9306a2 Merge branch 'master' into next
Conflicts:
	testcases/t/159-socketpaths.t
2011-12-18 18:02:08 +00:00
c21172a6f6 Create a secure temp path instead of a predictable one (Thanks Han)
With this commit, i3 will now use either $XDG_RUNTIME_DIR/i3 (XDG_RUNTIME_DIR
is only writable by the user, so this is not a problem) or a secure temporary
location in /tmp, following the pattern /tmp/i3-<user>.XXXXXX
2011-12-18 17:59:31 +00:00
fb11cc2d14 Consolidate all convert_* functions into libi3.
Some minor fixes along the way as well. Very minor stuff, unlikely
to ever be visible to the user.
2011-11-16 20:54:30 +00:00
d5613905c8 Plug minor leaks in string conversion routines. 2011-11-07 19:57:11 +00:00
9eda7fb6fb move strndup to libi3 2011-10-23 18:02:01 +01:00
9d15a00ba8 introduce sasprintf() in libi3, use it everywhere 2011-10-23 13:16:56 +01:00
42d355f2b7 normalize modelines/headers across src/*.c 2011-10-22 23:40:02 +01:00
f4f4d782bb implement a startup monitor, move code to src/startup.c 2011-10-10 15:54:17 +01:00
b9db72dc8a Implement support for startup notifications
This only sets up startup notifications for the 'exec' commands and directives.

Monitoring startups follows later.
2011-10-10 15:54:17 +01:00
501dc36b98 move sstrdup, scalloc, smalloc, srealloc to libi3, improve error messages 2011-10-02 18:09:30 +01:00
e1631d6320 properly free memory/close fd upon errors (Thanks xeen)
Found with the static analyzer cppcheck
2011-08-31 14:44:48 +02:00
e616b45c83 Bugfix: realloc() with size == 0 works like free() and returns NULL, so don’t die() 2011-08-03 20:43:08 +02:00
02dfb8e891 use memmem and strndup from FreeBSD on Darwin (Thanks Marcus) 2011-07-17 15:18:45 +02:00
c55abca115 add i3-nagbar. tells you about config file errors (for example) 2011-07-10 14:33:19 +02:00
2e75d934a4 Bugfix: Don’t append the --restart parameter on each restart (Thanks aniou)
Fixes: #384
2011-05-12 06:58:09 +02:00
528f486eee Make code compatible with yajl 2.0 *and* 1.0 2011-04-27 19:52:53 +02:00
8a40dc0011 Use XDG_RUNTIME_DIR when available
XDG_RUNTIME_DIR is the volatile runtime data dir provided by modern
session manager such as systemd
2011-04-26 18:39:11 +02:00
4fd4e619ec little coding style fixes, fix compilation warning 2011-03-21 23:54:13 +01:00
f4ec0bceff Very minor issues found with statical analysis.
The Clang Static Analyzer uncovered those issues:

- The variable "changed" in handlers.c is written to, but it's
  never read since that specific write, so the write is not
  necessary.

- In util.c, "tail" may be NULL. In that case, we shouldn't pass
  it to strlen because strlen's behavior is not defined when s is
  NULL.

- In util.c, "write_index" is incremented twice. It's never used
  anymore after being incremented once, so the second increment is
  not necessary.
2011-02-28 16:48:22 +01:00
aa422c07c4 Add forgetful restart to sighandler 2010-12-31 19:36:35 +01:00
c88c3e3ab2 Default to a file in /tmp for the restart state.
The file is now created in /tmp using the process PID and the
username of the user running i3. The restart state file is only
loaded when restarting (the --restart option is appended to the
command line prior to the restart). That means that renaming the
old state file with the ".old" extension is no longer needed.

This "--restart" switch is supposed to be only used by i3. The
"-L" switch can be used to load a layout (and not delete it
afterwards). We unlink the state file after we load it so that
we don't keep cruft in /tmp or try to restart from an old config
file if restart_state is set.
2010-12-27 13:33:03 +01:00
68f906f278 util.c is the proper place for those functions. 2010-12-27 13:28:17 +01:00
3669bcbd5f Remove some commented out code. 2010-12-27 13:27:14 +01:00
a0cd3c2bab Include 'percent' in tree JSON, use C-locale when dumping, update testcase 2010-11-29 11:10:17 +01:00
f7fff5cec1 update indenting of src/util.c 2010-11-28 14:14:34 +01:00
32cc7134aa re-enable ipc_shutdown() when restarting 2010-11-28 14:11:44 +01:00
ab8400fff9 Bugfix: Use setsid() to avoid SIGINT for child processes 2010-11-28 14:03:43 +01:00
0a17fe973c Make the restart path configurable. 2010-11-28 01:18:10 +01:00
65bd71b213 remove some obsolete code 2010-11-26 22:15:09 +01:00
bfa12a5819 Port the path resolution and config loading code from -next. 2010-11-15 14:00:46 +01:00
8f7bd538d8 implement configure requests, adapt testcase
testcase does not pass 100% due to clients not being reparented correctly yet.
2010-11-12 21:41:10 +01:00
8e5a831e27 re-add focus follows mouse handling 2010-04-13 18:43:37 +02:00
eec762ea8f more reformatting/cleanups 2010-04-13 17:52:23 +02:00
fd8735a6fd correctly update/display window title/class 2010-04-13 17:22:34 +02:00
c145f7e529 first step of the big refactoring ("tree" branch).
From here on, we can track changes. It made no sense to put the
development up to this point into git.
2010-04-13 13:17:39 +02:00
f7a1a9fb20 ipc: correctly shutdown IPC sockets when exiting/restarting 2010-03-16 02:44:47 +01:00
f1a011c014 Clear urgency hints set by i3 (see HEAD~2) 2010-03-05 20:03:38 +01:00
b53c5861a2 Restore geometry of all windows before exiting/restarting (Thanks Sasha)
This fixes ticket #185
2010-03-02 15:25:08 +01:00
818e02ef35 huge change: implement RandR instead of Xinerama
Thanks to Merovius for doing a proof of concept on this one and
being a driving force behind the idea.

Using RandR instead of Xinerama means that we are now able to use
the full potential of the modern way of configuring screens. That
means, i3 now has an idea of the outputs your graphic driver
provides, which allowed us to get rid of the ugly way of detecting
changes in the screen configuration which we used before. Now, your
workspaces should not be confused when changing output modes anymore.

Also, instead of having ugly heuristics to assign your workspaces
to (the screen at position X or the second screen in the list of
screens) you will be able to just specify an output name.

As this change basically touches everything, you should be prepared
for bugs. Please test and report them!
2010-03-02 12:47:21 +01:00
7caf98dd18 Move update_if_necessary to util.c, will be necessary later 2010-02-28 18:39:11 +01:00
0b6b8e8380 Bugfix: Use both parts of WM_CLASS (it contains instance and class) (Thanks fallen)
Actually, WM_CLASS contains two null-terminated strings, so we cannot
use asprintf() to get its value but rather use strdup() to get both
of them. Both values are compared when a client is matched against
a wm_class/title combination (for assignments for example).
2010-02-12 12:12:25 +01:00
614b360bd4 added popup for handling SIGSEGV or SIGFPE
the popup is placed on each of the virtual screens
the user can decide to restart or quit i3
in case of an exit a core-dump is generated
2010-01-03 21:32:50 +01:00
e7e9e8e49d ewmh: correctly set _NET_ACTIVE_WINDOW 2009-12-25 15:19:39 +01:00