]> git.sur5r.net Git - i3/i3.github.io/blobdiff - docs/hacking-howto.html
update docs for 4.13
[i3/i3.github.io] / docs / hacking-howto.html
index 83267518e551588479ec3ec69f388cd7b4d1b9fc..791b6af2b5f9918807ba66cac49d0e93a37102c2 100644 (file)
@@ -4,7 +4,7 @@
 <head>\r
 <link rel="icon" type="image/x-icon" href="/favicon.ico">\r
 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
-<meta name="generator" content="AsciiDoc 8.6.8" />\r
+<meta name="generator" content="AsciiDoc 8.6.9" />\r
 <title>i3: Hacking i3: How To</title>\r
 <link rel="stylesheet" href="/css/style.css" type="text/css" />\r
 <link rel="stylesheet" href="/css/xhtml11.css" type="text/css" />\r
@@ -22,8 +22,9 @@ document.addEventListener("DOMContentLoaded", function(){asciidoc.footnotes(); a
                         <ul id="nav">\r
                                 <li><a style="border-bottom: 2px solid #fff" href="/docs">Docs</a></li>\r
                                 <li><a href="/screenshots">Screens</a></li>\r
+                                <li><a href="https://www.reddit.com/r/i3wm/">FAQ</a></li>\r
                                 <li><a href="/contact">Contact</a></li>\r
-                                <li><a href="http://bugs.i3wm.org/">Bugs</a></li>\r
+                                <li><a href="https://github.com/i3/i3/issues">Bugs</a></li>\r
                         </ul>\r
         <br style="clear: both">\r
 <div id="content">\r
@@ -235,7 +236,7 @@ src/config.c
 <dd>\r
 <p>\r
 Contains all functions handling the configuration file (calling the parser\r
-(src/cfgparse.y) with the correct path, switching key bindings mode).\r
+src/config_parser.c) with the correct path, switching key bindings mode).\r
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
@@ -400,7 +401,7 @@ src/util.c
 </dt>\r
 <dd>\r
 <p>\r
-Contains useful functions which are not really dependant on anything.\r
+Contains useful functions which are not really dependent on anything.\r
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
@@ -720,10 +721,12 @@ can reconfigure themselves).</p></div>
 <div class="sect1">\r
 <h2 id="_net_wm_state">10. _NET_WM_STATE</h2>\r
 <div class="sectionbody">\r
-<div class="paragraph"><p>Only the _NET_WM_STATE_FULLSCREEN atom is handled. It calls\r
-&#8220;toggle_fullscreen()&#8221; for the specific client which just configures the\r
-client to use the whole screen on which it currently is. Also, it is set as\r
-fullscreen_client for the i3Screen.</p></div>\r
+<div class="paragraph"><p>Only the _NET_WM_STATE_FULLSCREEN and _NET_WM_STATE_DEMANDS_ATTENTION atoms\r
+are handled.</p></div>\r
+<div class="paragraph"><p>The former calls &#8220;toggle_fullscreen()&#8221; for the specific client which just\r
+configures the client to use the whole screen on which it currently is.\r
+Also, it is set as fullscreen_client for the i3Screen.</p></div>\r
+<div class="paragraph"><p>The latter is used to set, read and display urgency hints.</p></div>\r
 </div>\r
 </div>\r
 <div class="sect1">\r
@@ -970,7 +973,7 @@ Stack windows above each other, in reverse stack order (starting with the
 <li>\r
 <p>\r
 If the pointer needs to be warped to a different position (for example when\r
-   changing focus to a differnt output), it will be warped now.\r
+   changing focus to a different output), it will be warped now.\r
 </p>\r
 </li>\r
 <li>\r
@@ -1051,8 +1054,8 @@ unmapped if it should not be visible anymore. <tt>WM_STATE</tt> will be set to
 <div class="paragraph"><p><tt>x_draw_decoration</tt> draws window decorations. It is run for every leaf\r
 container (representing an actual X11 window) and for every non-leaf container\r
 which is in a stacked/tabbed container (because stacked/tabbed containers\r
-display a window decoration for split containers, which at the moment just says\r
-"another container").</p></div>\r
+display a window decoration for split containers, which consists of a representation\r
+of the child container&#8217;s names.</p></div>\r
 <div class="paragraph"><p>Then, parameters are collected to be able to determine whether this decoration\r
 drawing is actually necessary or was already done. This saves a substantial\r
 number of redraws (depending on your workload, but far over 50%).</p></div>\r
@@ -1077,9 +1080,9 @@ all commands.</p></div>
 <div class="paragraph"><p>In earlier versions of i3, interpreting these commands was done using lex and\r
 yacc, but experience has shown that lex and yacc are not well suited for our\r
 command language. Therefore, starting from version 4.2, we use a custom parser\r
-for user commands (not yet for the configuration file).\r
+for user commands and the configuration file.\r
 The input specification for this parser can be found in the file\r
-<tt>parser-specs/commands.spec</tt>. Should you happen to use Vim as an editor, use\r
+<tt>parser-specs/*.spec</tt>. Should you happen to use Vim as an editor, use\r
 :source parser-specs/highlighting.vim to get syntax highlighting for this file\r
 (highlighting files for other editors are welcome).</p></div>\r
 <div class="listingblock">\r
@@ -1117,11 +1120,14 @@ features. This is its definition:</p></div>
 <pre><tt># workspace next|prev|next_on_output|prev_on_output\r
 # workspace back_and_forth\r
 # workspace &lt;name&gt;\r
+# workspace number &lt;number&gt;\r
 state WORKSPACE:\r
   direction = 'next_on_output', 'prev_on_output', 'next', 'prev'\r
       -&gt; call cmd_workspace($direction)\r
   'back_and_forth'\r
       -&gt; call cmd_workspace_back_and_forth()\r
+  'number'\r
+      -&gt; WORKSPACE_NUMBER\r
   workspace = string\r
       -&gt; call cmd_workspace_name($workspace)</tt></pre>\r
 </div></div>\r
@@ -1190,6 +1196,16 @@ workspace &lt;name&gt;
         (matches the end of the input).\r
 </p>\r
 </dd>\r
+<dt class="hdlist1">\r
+workspace number &lt;number&gt;\r
+</dt>\r
+<dd>\r
+<p>\r
+        The workspace command has to be followed by the keyword <tt>number</tt>. It\r
+        then transitions into the state <tt>WORKSPACE_NUMBER</tt>, where the actual\r
+        parameter will be read.\r
+</p>\r
+</dd>\r
 </dl></div>\r
 </div>\r
 <div class="sect2">\r
@@ -1303,7 +1319,7 @@ empty.</p></div>
 be flattened.</p></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_case_3_moving_to_non_existant_top_bottom">17.3. Case 3: Moving to non-existant top/bottom</h3>\r
+<h3 id="_case_3_moving_to_non_existent_top_bottom">17.3. Case 3: Moving to non-existent top/bottom</h3>\r
 <div class="paragraph"><p>Like in case 1, the reference layout for this case is a single workspace in\r
 horizontal orientation with two containers on it. Focus is on the left\r
 container:</p></div>\r
@@ -1337,7 +1353,7 @@ container and the container above/below the current one (on the level of
 flattened.</p></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_case_4_moving_to_existant_top_bottom">17.4. Case 4: Moving to existant top/bottom</h3>\r
+<h3 id="_case_4_moving_to_existent_top_bottom">17.4. Case 4: Moving to existent top/bottom</h3>\r
 <div class="paragraph"><p>The reference layout for this case is a vertical workspace with two containers.\r
 The bottom one is a h-split containing two containers (1 and 2). Focus is on\r
 the bottom left container (1).</p></div>\r
@@ -1488,26 +1504,30 @@ Forgetting to call <tt>floating_fix_coordinates(con, old_rect, new_rect)</tt> af
 <a href="http://web.archive.org/web/20121024222556/http://www.spheredev.org/wiki/Git_for_the_lazy">http://web.archive.org/web/20121024222556/http://www.spheredev.org/wiki/Git_for_the_lazy</a>\r
 or, for more documentation, see <a href="http://git-scm.com/documentation">http://git-scm.com/documentation</a></p></div>\r
 <div class="paragraph"><p>Please talk to us before working on new features to see whether they will be\r
-accepted. There are a few things which we don’t want to see in i3, e.g. a\r
-command which will focus windows in an alt+tab like way.</p></div>\r
+accepted. A good way for this is to open an issue and asking for opinions on it.\r
+Even for accepted features, this can be a good way to refine an idea upfront. However,\r
+we don&#8217;t want to see certain features in i3, e.g., switching window focus in an\r
+Alt+Tab like way.</p></div>\r
 <div class="paragraph"><p>When working on bugfixes, please make sure you mention that you are working on\r
-it in the corresponding bugreport at <a href="https://github.com/i3/i3/issues">https://github.com/i3/i3/issues</a> In case\r
-there is no bugreport yet, please create one.</p></div>\r
-<div class="paragraph"><p>After you are done, please submit your work for review at <a href="https://github.com/i3/i3">https://github.com/i3/i3</a></p></div>\r
+it in the corresponding bug report at <a href="https://github.com/i3/i3/issues">https://github.com/i3/i3/issues</a>. In case\r
+there is no bug report yet, please create one.</p></div>\r
+<div class="paragraph"><p>After you are done, please submit your work for review as a pull request at\r
+<a href="https://github.com/i3/i3">https://github.com/i3/i3</a>.</p></div>\r
 <div class="paragraph"><p>Do not send emails to the mailing list or any author directly, and don’t submit\r
 them in the bugtracker, since all reviews should be done in public at\r
-<a href="http://cr.i3wm.org/">http://cr.i3wm.org/</a>. In order to make your review go as fast as possible, you\r
+<a href="https://github.com/i3/i3">https://github.com/i3/i3</a>. In order to make your review go as fast as possible, you\r
 could have a look at previous reviews and see what the common mistakes are.</p></div>\r
 </div>\r
 <div class="sect2">\r
 <h3 id="_which_branch_to_use">20.2. Which branch to use?</h3>\r
-<div class="paragraph"><p>Work on i3 generally happens in two branches: “master” and “next”. Since\r
-“master” is what people get when they check out the git repository, its\r
-contents are always stable. That is, it contains the source code of the latest\r
-release, plus any bugfixes that were applied since that release.</p></div>\r
+<div class="paragraph"><p>Work on i3 generally happens in two branches: “master” and “next” (the latter\r
+being the default branch, the one that people get when they check out the git\r
+repository).</p></div>\r
+<div class="paragraph"><p>The contents of “master” are always stable. That is, it contains the source code\r
+of the latest release, plus any bugfixes that were applied since that release.</p></div>\r
 <div class="paragraph"><p>New features are only found in the “next” branch. Therefore, if you are working\r
-on a new feature, use the “next” branch. If you are working on a bugfix, use\r
-the “next” branch, too, but make sure your code also works on “master”.</p></div>\r
+on a new feature, use the “next” branch. If you are working on a bugfix, use the\r
+“next” branch, too, but make sure your code also works on “master”.</p></div>\r
 </div>\r
 </div>\r
 </div>\r
@@ -1543,7 +1563,7 @@ the window manager does not have any mapping between the process it starts (or
 gets started in any way) and the window(s) which appear.</p></div>\r
 <div class="paragraph"><p>Imagine for example using dmenu: The user starts dmenu by pressing Mod+d, dmenu\r
 gets started with PID 3390. The user then decides to launch Firefox, which\r
-takes a long time. So he enters firefox into dmenu and presses enter. Firefox\r
+takes a long time. So they enter firefox into dmenu and press enter. Firefox\r
 gets started with PID 4001. When it finally finishes loading, it creates an X11\r
 window and uses MapWindow to make it visible. This is the first time i3\r
 actually gets in touch with Firefox. It decides to map the window, but it has\r