Commit Graph

1338 Commits (a70e2057c827ae74f9405f11649e3a03ab7280b3)

Author SHA1 Message Date
Michael Stapelberg 797ba5f7c8 remove unnecessary close, because fclose already closes the file descriptor 2011-07-24 18:42:46 +02:00
Michael Stapelberg 34eb9b2664 ipc: make 'focused' a bool 2011-07-24 15:00:09 +02:00
Michael Stapelberg b09bb0fc2a ipc: make 'urgent' a bool 2011-07-24 14:54:30 +02:00
Michael Stapelberg 36fde6dbe1 ipc: send 'percent': null when percent is not relevant for the container 2011-07-24 14:47:28 +02:00
Michael Stapelberg a05a9f8dae Set some more atoms for _NET_SUPPORTED (Thanks lexszero) 2011-07-23 22:40:47 +02:00
Michael Stapelberg 3f7c7c2e38 remove left-over wordexp.h include 2011-07-23 22:37:41 +02:00
Michael Stapelberg ffe297f5e5 Bugfix: use the global root variable, don’t get the first one (Thanks quaec) 2011-07-23 22:29:01 +02:00
Michael Stapelberg fdd098b010 secure strscpy by replacing with strncpy 2011-07-23 22:22:36 +02:00
Michael Stapelberg 370715d1a8 Bugfix: Don’t leak file descriptor 2011-07-23 22:11:01 +02:00
Michael Stapelberg 062ce3ef03 Bugfix: Correctly resize when clicking on the border of a stacked con
Runs the same code as for non-stacked / non-tabbed containers, but on the
parent of the container (which is the stacked / tabbed con, since route_click
gets called with the child).
2011-07-23 21:48:14 +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 2d71102796 Bugfix: Switch to appropriate workspace when using 'focus' (+test) (Thanks rogutes)
Fixes #432
2011-07-14 23:45:36 +02:00
Michael Stapelberg 8c1a242f5f reload the config after editing it through i3-nagbar 2011-07-13 18:47:08 +02:00
Claudio Marforio cc24a96e96 patch to allow exec_always in configure file
fixed indentation, updated docs
2011-07-12 18:23:14 +02:00
Michael Stapelberg 5555c0fd3b Bugfix: Don’t raise the stacked/tabbed decoration when border != BS_NONE and children == 1 (Thanks smartass)
Otherwise a black area would cover the top of the child window.
2011-07-11 23:17:56 +02:00
Michael Stapelberg 06054642fe debug.c: remove handle_event 2011-07-11 18:21:25 +02:00
Michael Stapelberg 897b53f1c2 Bugfix: run nagbar commands through sh(1) (Thanks Tucos) 2011-07-11 16:51:57 +02:00
Michael Stapelberg 429d310011 nagbar: use less / vi as fallbacks for PAGER / EDITOR 2011-07-11 16:40:10 +02:00
Michael Stapelberg 05e39c1c48 Ignore X11 errors caused by ReparentWindow / ChangeProperty on already destroyed windows
These errors can happen because a DestroyWindow request by a client will
trigger an UnmapNotify, then a DestroyNotify. We cannot distinguish this
UnmapNotify from an UnmapNotify not followed by a DestroyNotify, so we just try
to send the ReparentWindow / ChangeProperty and ignore the errors, if any.
2011-07-10 23:44:13 +02:00
Michael Stapelberg 48f5166daf log: display time in microseconds when DEBUG_TIMING is set 2011-07-10 23:11:21 +02:00
Michael Stapelberg 937a80511a x: only configure window coordinates when height > 0
Fixes some X11 errors
2011-07-10 22:59:04 +02:00
Michael Stapelberg d9038cdb80 x: Only render / copy pixmap when the pixmap was actually created
Fixes some X11 errors
2011-07-10 22:58:49 +02:00
Michael Stapelberg 85d851de5f x: disable GraphicsExposure events on our pixmap graphics contexts
Gets rid of GraphicsExposure and NoExpose events, which we don’t use anyways.
2011-07-10 22:27:51 +02:00
Michael Stapelberg 78d25c4cd9 expose event handler: use x_deco_recurse 2011-07-10 22:06:16 +02:00
Michael Stapelberg 7d9ba707b3 x: Don’t pre-render the decoration for windows inside a stack which are not visible
Saves n-1 decoration renderings for n windows in a stack whenever a new window
gets added or removed.
2011-07-10 21:55:29 +02:00
Michael Stapelberg d7f9700ba4 x: use PolySegment instead of two PolyLine requests 2011-07-10 21:19:31 +02:00
Michael Stapelberg 8f4b95dccd x: change EnterNotify event mask only for mapped windows
Saves a few ChangeWindowAttributes requests.
2011-07-10 20:18:06 +02:00
Michael Stapelberg 37e0cf8346 x: copy the pre-rendered pixmap contents to a decoration window immediately after mapping
Reduces flickering.
2011-07-10 20:15:22 +02:00
Michael Stapelberg afef42a4ac x: set the contents of a decoration window immediately after changing its size
Reduces flickering. A window loses its contents when being resized, so we have
to restore them as fast as possible.
2011-07-10 20:08:40 +02:00
Michael Stapelberg 517833569d x: raise the stack decoration above the stack windows (reduces flickering)
This reduces flickering when opening new windows in a stack, see the comment.
2011-07-10 20:05:49 +02:00
Michael Stapelberg 0d8dd571f8 x: when rendering stacked/tabbed cons, only update decoration once, saves some CopyAreas 2011-07-10 20:01:29 +02:00
Michael Stapelberg 8be26c9a22 x: Don’t set background color on frame windows, reduces flickering 2011-07-10 19:58:46 +02:00
Michael Stapelberg 64cfb2dbb1 Revert "x: Set pixmap as background window, saves a lot of CopyAreas"
This reverts commit 84b804cda6.
Turns out that it triggered graphic corruptions on ATI graphics cards (Thanks
aniou) with certain drivers.
2011-07-10 16:22:09 +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 0add563448 Bugfix: multiple criteria should use a logical AND (+test) (Thanks f8l) 2011-07-08 00:21:29 +02:00
Michael Stapelberg 0ca229ceb3 migrate-config: also make force_focus_wrapping a v4-only statement 2011-07-08 00:17:48 +02:00
Michael Stapelberg ac335fcffa Automatically call the migration script when the config does not look like v4 2011-07-06 20:43:00 +02:00
Michael Stapelberg c408fef021 Implement 'focus floating', 'focus tiling' and 'focus mode_toggle' (+test +docs) 2011-07-04 17:09:52 +02:00
Michael Stapelberg 71741d7620 Bugfix: Only set ENTER_WINDOW event mask for mapped windows (fixes focus problems)
Fixes focus problems when switching to empty workspaces or when going in/out of
fullscreen.
2011-07-04 13:41:02 +02:00
Michael Stapelberg 23d4917e43 Bugfix: Correctly revert floating focus when killing the last floating window (+test) 2011-07-01 01:10:43 +02:00
Michael Stapelberg e5c811248f Bugfix: Fix floating assignments, extend test for the assign command (Thanks Tucos) 2011-06-13 17:42:59 +02:00
Michael Stapelberg d641e1da3b Don’t force wrapping when focusing in a direction would work (+test)
Think of the following layout:

 -------------
 | tab |     |
 | con | win |
 |     |     |
 -------------

The tabbed container on the left has two children. Assume you have focused the
second/right child in the tabbed container. i3 used to focus the first/left
container of the tabbed container when using 'focus right' (it wrapped focus).

With this commit, the default behaviour is to instead focus the window on the
right of the screen.

The intention is to make focus switching more intuitive, especially with tabbed
containers supporting 'focus left'/'focus right' in tree. You should end up
using less 'focus parent' :).

You can force the old behaviour with 'force_focus_wrapping true' in your
config.

Code coverage is 62.5% with this commit.
2011-06-12 12:56:50 +02:00
Michael Stapelberg b35ff6a7c9 Bugfix: Correctly attach new output cons to the root con (Thanks mseed) 2011-06-11 14:36:09 +02:00
Michael Stapelberg fb9d77305e Implement 'fullscreen global' 2011-06-10 18:27:20 +02:00
Michael Stapelberg bef25d72aa Implement 'border toggle' (+test) 2011-06-10 16:15:52 +02:00
Michael Stapelberg 60ae26c19d Implement 'workspace next/prev' (+test) 2011-06-10 16:03:59 +02:00
Michael Stapelberg 39b1c1bf75 Re-implement the 'mode' command 2011-06-10 02:38:07 +02:00
Michael Stapelberg df0b7bed48 cmdparse: s/direction/split_direction to be more clear 2011-06-10 02:25:14 +02:00
Michael Stapelberg f1385ba3d5 CONFIG BREAK: Rename 'restore' to 'append_layout' 2011-06-10 02:15:31 +02:00
Michael Stapelberg bd49c80d5f CONFIG BREAK: rename 'mode floating/tiling' to 'floating enable/disable'
The three different variants now:
   floating enable
   floating disable
   floating toggle
2011-06-10 02:06:47 +02:00
Michael Stapelberg 9bbb37bb55 BREAKS CONFIG: rename 'level up' to 'focus parent'
…and 'level down' to 'focus child'. More intuitive than the old command names.
2011-06-10 01:36:33 +02:00
Michael Stapelberg 9aa7e5fbd6 Parse multiple criteria in commands (+test), better error message for 'focus' 2011-06-08 23:34:08 +02:00
Michael Stapelberg d68e4710fe CONFIG BREAK: kick the 'next'/'prev' commands, introduce 'focus left' etc.
Instead of the cryptic next/prev commands, we now provide an argument to the
focus command. Userguide and default config is updated.
2011-06-08 20:49:49 +02:00
Michael Stapelberg 58e02e84e2 Bugfix: Don’t break focus stack when inplace restarting with fullscreen windows (Thanks mike) 2011-06-03 01:48:55 +02:00
Michael Stapelberg 1585d942ea Make workspace_layout handle all cons at workspace level, not only the first one (+test)
This makes opening new windows on workspace level and moving windows to the
right/left more like in the old i3.
2011-06-02 17:21:38 +02:00
Michael Stapelberg 51bfdbf0a8 ipc: make 'layout' a string 2011-06-02 17:12:18 +02:00
Michael Stapelberg 97e45b9cfc Bugfix: RandR: Correctly assign focused workspaces to outputs
Fixes: #399
2011-05-29 14:39:41 +02:00
Michael Stapelberg 1fc15d270e Bugfix: rendering cache also needs to consider con->pixmap_recreated for borders 2011-05-29 13:20:41 +02:00
Michael Stapelberg 18ec15b0f9 x: fix race condition where the new event mask was not set directly after reparenting 2011-05-29 13:20:41 +02:00
Michael Stapelberg 8acea3d34c call tree_render() only after commands which require it
Saves one call of tree_render for exec, for example
2011-05-29 13:20:34 +02:00
Michael Stapelberg 446c9b7313 Bugfix: Set pixmap_recreated before rendering the decoration 2011-05-29 12:20:09 +02:00
Michael Stapelberg f680c8841f x: only re-render the tree in handle_normal_hints when they actually changed 2011-05-29 11:46:01 +02:00
Michael Stapelberg b49874dcb8 x: first create/render pixmap, then change window sizes (reduces flickering for new windows)
Especially in stacked cons.
2011-05-29 11:31:22 +02:00
Michael Stapelberg 7ae0c9c973 Bugfix: Check swallows before assignments when managing windows (Thanks julien)
Fixes #395 (empty containers on restart when assigned windows are visible)
2011-05-25 21:00:53 +02:00
Michael Stapelberg 7208d01048 remove unused code from manage.c 2011-05-25 20:47:47 +02:00
Michael Stapelberg 2c68c234ea Implement assignments for (named) workspaces, with '~' compatibility (floating) 2011-05-23 18:41:17 +02:00
Michael Stapelberg 272a86745e Bugfix: Free pixmaps when killing windows (Thanks Mike) 2011-05-22 23:32:59 +02:00
Michael Stapelberg 4c1392d8ab retab! cfgparse.l 2011-05-22 22:15:43 +02:00
Michael Stapelberg c23f3b45fc cfgparse.l: kill a few states by using the stack 2011-05-22 22:08:40 +02:00
Michael Stapelberg 1d6447187c cleanup cfgparse lexer/parser (ignore whitespace, solves conflicts) 2011-05-22 21:48:25 +02:00
Michael Stapelberg e27a8597d8 forgot to remove unused TOK_ATTACH token from lexer 2011-05-22 21:42:34 +02:00
Michael Stapelberg 08f64f011d cleanup cmdparse lexer/parser (ignore whitespace, solves conflicts) 2011-05-22 21:26:50 +02:00
Michael Stapelberg 03cc490f0e Bugfix: fix crash when disabling floating mode 2011-05-16 20:51:29 +02:00
Michael Stapelberg 5ae4620a24 Time Lord technology: for_window config directive to run arbitrary cmds
An example to set all XTerms floating:
    for_window [class="XTerm"] mode floating

To make all urxvts use a 1-pixel border:
    for_window [class="urxvt"] border 1pixel

A less useful, but rather funny example:
    for_window [title="x200: ~/work"] mode floating

The commands are not completely arbitrary. The commands above were tested,
others may need some fixing. Internally, windows are compared against your
criteria (class, title, …) when they are initially managed and whenever one of
the relevant values change. Then, the specified command is run *once* (per
window). It gets prefixed with a criteria to make it match only the specific
window that triggered it. So, if you configure "mode floating", i3 runs
something like '[id="8393923"] mode floating'.
2011-05-15 20:10:25 +02:00
Michael Stapelberg ca2e4199b5 Introduce HANDLE_EMPTY_MATCH macro to simplify command handlers in cmdparse.y 2011-05-15 19:43:35 +02:00
Michael Stapelberg d3e458bc78 Remove old code from randr.c and workspace.c 2011-05-14 22:38:19 +02:00
Michael Stapelberg 5db97dc473 Bugfix: Fix initialization / assignments when RandR is missing 2011-05-14 22:34:34 +02:00
Michael Stapelberg 3f45d3c447 re-implement assignments of workspace to specific outputs 2011-05-14 22:19:58 +02:00
Michael Stapelberg 443753bea6 x.c: disable some of the debug output 2011-05-14 20:04:34 +02:00
Michael Stapelberg 0bfab98a7f Correctly re-implement scrolling on window decorations
Got lost when refactoring the click handling in 24463718cc

Fixes: #390
2011-05-13 21:58:17 +02:00
Michael Stapelberg aea445b690 Bugfix: Attach new cons at the correct place when a floating con is focused (+test) (Thanks fernandotcl)
New containers were previously attached directly to the workspace instead of to
the previously focused place in the workspace (for example a stacked con).

Fixes: #376
2011-05-13 21:30:37 +02:00
Michael Stapelberg 3d2cd6abaa Fix kill command with trailing whitespace 2011-05-13 21:18:20 +02:00
Michael Stapelberg 167bdd26b7 Argument for 'kill' for killing a specific window (now default) or the whole client (+test)
Use 'kill window' to kill a specific window (for example only one specific
popup), use 'kill client' to kill the whole application (or X11 connection to
be specific).
2011-05-13 20:41:03 +02:00
Michael Stapelberg 44c2555e67 Bugfix: When focusing the next floating window, descend the CT_FLOATING_CON
makes t/35-floating-focus.t pass again
2011-05-13 19:53:19 +02:00
Michael Stapelberg 836a3ad615 Bugfix: set WM_STATE to WITHDRAWN when an app unmaps their window(s) (+test)
Fixes: #362
2011-05-13 17:04:55 +02:00
Michael Stapelberg 62e977102b Bugfix: Fix the WANT_QSTRING state 2011-05-13 17:03:15 +02:00
Michael Stapelberg b0e871e0cf Bugfix: Fix focus follows mouse for non-default layout cons (Thanks phnom)
Fixes: #361
2011-05-12 22:24:52 +02:00
Michael Stapelberg 6e32e6123d Bugfix: Ignore focus when attaching cons while restoring the layout
Fixes: #369
2011-05-12 07:22:17 +02:00
Michael Stapelberg 94646190aa Bugfix: Correct string/quoted string parsing for the commands exec, workspace, nop, restore and mark (Thanks SardemFF7)
Fixes: #380
2011-05-12 07:09:06 +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 c62f70856f Bugfix: Don’t crash when dock clients set the urgency hint (+testcase) 2011-05-11 22:45:20 +02:00
Michael Stapelberg 4be3178d4d Bugfix: Don’t fill split cons etc. with client background color (fixes nested decoration rendering)
Fixes: #359
2011-05-11 22:01:09 +02:00
Michael Stapelberg 4da6fc7ba3 Bugfix: Restore border_style when restarting inplace (Thanks aniou)
Fixes #385.
2011-05-11 20:45:56 +02:00
Michael Stapelberg 9c05c18156 ipc: change border_style to human-readable string instead of enum value 2011-05-11 20:39:18 +02:00
Michael Stapelberg eb8ad348b2 Bugfix: Don’t run into an endless loop when killing con with children (Thanks mseed)
When a tabbed container had more than one child and at least the first one
supported WM_DELETE, i3 entered an endless loop when killing that tabbed
container. This was due to tree_close only sending WM_DELETE without actually
removing the child, while the loop in tree_close assumed that with every call
of tree_close one child would be removed.
2011-05-11 20:22:47 +02:00
Michael Stapelberg e73c171e0d Bugfix: assign BORDER_BOTTOM instead of BORDER_RIGHT (Thanks Jan) 2011-05-06 13:09:50 +02:00
Michael Stapelberg 1fe5c58764 cfgparse.y: define types (Thanks Merovius) 2011-05-05 21:58:28 +02:00
Michael Stapelberg bd73275771 re-indent cfgparse.y 2011-05-05 21:19:47 +02:00
Michael Stapelberg a075fd4ee2 cmdparse.y: set type on the tokens/non-terminals (Thanks Merovius) 2011-05-05 20:39:05 +02:00
Michael Stapelberg 3d1acd6c2f re-implement assigning windows to workspaces 2011-05-02 23:29:26 +02:00
Michael Stapelberg 7e51f626ef Bugfix: Before rendering, attach the con to its floating_con
Otherwise, the rendering will produce negative coordinates.
2011-05-02 11:06:13 +02:00
Michael Stapelberg b2754fd679 Bugfix: When re-assigning floating windows to a different output, use the last focused workspace, not the first 2011-05-02 11:05:50 +02:00
Michael Stapelberg 79323a0be0 Bugfix: Fix the client background rectangle calculation (Thanks Mike)
Really fixes #364.
2011-05-01 22:27:06 +02:00
Michael Stapelberg b401e08a5d Bugfix: For fullscreen cons, use a deco_height of 0 to correctly render the background color
This should fix #364.
2011-05-01 19:46:41 +02:00
Michael Stapelberg d28008aa63 Bugfix: Correctly render decorations in tabbed containers (don’t overlap)
This fixes a regression introduced in b644fb5f26.
2011-05-01 18:48:30 +02:00
Michael Stapelberg 8b21812bbd Bugfix: Add missing tree_render() when handling the urgency hint (Thanks mxf) 2011-04-30 00:37:03 +02:00
Michael Stapelberg a149283964 Fix unaligned memory access on sparc (Thanks David Coppa) 2011-04-28 21:44:29 +02:00
Michael Stapelberg 2c6508a6a3 remove useless checks, size_t != ssize_t :) 2011-04-28 20:24:16 +02:00
Michael Stapelberg 528f486eee Make code compatible with yajl 2.0 *and* 1.0 2011-04-27 19:52:53 +02:00
Michael Stapelberg 28b9ed6eb3 Bugfix: Ensure that all outputs have a ->con before handling disabled outputs (Thanks JimdiGriz)
Steps to reproduce:
• xrandr --output VGA1 --auto
• xrandr --output LVDS1 --off
2011-04-27 10:18:46 +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 3721bcb868 Bugfix: Ignore EnterNotifies generated by UnmapNotifies
Actually, commit 1c5adc6c35 commented out code
without ever fixing it. I think this was responsible for the 'workspace
switching sometimes does not work' bug. My observations:

Had it again today and analyzed a log of it. Looks like after unmapping the
windows on one workspace (in my case: chromium, eclipse, urxvt, focus on
eclipse) we get UnmapNotify events for chromium and eclipse, but then we get an
EnterNotify for the terminal (due to unmapping the other windows and therefore
mapping the terminal under the cursor), only afterwards the UnmapNotify
follows.

So, there are two things wrong with that:

• We handle EnterNotifys for unmapped windows

• Unmapping windows sometimes works in a sequence, sometimes the sequence gets
  split. Not sure why (if unmapping can take longer for some windows or if our
  syncing is wrong -- but i checked the latter briefly and it looks correct).
  Maybe GrabServer helps?

• We don’t ignore EnterNotify events caused by UnmapNotifies. We used to, but
  then there was a different problem and we decided to solve the EnterNotify
  problem in another way, which actually never happened (commit
  1c5adc6c35).
2011-04-19 21:50:56 +02:00
Sardem FF7 cd6f93be3f Rename bind to bindcode
Also fallback when using just 'bind' to be backward-compatible
2011-04-18 23:52:45 +02:00
Michael Stapelberg 84b804cda6 x: Set pixmap as background window, saves a lot of CopyAreas 2011-04-18 21:10:50 +02:00
Michael Stapelberg 3d5af35fa4 Bugfix: Center floating windows with invalid coordinates on current ws 2011-04-18 19:36:10 +02:00
Michael Stapelberg f613df48d2 Bugfix: Check if a floating window’s coordinates are within a different workspace when managing (Thanks Merovius)
Fixes: #297
2011-04-18 19:28:03 +02:00
Michael Stapelberg 60532a90e7 Bugfix: Assign floating cons to correct workspace when moving between monitors (Thanks dothebart)
Fixes: #371
2011-04-18 18:44:39 +02:00
Michael Stapelberg 36583ec6ee Bugfix: When moving floating cons to other workspaces, attach them to the workspace 2011-04-18 18:44:18 +02:00
Michael Stapelberg 02acf426d3 Bugfix: Don’t set the layout when it’s default layout anyways
Fixes some nasty side-effects
2011-04-02 22:08:38 +02:00
Michael Stapelberg c3b4006f6b Rename new_container to workspace_layout 2011-04-02 21:49:35 +02:00
Simon Kampe 650eebc347 Implemented config key 'new_container' 2011-04-02 21:43:49 +02:00
Michael Stapelberg 21c7a69812 optimization: when moving floating windows, render/push only the floatingcon 2011-04-01 22:40:12 +02:00
Michael Stapelberg d8bf633e56 Bugfix: Flush the Xlib connection after creating cursors
Fixes a race condition where the cursors were created after we were already
using them.
2011-04-01 21:57:08 +02:00
Michael Stapelberg 26635a7595 x: skip creating pixmaps when the rect is actually invisible
This fixes a few X11 errors.
2011-04-01 21:54:45 +02:00
Michael Stapelberg 6419e42f6d bugfix: fix race condition where window titles were not correctly updated
Fixes: #351
2011-04-01 21:39:58 +02:00
Michael Stapelberg 57447112ba x: skip x_draw_decoration when con is not mapped
This commit makes workspace switching completely free of cache misses, so
decorations are not re-rendered when switching workspaces.
2011-04-01 20:41:08 +02:00
Michael Stapelberg b644fb5f26 x: recurse x_push_node in focus order. reduces flickering when switching workspaces 2011-04-01 20:40:32 +02:00
Michael Stapelberg 20b1fd4293 Skip FocusIn events with mode == NOTIFY_MODE_GRAB or NOTIFY_MODE_UNGRAB
According to the Xlib Programming Manual section 10.7.2 [1], these events are
generated when keyboard grabs activate/deactivate, while we are only interested
in focus changes which are done by other programs independend from the
keyboard.

[1] http://tronche.com/gui/x/xlib/events/input-focus/grab.html
2011-03-30 23:00:48 +02:00
Michael Stapelberg 4fd4e619ec little coding style fixes, fix compilation warning 2011-03-21 23:54:13 +01:00
Fernando Tarlá Cardoso Lemos f0f7cb7478 If the socket path isn't specified, write it to /tmp. 2011-03-21 23:49:39 +01:00
Michael Stapelberg 39ee97fd82 FREE() already nulls the pointer 2011-03-21 23:49:16 +01:00
Fernando Tarlá Cardoso Lemos 6d8784af98 Set the I3_SOCKET_PATH atom to the expanded path. 2011-03-21 23:46:03 +01:00
Michael Stapelberg 99ce340fea Focus cons when moving to a visible workspace on a different output (Thanks mseed)
Fixes: #355
2011-03-20 19:32:00 +01:00
Michael Stapelberg 67b37551d8 Bugfix: Fix switching workspaces on multi-monitor setups (Thanks mseed)
Fixes #356
2011-03-20 18:27:14 +01:00
Michael Stapelberg 38173749f8 Bugfix: Also invalidate caches of the following cons in a split con on cache miss (Thanks fernandotcl) 2011-03-20 18:17:18 +01:00
Michael Stapelberg b3ee50b184 Bugfix: Also update pixmaps when the position of the deco_rect has changed (Thanks fernandotcl) 2011-03-20 18:07:07 +01:00
Michael Stapelberg e913e519f2 refactor handlers.{c,h}: declare the handlers static, remove unnecessary parameters 2011-03-20 16:53:12 +01:00
Michael Stapelberg c130cefa93 Handle FocusIn events generated by clients and update decoration accordingly (Thanks mseed) 2011-03-20 16:26:36 +01:00
Michael Stapelberg 144deaaaf6 Remove debugging syncs 2011-03-20 14:29:48 +01:00
Michael Stapelberg b25477b15e Re-implement rendering to pixmaps (double-buffering) and caching decorations 2011-03-20 14:25:09 +01:00
Michael Stapelberg e835888a9e Bugfix: Actually re-attach dock clients when outputs get disabled (Thanks phnom)
Fixes: #348
2011-03-20 01:07:21 +01:00
Michael Stapelberg e9a9a46795 Bugfix: Don’t use the workspace where focus is for deleting workspaces when switching (Thanks mseed)
Fixes: #353
2011-03-19 23:19:42 +01:00
Michael Stapelberg 03ea7cea28 Bugfix: also invalidate focused_id when the to_focus window is not mapped
This fixes a bug where focus might not be set correctly when changing workspaces
2011-03-19 22:54:53 +01:00
Michael Stapelberg b342d387a8 Handle saved_configpath in get_config_path, fix memleak in current_configpath handling, update atoms after reloading (Thanks fernandotcl) 2011-03-19 22:26:15 +01:00
Michael Stapelberg 626c65b0d8 Bugfix: correctly store the config path for using it for I3_CONFIG_PATH later 2011-03-19 21:50:13 +01:00
Michael Stapelberg 9344b9790c Bugfix: fix null-pointer dereference when IPC is disabled (Thanks Merovius) 2011-03-19 21:37:27 +01:00
Michael Stapelberg 65a3259b3c Set the I3_SOCKET_PATH and I3_CONFIG_PATH atoms on the X11 root window 2011-03-19 21:20:38 +01:00
Michael Stapelberg 8b9aedd2bf Bugfix: When there’s nothing to focus, focus the root window (Thanks fernandotcl, ThePub) 2011-03-19 20:43:06 +01:00
Michael Stapelberg fd7e4b08f3 rendering: correctly draw background rect (Thanks phnom)
Fixes #347
2011-03-18 20:47:59 +01:00
Michael Stapelberg 3282bb4069 remove obsolete comment 2011-03-18 17:08:48 +01:00
Michael Stapelberg 82e286ed7c Only send WM_TAKE_FOCUS when the client supports it in the protocols atom
Fixes opening xterm, for example
2011-03-18 17:07:56 +01:00
Michael Stapelberg 0639a7d95b Make i3 compatible with the very latest xcb
This involves:
 • Compiling with xcb-util instead of xcb-{atom,aux} (they merged the libraries)
 • Not using xcb-{event,property} anymore (code removed upstream)
 • Not using the predefined WINDOW, CARDINEL, … atoms (removed upstream)
 • Using the new xcb_icccm_* data types/functions instead of just xcb_*
   (for example xcb_icccm_get_wm_hints instead of xcb_get_wm_hints)

Also I refactored the atoms to use x-macros.
2011-03-18 14:39:27 +01:00
Michael Stapelberg 36664c6289 Send WM_TAKE_FOCUS to clients when setting focus (fixes java swing problems) 2011-03-17 22:27:59 +01:00
Michael Stapelberg 65b05169d3 change the config parser to use default_orientation instead of new_container_orientation
It’s a shorter and probably more meaningful description as it is not
immediately clear what a container exactly is when first installing i3.
2011-03-17 17:55:53 +01:00
Michael Stapelberg eeb5bdd66f cleanup code of workspace rotation on output changes 2011-03-17 17:53:56 +01:00
Simon Kampe 2f992f5c0e Added config key for default orientation of containers (new_container_orientation) and added support in randr.c for automatically changing the orientation when user does a xrandr rotate. 2011-03-17 17:43:35 +01:00
Michael Stapelberg b484ed5f9d When making floating cons tiling, re-insert next to the next focused *tiling* con (Thanks mseed)
Fixes: #337 and #350
2011-03-14 23:50:29 +01:00
Michael Stapelberg 76e978bfb3 fix small warnings when compiling with DEBUG=0 2011-03-14 23:17:52 +01:00
Michael Stapelberg 7100d32971 cmdparse: correctly parse con_id/id (fixes warning) 2011-03-14 23:14:40 +01:00
Michael Stapelberg b21137b2c0 cmdparse: expect 4 shift/reduce conflicts 2011-03-14 23:08:33 +01:00
Michael Stapelberg f900fab453 cmdparse: don’t allow empty operations 2011-03-14 23:03:25 +01:00
Michael Stapelberg 627683c053 cmdparse: don’t allow empty commands 2011-03-14 23:03:13 +01:00
Michael Stapelberg 8928823e07 remove usless 'operation' token, already handled by 'operation optwhitespace' 2011-03-14 22:29:07 +01:00
Michael Stapelberg 18215445f8 remove unused current_bindings (left-over from cfgparse.y) 2011-03-14 22:28:55 +01:00
Michael Stapelberg 89ef41dadf re-implement support for MappingNotifys 2011-03-14 17:20:04 +01:00
Michael Stapelberg 01365edb30 ewmh: bump copyright 2011-03-14 17:15:18 +01:00
Michael Stapelberg fb9978b975 ewmh: add comment to describe why we count 2011-03-14 17:15:04 +01:00
Fernando Tarlá Cardoso Lemos c0563af3e2 Bring back some more EWMH support. 2011-03-14 17:11:33 +01:00
Fernando Tarlá Cardoso Lemos b4e3dfd76b Add the "created" parameter to workspace_get.
If created is not NULL, *created is set to whether or not the
workspace has been just created.
2011-03-14 17:07:53 +01:00
Fernando Tarlá Cardoso Lemos b8a716c370 Reload the same config file specified in the command line.
Fixes: #346
2011-03-14 16:48:45 +01:00
Michael Stapelberg cdeb49127f Bugfix: restore focus to the correct window when a non-focused window gets destroyed (+testcase) 2011-03-14 16:34:35 +01:00
Michael Stapelberg f162e7efaa refactor font caching to just save the ID instead of mainting a cache with pattern→id-mapping 2011-03-10 23:20:17 +01:00
Simon Kampe 6e4a2b0b96 Fallback fonts for when requesting a erronous font with load_font (e.g. user have specified a font which does not exist in the config file). 2011-03-10 21:46:31 +01:00
Michael Stapelberg 86637d2e07 Bugfix: Make level up a noop during fullscreen mode (+testcase) (Thanks dothebart)
Fixes #341
2011-03-09 18:37:05 +01:00
Michael Stapelberg 74b90cd83f Bugfix: Send WM_DELETE / kill window the right way (Thanks dothebart)
Fixes #336
2011-03-09 18:08:26 +01:00
Michael Stapelberg 0a24057241 When leaving fullscreen, set focus to con which was opened during fullscreen (+testcase) (Thanks dothebart) 2011-03-07 00:06:27 +01:00
Michael Stapelberg 287d7f9527 Bugfix: Don’t focus new cons when there is a fullscreen con (Thanks dothebart)
Also, remove the focus_it parameter from tree_open_con, it makes more sense to
call con_focus outside of the function.
2011-03-06 23:26:02 +01:00
Michael Stapelberg 8ce5f2a21b Bugfix: Fix crash with transient dock clients caused by 7154fecbb 2011-03-06 22:02:02 +01:00
Michael Stapelberg c17b3b7560 remove left-over xcb_aux_sync (debugging code) 2011-03-06 21:56:15 +01:00
Michael Stapelberg b0b195318c rendering: bugfix: stack child windows of stacked/tabbed cons according to their focus
fixes focusing the wrong window after closing a con
2011-03-06 21:49:17 +01:00
Michael Stapelberg 4f26316aaa x: disable all events while re-stacking windows, prevents unwanted EnterNotifys 2011-03-06 21:48:49 +01:00
Michael Stapelberg 0689f6d8f1 Bugfix: use tree_render() instead of x_push_changes() to re-render and update the stack 2011-03-06 20:45:03 +01:00
Michael Stapelberg 7154fecbbf Implement the popup_during_fullscreen option, set default to leave_fullscreen
Fixes #333
2011-03-06 15:46:06 +01:00
Michael Stapelberg 51ff0f80a6 Obey minimum size when resizing floating windows
Fixes #285
2011-03-06 14:15:46 +01:00
Michael Stapelberg 1891a385ad Bugfix: also stop searching for resize cons when reaching a floatingcon (Thanks julien) 2011-03-06 13:35:07 +01:00
Michael Stapelberg 4514146ed9 Use the combined geometry of children when setting a split container to floating (+testcase) (Thanks mseed)
Fixes #332
2011-03-06 02:39:15 +01:00
Michael Stapelberg 88ab66e742 Bugfix: don’t focus dock clients with new click handling code (Thanks mseed) 2011-03-06 02:06:05 +01:00
Michael Stapelberg 24463718cc refactor the click handling completely
Also re-implements floating modifier on tiling cons.

Fixes: #288 and a lot of headache :)
2011-03-05 20:23:29 +01:00
Michael Stapelberg 0a2ee1d2aa Bugfix: Focus workspace after closing one of multiple dock clients (+testcase) (Thanks mseed) 2011-03-04 15:21:18 +01:00
Michael Stapelberg f6a21994bf Re-implement focus follows mouse for outputs
That is, moving your mouse pointer to a different workspace which does not have
any windows on it yet will correctly update the focus.
2011-03-03 16:36:18 +01:00
Michael Stapelberg caa1ac1a9f Use the original geometry for floating windows 2011-03-03 16:22:22 +01:00
Michael Stapelberg b484b9ab32 Don’t create floating containers from whole workspaces when they are empty (Thanks mseed)
This fixes #327
2011-03-03 14:55:02 +01:00
Michael Stapelberg a038d2674b Bugfix: 'level up' needs to stop at the workspace con + testcase (Thanks mseed) 2011-03-03 14:30:13 +01:00
Michael Stapelberg 62362a464d fix invalid memory access in xcb_reply_contains_atom (Thanks ys) 2011-03-03 14:14:35 +01:00
Michael Stapelberg 77640da9e7 Bugfix: don’t focus the dockarea when closing a dock client 2011-03-03 14:03:06 +01:00
Michael Stapelberg e0647b7fc2 Bugfix: don’t focus dock clients (Thanks mseed, mist)
Fixes #321 and #323
2011-03-03 13:59:42 +01:00
Michael Stapelberg 33c2b4e582 Bugfix: Correctly fix the percent values for resizing when making a floating con tiling (Thanks mseed) (+testcase) 2011-02-28 23:59:56 +01:00
Michael Stapelberg b595ff05c5 Fix regression: Don’t add floating nodes twice when restoring layout (+testcase) 2011-02-28 20:44:23 +01:00
Michael Stapelberg d80105103c Bugfix: Re-attach floating cons to the right container (Thanks mseed)
This fixes #315.
2011-02-28 17:23:50 +01:00
Fernando Tarlá Cardoso Lemos beaa85ceb9 Don't leak this descriptor (thanks dothebart).
Note that fclose closes the file descriptor frees the stream.
2011-02-28 16:49:10 +01:00
Fernando Tarlá Cardoso Lemos 269d360f30 Some assertions to make the static analyzer happy.
Assertions give hints to the static analyzer about code paths
where we make assumptions. Used the Clang Static Analyzer.
2011-02-28 16:49:03 +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
Michael Stapelberg ffc71859a3 Implement support for top/bottom dock clients (according to _NET_WM_STRUT_PARTIAL or requested position) 2011-02-21 14:27:32 +01:00
Michael Stapelberg b6f81fe43c Bugfix: restore the original width/height with X11 border when restarting (Thanks Merovius) 2011-02-21 03:13:27 +01:00
Michael Stapelberg f34b045619 Fix dock client handling for inplace restarts 2011-02-21 03:01:55 +01:00
Michael Stapelberg 3dfe5c8a9a bugfix: fix clicking on dock clients (Thanks mseed) 2011-02-21 01:58:57 +01:00
Michael Stapelberg 9719b21243 refactor some places to use output_get_content() 2011-02-21 01:55:36 +01:00
Michael Stapelberg a92b9dca73 Bugfix: fix disabling RandR outputs 2011-02-21 01:43:39 +01:00
Michael Stapelberg 35e79c87c8 Place dock clients on the output corresponding to their geometry request 2011-02-21 01:28:29 +01:00
Michael Stapelberg a33d869885 Bugfix: Correctly open workspaces on additional outputs 2011-02-21 01:12:22 +01:00
Michael Stapelberg 6b272fea55 Bugfix: in get_workspaces, only consider the CT_CON, not the CT_DOCKAREAs (Thanks fernandotcl) 2011-02-21 00:54:29 +01:00
Michael Stapelberg 272ab840c7 Fix fullscreen mode with dock clients 2011-02-21 00:40:35 +01:00
Michael Stapelberg 9a0bc77baf bugfix: dock clients cannot be floating 2011-02-21 00:23:07 +01:00
Michael Stapelberg 7f89c71689 Implement dock mode, update testsuite
Currently, dock clients are only possible at the top.
2011-02-20 23:43:03 +01:00
Michael Stapelberg c5ab16c00d same fix, but for moving (search above the current con when moving is not possible in this direction) 2011-02-19 20:11:47 +01:00
Michael Stapelberg 86500c5b88 Skip containers which got only one child when looking for the next/previous one to focus 2011-02-19 19:50:09 +01:00
Michael Stapelberg 6a6746b967 revert the replacement of a single h/v-split with its child container
Makes more problems than it creates. Will use a different fix suggested by
Merovius.
2011-02-19 18:30:26 +01:00
Michael Stapelberg 53d9072ca7 implement TAILQ_SWAP (only for consecutive elements, order relevant) and use it 2011-02-15 02:21:23 +01:00
Michael Stapelberg 834f4d7bc2 add missing function documentation 2011-02-14 23:17:30 +01:00
Michael Stapelberg 26a416e016 refactor tree_move() into src/move.c, change config (!), change testcase
Due to lots of cases which were added and added to tree_move(), the function
was not really easy to understand. For this refactoring, I wrote tree_move()
from scratch, thinking about (hopefully) all cases. The testsuite still passes.

The move command also has different parameters now. Instead of the hard to
understand 'before v' stuff, we use 'move [left|right|up|down]'.
2011-02-14 23:05:20 +01:00
Michael Stapelberg 28dd226259 refactor code for removing children from a con
Let’s see how this callback stuff will work out. If it doesn’t work out well,
we will remove it.
2011-02-14 18:08:36 +01:00
Michael Stapelberg a5e075c154 Automatically close empty parent cons when making their last child floating (Thanks mseed)
This fixes #313
2011-02-14 16:43:41 +01:00
Michael Stapelberg b800555161 Bugfix: check ->layout, not ->type for L_STACKED 2011-02-14 16:35:48 +01:00
Michael Stapelberg 305eac0e71 Bugfix: Correctly check asprintf() return value 2011-02-14 16:33:42 +01:00
Fernando Tarlá Cardoso Lemos 9cf48f17bb Fix libxcursor -> xcb cursors fallback. 2011-02-06 17:47:28 +01:00
Michael Stapelberg 07381ccb7b fix a rendering problem for split cons inside tabbed cons (Thanks julien)
This fixes #280.
2011-02-02 17:56:29 +01:00
Michael Stapelberg 4d0106b00f bugfix: don’t crash when moving windows out of a floating con (Thanks mseed) 2011-02-01 17:53:15 +01:00
Michael Stapelberg d855bea215 Bugfix: Correctly focus con when moving to another workspace (Thanks mseed)
This fixes #310.
2011-02-01 17:17:50 +01:00
Michael Stapelberg 97ab44b3d8 disable workspace-level move operations (not yet implemented) (Thanks mseed) 2011-02-01 16:59:02 +01:00
Michael Stapelberg 9b01b1a7a6 Bugfix: When the container which was just closed is focused, we *do* need to focus another one (Thanks mseed) 2011-02-01 16:42:59 +01:00
Michael Stapelberg dad7c0da00 Don’t create a split container if no other cons are on a workspace (Thanks mseed)
This fixes #306.
2011-02-01 16:08:47 +01:00
Michael Stapelberg 0238ce3c73 fix some compiler warnings 2011-02-01 15:43:59 +01:00
Fernando Tarlá Cardoso Lemos 8f4b9ddaa4 Fix the choice of the right containers for resizing.
Also fixes #311, which was an assertion failure that uncovered
this problem. Thanks mseed, Merovius.
2011-01-30 18:52:32 +01:00
Fernando Tarlá Cardoso Lemos ac8fb2399d Don't mess with sizes when moving to other ws. 2011-01-29 15:19:41 +01:00
Fernando Tarlá Cardoso Lemos 8be40932f2 Fix assertion when moving out of a floating container. 2011-01-28 01:25:06 +01:00
Fernando Tarlá Cardoso Lemos f465b3c11d Don't mess with the focus if we're not killing.
If we're not killing the mapped window and we're not killing the
parent window either in tree_close, then there's no reason to try
to change the focus. This fixes focus issues when moving a
container around another container (move up, left, bottom, right).
2011-01-28 01:25:03 +01:00
Michael Stapelberg 5b6ef3e665 make the sighandler handle SIGABRT 2011-01-28 00:47:49 +01:00
Michael Stapelberg f395c141c8 bugfix: initialize root variable earlier 2011-01-28 00:42:55 +01:00
Michael Stapelberg 7b01bc5eb7 Bugfix: use the global root variable, don’t get the first one (Thanks quaec)
The case of an X11 server having multiple displays is handled correctly by the
code in src/mainx.c. However, due to some functions not being correctly
refactored and still getting the first screen (and also the first root window)
from the XCB connection, i3 was operating on the wrong root window.
2011-01-28 00:41:53 +01:00
Michael Stapelberg 79bbde8766 add a flag to disable the signalhandler 2011-01-28 00:31:26 +01:00
Fernando Tarlá Cardoso Lemos b29af954f6 Don't mess with the percentages in tree_flatten. 2011-01-28 00:12:26 +01:00
Fernando Tarlá Cardoso Lemos 5f4123f842 Fix some resizing issues (thanks mseed). 2011-01-27 23:42:37 +01:00
Michael Stapelberg 676afce540 bugfix: correctly move cons out of floating cons when the workspace has no other tiling cons (Thanks mseed) 2011-01-27 16:51:41 +01:00
Michael Stapelberg 334e41daa4 bugfix: don’t assume a workspace always has tiling cons when focusing (Thanks mseed) 2011-01-27 16:51:16 +01:00
Michael Stapelberg 3e08ceaff9 bugfix: resizing problem when resizing vertically on the top border (Thanks julien) 2011-01-27 16:26:19 +01:00
Michael Stapelberg 3383437705 refactor some places to use con_descend_focused instead of duplicating code 2011-01-27 16:09:14 +01:00
Michael Stapelberg f462a9a215 re-insert floating cons next to the currently focused con of the appropriate workspace 2011-01-27 16:04:17 +01:00
Michael Stapelberg 2f5d111936 when re-inserting a floating con, start with a more fair percent value 2011-01-27 15:53:14 +01:00
Michael Stapelberg fe851b85f0 RandR: respect primary output 2011-01-27 15:40:02 +01:00
Fernando Tarlá Cardoso Lemos 432563d6e7 Fix the percentages when moving containers. 2011-01-27 13:00:14 +01:00