Commit Graph

1168 Commits

Author SHA1 Message Date
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