Commit Graph

175 Commits (0b621292246f2736eeed82ef106f64749c058f68)

Author SHA1 Message Date
Michael Stapelberg 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
Michael Stapelberg 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
Michael Stapelberg 1f2c9306a2 Merge branch 'master' into next
Conflicts:
	testcases/t/159-socketpaths.t
2011-12-18 18:02:08 +00:00
Michael Stapelberg 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
Fernando Tarlá Cardoso Lemos 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
Fernando Tarlá Cardoso Lemos d5613905c8 Plug minor leaks in string conversion routines. 2011-11-07 19:57:11 +00:00
Michael Stapelberg 9eda7fb6fb move strndup to libi3 2011-10-23 18:02:01 +01:00
Michael Stapelberg 9d15a00ba8 introduce sasprintf() in libi3, use it everywhere 2011-10-23 13:16:56 +01:00
Michael Stapelberg 42d355f2b7 normalize modelines/headers across src/*.c 2011-10-22 23:40:02 +01:00
Michael Stapelberg f4f4d782bb implement a startup monitor, move code to src/startup.c 2011-10-10 15:54:17 +01:00
Michael Stapelberg 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
Michael Stapelberg 501dc36b98 move sstrdup, scalloc, smalloc, srealloc to libi3, improve error messages 2011-10-02 18:09:30 +01:00
Michael Stapelberg e1631d6320 properly free memory/close fd upon errors (Thanks xeen)
Found with the static analyzer cppcheck
2011-08-31 14:44:48 +02:00
Michael Stapelberg e616b45c83 Bugfix: realloc() with size == 0 works like free() and returns NULL, so don’t die() 2011-08-03 20:43:08 +02:00
Michael Stapelberg 02dfb8e891 use memmem and strndup from FreeBSD on Darwin (Thanks Marcus) 2011-07-17 15:18:45 +02:00
Michael Stapelberg c55abca115 add i3-nagbar. tells you about config file errors (for example) 2011-07-10 14:33:19 +02:00
Michael Stapelberg 2e75d934a4 Bugfix: Don’t append the --restart parameter on each restart (Thanks aniou)
Fixes: #384
2011-05-12 06:58:09 +02:00
Michael Stapelberg 528f486eee Make code compatible with yajl 2.0 *and* 1.0 2011-04-27 19:52:53 +02:00
Sardem FF7 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
Michael Stapelberg 4fd4e619ec little coding style fixes, fix compilation warning 2011-03-21 23:54:13 +01:00
Fernando Tarlá Cardoso Lemos 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
Axel Wagner aa422c07c4 Add forgetful restart to sighandler 2010-12-31 19:36:35 +01:00
Fernando Tarlá Cardoso Lemos 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
Fernando Tarlá Cardoso Lemos 68f906f278 util.c is the proper place for those functions. 2010-12-27 13:28:17 +01:00
Fernando Tarlá Cardoso Lemos 3669bcbd5f Remove some commented out code. 2010-12-27 13:27:14 +01:00
Michael Stapelberg a0cd3c2bab Include 'percent' in tree JSON, use C-locale when dumping, update testcase 2010-11-29 11:10:17 +01:00
Michael Stapelberg f7fff5cec1 update indenting of src/util.c 2010-11-28 14:14:34 +01:00
Michael Stapelberg 32cc7134aa re-enable ipc_shutdown() when restarting 2010-11-28 14:11:44 +01:00
Michael Stapelberg ab8400fff9 Bugfix: Use setsid() to avoid SIGINT for child processes 2010-11-28 14:03:43 +01:00
Fernando Tarlá Cardoso Lemos 0a17fe973c Make the restart path configurable. 2010-11-28 01:18:10 +01:00
Michael Stapelberg 65bd71b213 remove some obsolete code 2010-11-26 22:15:09 +01:00
Fernando Tarlá Cardoso Lemos bfa12a5819 Port the path resolution and config loading code from -next. 2010-11-15 14:00:46 +01:00
Michael Stapelberg 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
Michael Stapelberg 8e5a831e27 re-add focus follows mouse handling 2010-04-13 18:43:37 +02:00
Michael Stapelberg eec762ea8f more reformatting/cleanups 2010-04-13 17:52:23 +02:00
Michael Stapelberg fd8735a6fd correctly update/display window title/class 2010-04-13 17:22:34 +02:00
Michael Stapelberg 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
Michael Stapelberg f7a1a9fb20 ipc: correctly shutdown IPC sockets when exiting/restarting 2010-03-16 02:44:47 +01:00
Michael Stapelberg f1a011c014 Clear urgency hints set by i3 (see HEAD~2) 2010-03-05 20:03:38 +01:00
Michael Stapelberg b53c5861a2 Restore geometry of all windows before exiting/restarting (Thanks Sasha)
This fixes ticket #185
2010-03-02 15:25:08 +01:00
Michael Stapelberg 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
Michael Stapelberg 7caf98dd18 Move update_if_necessary to util.c, will be necessary later 2010-02-28 18:39:11 +01:00
Michael Stapelberg 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
Jan-Erik Rediger 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
Michael Stapelberg e7e9e8e49d ewmh: correctly set _NET_ACTIVE_WINDOW 2009-12-25 15:19:39 +01:00
Michael Stapelberg 0641e6a1a3 ewmh: correctly set _NET_CURRENT_DESKTOP to the number of the active workspace 2009-12-25 15:05:17 +01:00
Michael Stapelberg 9df64a8d0a Correctly exit when another window manager is already running
This is implemented by checking if setting the redirect mask returned
an error or not.
2009-12-22 11:29:24 +01:00
Michael Stapelberg 6ef0d1fa79 Touch each log message and classify it as DLOG (debug), ELOG (error) or LOG (verbose) 2009-12-19 22:40:23 +01:00
Michael Stapelberg 47ebb9e1dd Fix compilation warning on OpenBSD (Thanks bapt) 2009-11-10 00:07:40 +01:00
Michael Stapelberg 2b70e05ee9 Refactor workspaces to be stored in a TAILQ instead of an array
This fixes many problems we were having with a dynamically growing
array because of the realloc (pointers inside the area which was
allocated were no longer valid as soon as the realloc moved the
memory to another address).

Again, this is a rather big change, so expect problems and enable
core-dumps.
2009-09-29 19:45:41 +02:00
Michael Stapelberg e101940c5e Implement options to change the default mode of containers
The following new directives have been implemented for the configuration
file:

	new_container <default|stacking|tabbed>
	new_container stack-limit <cols|rows> <value>

Note that they require using the new lexer/parser, which you can
do by passing -l to i3 when starting.
2009-09-27 23:08:27 +02:00
Michael Stapelberg f38809288a Make number of workspaces dynamic (no longer limited by 10)
Warning: This is not yet thoroughly tested, so be prepared to
encounter some segfaults. Please enable logging and coredumps,
so we can fix bugs quickly.
2009-09-27 14:00:54 +02:00
Michael Stapelberg a8352a8988 Merge patches for OpenBSD compatibility 2009-09-02 22:25:50 +02:00
Michael Stapelberg d9d4d9fff1 Implement tabbing
Use command "T" to switch to tabbing
2009-08-22 09:07:23 +02:00
Michael Stapelberg 44d9111d65 More log cleanups 2009-08-11 15:23:58 +02:00
Michael Stapelberg 47a798ac4a Implement assignments of workspaces to screens, big cleanup of workspace code
Please test this! Plug in screens, unplug them, use your video projector,
change resolutions, etc.

To use the assignments, use the following syntax:
workspace <number> [screen <screen>] [name]

Where screen can be one of:
<number> (It is not provided that these numbers stay constant, so use with care)
<x>x<y> (Coordinates where the screen starts, so 1280 will be fine to match the
	 screen right of the main screen if your main screen is 1280 pixels
	 width. However, 1281 will not match)
<x>
x<y>

Some examples follow:

 workspace 1 screen 0
 workspace 1 screen 1
 workspace 1 screen 1280x0
 workspace 2 screen 1280
 workspace 3 screen x0
 workspace 3 screen 1 www
 workspace 4 screen 0 mail
2009-08-08 19:51:51 +02:00
Michael Stapelberg 20875494ee Bugfix: Correctly unmap stack windows and don’t re-map them too early 2009-08-06 00:38:12 +02:00
Michael Stapelberg 5d14dca41d Implement correct rendering of floating windows (decoration color) 2009-08-05 19:59:58 +02:00
Michael Stapelberg 1befbb2a50 Use errx() instead of an own die() function 2009-07-28 14:03:50 +02:00
Michael Stapelberg 33e536113d Bugfix: Fix NULL-pointer dereferencing introduced by commit 874941 (Thanks tsdh) 2009-07-28 00:44:57 +02:00
Michael Stapelberg 163c9ad7db Map window/its decoration *after* calling render_layout()
Thus, no more flickering because the window was first mapped and then
moved. Especially users of multiple monitors should be happy now ;-).
Rather radical change, though, so be prepared for problems.
2009-07-25 22:29:28 +02:00
Michael Stapelberg 87494107b3 Bugfix: Correctly redecorate clients when changing focus (Thanks msi)
When moving your cursor from one tiling window to another tiling
window via a floating client, the old tiling window was not re-
decorated correctly
2009-07-21 15:49:08 +02:00
Michael Stapelberg 5b51c8c6f0 optimization: Render on pixmaps and copy the result on Stack_Wins
This should speed up the rendering of Stack_Wins with many window
decorations and it should considerably reduce flicker.
2009-07-17 18:32:40 +02:00
Michael Stapelberg eae0b18dbd Use better error messages for s* (Thanks Curtis) 2009-06-27 10:54:34 +02:00
Michael Stapelberg aa2f20ce26 Bugfix: Correctly handle floating windows when unmapping, fix focus bug when moving 2009-06-25 13:31:58 +02:00
Michael Stapelberg 81e9d8282a Bugfix: load current_col/current_row from workspace when setting focus (Thanks Mirko)
In the case of floating clients which have no container, the values
were still the ones from your old workspace, which was a problem if
your dimensions didn’t match…
2009-06-23 23:10:04 +02:00
Michael Stapelberg cba36914a8 Implement selecting the next tiling/floating window (using "focus")
Also update documentation (manpage, userguide).
To make the code easier to read/write when checking if a client is
floating, introduce client_is_floating().
2009-06-21 16:14:15 +02:00
Michael Stapelberg 83d3146b65 Bugfix: Correctly raise the currently focused client when going into stack mode 2009-06-20 00:31:57 +02:00
Michael Stapelberg d70ea03356 Remove some dead code, add default paths to switch() to make static analyzers happy
Check was done with scan-build from the LLVM suite. The remaining reports are false
positives and have been reported to llvm:

http://llvm.org/bugs/show_bug.cgi?id=4358
http://llvm.org/bugs/show_bug.cgi?id=4359
2009-06-10 19:59:36 +02:00
Michael Stapelberg 0cb5d7448d Implement clients going automatically into floating 2009-05-31 00:31:18 +02:00
Michael Stapelberg ac6561019b Don’t kill workspaces on which you currently are when changing screen configuration 2009-05-27 18:46:58 +02:00
Michael Stapelberg b58e2fa8ed Move toggle_fullscreen to client.c 2009-05-26 16:49:57 +02:00
Michael Stapelberg ac5c2fcf19 Bugfix: Fix fullscreen for floating clients, fix window name updates for floating clients 2009-05-26 16:46:50 +02:00
Michael Stapelberg 5b8e2ecb18 Implement floating (please test and find bugs)
Details which are missing: A command to hide/show all floating clients,
moving/resizing clients with your mouse holding Mod1 (click anywhere
in the client, not just on its borders), resize/move by keyboard, select
next/previous client by keyboard
2009-05-23 16:34:03 +02:00
Michael Stapelberg d5d44e66a2 Bugfix: Re-assign dock windows to different workspaces when a workspace is deleted
Killing a dock client and having destroyed workspace 1 before (or the workspace
on which the dock client was started when it was not auto-started) crashed i3 before
this bugfix.
2009-05-16 18:12:35 +02:00
Michael Stapelberg e79cca8f72 Implement putting clients onto specific workspaces ("assign" in the configfile)
This closes ticket #39
2009-05-16 17:32:36 +02:00
Michael Stapelberg 18da0a3017 Bugfix: Force reconfiguration of all windows on workspaces which needed to be re-assigned (Thanks Mirko)
When you disable a Xinerama screen (think of removing a video projector),
the workspaces of that screen need to be re-assigned to another screen.
Previously, the clients affected by this re-assignment did not get re-
configured, which made them appear on the next screen which got configured
at the position of the old one again if you did not switch to the reassigned
workspace before.

So, to reproduce it:
xrandr --output VGA --mode 1280x1024 --right-of LVDS
move windows to the new workspace
xrandr --output VGA --off
xrandr --output VGA --mode 1280x1024 --right-of LVDS

This fixes ticket #36
2009-05-09 13:04:34 +02:00
Michael Stapelberg 89076ea7cf Bugfix: Don’t raise clients in fullscreen mode, send correct position to clients in fullscreen mode (Thanks ch3ka, mist)
This fixes #38 which only happened for clients which actively tried
to reconfigure themselves.
2009-05-08 23:22:40 +02:00
Michael Stapelberg f72214725c Implement jumping to windows by matching their class / title 2009-05-05 16:53:22 +02:00
Michael Stapelberg c3c05db579 Bugfix: Fix crash on new clients (Thanks Mirko) 2009-05-03 22:18:33 +02:00
Michael Stapelberg d4642ac7d8 Fix a bug caused by not absolutely raising windows (revision 95f4085bc) 2009-05-03 16:41:53 +02:00
Michael Stapelberg 95f4085bcd Raise clients only relatively to the one which was focused before.
This should fix ticket #31.
2009-05-03 00:23:12 +02:00
Michael Stapelberg 982e453251 Don’t rely on libxcb-wm any longer, as it got removed in libxcb 0.3.4
See http://cgit.freedesktop.org/xcb/util/commit/?id=4c9a707f472e49bc3005354db265a0214071d46b
2009-04-19 20:44:34 +02:00
Michael Stapelberg 49d5bdbb08 Bugfix: Correctly adjust state when transferring fullscreen windows to other workspaces (Thanks Mirko)
This fixes ticket #27.
Furthermore, it is ensured that only one client at a time is in fullscreen mode.
2009-04-17 21:01:33 +02:00
Michael Stapelberg 36bacc151e Bugfix: Fullscreen configure notifies mustn’t use absolute position/size 2009-04-16 11:08:11 +02:00
Michael Stapelberg a2d20b6848 Bugfix: Send clients their absolute position/size in generated configure events, not relative
This fixes ticket #26.
2009-04-11 22:37:48 +02:00
Michael Stapelberg 8cc1fcf536 General small cleanups 2009-04-11 14:08:19 +02:00
Michael Stapelberg 28aa13d831 Bugfix: Don’t set focus if it is not necessary.
This fixes ticket #13
2009-04-01 12:50:42 +02:00
Michael Stapelberg 75a35319c9 Bugfix: Correctly remove client from container when moving to another workspace
This fixes ticket #16
2009-04-01 12:02:22 +02:00
Michael Stapelberg 0520714aa0 Remove comment as popup menus in dzen2 get triggered by enter notify and focus is not needed 2009-04-01 11:51:11 +02:00
Michael Stapelberg 9077831ed3 Bugfix: When entering a stack window with the mouse, set the focus to the active client
Fixes ticket #17
2009-03-26 23:00:26 +01:00
Michael Stapelberg cb9c7078be Implement kill-command to kill the current window, document it 2009-03-14 22:09:36 +01:00
Michael Stapelberg 80e2bf708d Send configure notify after putting a client into fullscreen mode, log at a central place 2009-03-14 17:37:11 +01:00
Michael Stapelberg 9c0d5b6e5e Bugfix: Redecorate the last focused window of the container we are switching into 2009-03-11 00:56:39 +01:00
Michael Stapelberg 38c8541807 Bugfix: Change the event mask to ignore enter notifies when rendering the layout and changing workspaces 2009-03-11 00:20:56 +01:00
Michael Stapelberg 408b2bdb39 Bugfix: Eliminate race condition, fix dock windows
There was a race condition when mapping a window and not setting the event mask
before. Therefore, the ReparentNotify and (more important) the UnmapNotify generated
by reparenting were not received, thus leaving the awaiting_useless_unmap variable
of the client "true". To just make it work, in previous commits the DestroyNotify
handler was introduced. Fortunately, with fixing this race condition by first
setting the event mask and mapping the window afterwards, we can remove this handler.

As for the dock windows, there were quite some occurences were client->container
was used without checking if the client is inside a container at all.

Furthermore, the client’s strut containing the space to reserve at the screen edge
is now checked and the desired height is set to the window’s height if the strut
contains 0 or if no strut was specified at all.
2009-03-10 20:56:25 +01:00
Michael Stapelberg 4e12c9b39c Fix the warning on SUS-compatible systems (char**) and on NetBSD (const char**) 2009-03-08 17:47:45 +01:00
Michael Stapelberg f85990b27a Fix warnings, update DEPENDS, update Makefile for NetBSD 2009-03-08 17:30:17 +01:00
Michael Stapelberg 6f630a3335 Implement UTF-8-clean window titles 2009-03-08 00:49:11 +01:00
Michael Stapelberg a411ed24cb Bugfix: Correctly check for empty containers and unmap the stack_win 2009-03-06 19:08:59 +01:00