Commit Graph

3138 Commits

Author SHA1 Message Date
Michael Stapelberg a532f5ac39 Implement a new parser for commands. (+test)
On the rationale of using a custom parser instead of a lex/yacc one, see this
quote from src/commands_parser.c:
     We use a hand-written parser instead of lex/yacc because our commands are
     easy for humans, not for computers. Thus, it’s quite hard to specify a
     context-free grammar for the commands. A PEG grammar would be easier, but
     there’s downsides to every PEG parser generator I have come accross so far.

     This parser is basically a state machine which looks for literals or strings
     and can push either on a stack. After identifying a literal or string, it
     will either transition to the current state, to a different state, or call a
     function (like cmd_move()).

     Special care has been taken that error messages are useful and the code is
     well testable (when compiled with -DTEST_PARSER it will output to stdout
     instead of actually calling any function).

During the migration phase (I plan to completely switch to this parser before
4.2 will be released), the new parser will parse every command you send to
i3 and save the resulting call stack. Then, the old parser will parse your
input and actually execute the commands. Afterwards, both call stacks will be
compared and any differences will be logged.

The new parser works with 100% of the test suite and produces identical call
stacks.
2012-01-14 21:29:57 +00:00
Michael Stapelberg f81c89ac28 Refactor the code out of src/cmdparse.y to src/commands.c
This is the first step towards our new parser.
2012-01-14 16:59:52 +00:00
Michael Stapelberg 608def6c6e cmdparse.l: [^t] is enough (Thanks f8l) 2012-01-10 23:09:00 +00:00
Michael Stapelberg 0174f1c183 Merge branch 'move-workspace-to-output' into next 2012-01-10 22:16:57 +00:00
Michael Stapelberg 814695d8bb Implement 'move workspace to output <output>'
Fixes: #541
2012-01-10 22:16:50 +00:00
Michael Stapelberg a4a59a797f tests: use open_window to avoid motion notifies which in turn trigger endless loops
Using 'open' will not create an X11 window (while open_window does), so we will
get spurious motion notify events when switching focus, leading to endless loops.
2012-01-10 22:16:09 +00:00
Michael Stapelberg df9b338175 Introduce synonyms: 'move to workspace' and 'move container to workspace' and 'move window to workspace'
This makes the new 'move workspace to output' command much more clear
2012-01-10 22:16:09 +00:00
Michael Stapelberg 9c11ef4b23 Merge branch 'workspace_on_output' into next 2012-01-08 16:33:48 +00:00
Michael Stapelberg 6585d289cf add testcase for workspace next_on_output/prev_on_output 2012-01-08 16:33:16 +00:00
Michael Stapelberg 6e4a86b7d1 tests: make focused_ws multi-monitor-safe, document it 2012-01-08 16:32:58 +00:00
Michael Stapelberg 6df971d5d5 Ignore next_on_output/prev_on_output when looking for the first workspace 2012-01-08 16:31:07 +00:00
Michael Stapelberg 58f331c50a userguide: document workspace next_on_output/prev_on_output 2012-01-08 16:30:48 +00:00
Max Alexander Busse fba2582b2e Switch and Move to next workspace on the same Output. As requested in \#554 2012-01-08 16:24:21 +00:00
Michael Stapelberg 659e06a170 Merge branch 'i3bar-hide-mod' into next 2012-01-08 12:54:10 +00:00
Michael Stapelberg c72367660f update userguide to reflect the modifier option in i3bar config 2012-01-08 12:52:45 +00:00
dbp a3081c488a Allow different modifier keys for showing hidden i3bar. 2012-01-08 12:47:41 +00:00
Michael Stapelberg f88c779457 Merge branch 'master' into next 2012-01-08 12:30:41 +00:00
Michael Stapelberg af73d3bffe Merge branch 'fix-floating-assign' 2012-01-08 12:30:23 +00:00
Michael Stapelberg 96c491a488 Bugfix: Fix assignments of floating windows to (yet) unused workspaces (Thanks zeus)
The problem was that the workspace was considered empty for a brief period of
time when entering floating mode. This happened when you assigned Gimp to a
workspace which is not in use yet.
2012-01-08 12:28:49 +00:00
Michael Stapelberg d662ba3c0c Merge branch 'focus-output' into next 2012-01-08 12:03:31 +00:00
Michael Stapelberg c92aa648cb document the 'focus output' command 2012-01-08 12:02:59 +00:00
Michael Stapelberg 47a25aa883 bump copyright 2012-01-08 12:00:19 +00:00
Michael Stapelberg 07d07719f0 add testcase for 'focus output' 2012-01-08 11:59:24 +00:00
Michael Stapelberg 5c3077bc78 wrap 'focus output': when on the right-most output and focusing right, it will focus the left-most output 2012-01-08 11:58:45 +00:00
Michael Stapelberg e3051629d1 remove trailing whitespace and empty lines 2012-01-08 11:44:01 +00:00
Max Alexander Busse d0b3a943f0 Feature: focus the output right/left/above/below 2012-01-08 11:43:31 +00:00
Michael Stapelberg 470ee00012 Merge branch 'master' into next 2012-01-07 18:50:46 +00:00
Michael Stapelberg 3ce7f03f02 Merge branch 'fix-assignment-open' 2012-01-07 18:50:43 +00:00
Michael Stapelberg d4238c778a Bugfix: Open new windows in the correct place when assignments match (+test) (Thanks Don) 2012-01-07 18:50:00 +00:00
Michael Stapelberg 6345124049 Merge branch 'master' into next
Conflicts:
	src/con.c
2012-01-07 18:21:12 +00:00
Michael Stapelberg 313a700e86 Merge branch 'fix-fullscreen-move' 2012-01-07 18:19:48 +00:00
Michael Stapelberg f78caf8c58 Bugfix: Don’t lose focus on fullscreen windows when another window gets moved to that workspace (+test) (Thanks rami)
Fixes: #606
2012-01-07 18:18:36 +00:00
Michael Stapelberg 0e1b1dd984 Bugfix: Correctly handle 'move scratchpad' on workspace level (+test) (Thanks mseed)
Fixes: #597
2012-01-07 17:36:30 +00:00
Michael Stapelberg 3254188cda Bugfix: Show scratchpad on the correct output (+test)
Fixes: #596
2012-01-07 16:53:37 +00:00
Michael Stapelberg 89dded044b forgot include/shmlog.h 2012-01-07 14:59:58 +00:00
Michael Stapelberg dee7c07ad2 shmlog: store meta information in the buffer itself, store path as X11 atom
This makes i3-dump-log completely independent of a running i3 instance.
2012-01-06 23:40:07 +00:00
Michael Stapelberg ed37a63942 tests: add scratchpad test 2012-01-05 21:41:23 +00:00
Michael Stapelberg 91499ed2c7 properly serialize floating/scratchpad state when restarting 2012-01-05 21:41:20 +00:00
Michael Stapelberg ec7ed75c01 tests: make t/143 actually verify floating windows are restored properly 2012-01-05 21:20:53 +00:00
Michael Stapelberg fca57ed077 Change prototype of handlers to static void, remove a bit of old code 2011-12-30 11:30:56 +01:00
Michael Stapelberg 019347b14c update comment in include/data.h 2011-12-30 11:23:15 +01:00
Michael Stapelberg 68544a519e Handle vsnprintf overflows (Thanks Han) 2011-12-30 01:26:36 +01:00
Michael Stapelberg 9a46335e25 docs/userguide: refer to the new i3bar options in "8.1. Displaying a status line" 2011-12-30 00:59:32 +01:00
Michael Stapelberg 2ec689ec7d Fix i3-config-wizard on FreeBSD 7.x (without getline()) (Thanks garga) 2011-12-30 00:50:54 +01:00
Michael Stapelberg a2031a8894 Log the configfile name in verbose log, not only debug log (Thanks Han) 2011-12-29 00:04:48 +01:00
Michael Stapelberg ac3541c28c update i3-sensible-* (Thanks Han) 2011-12-29 00:01:49 +01:00
Michael Stapelberg 27c442c9c1 Merge branch 'test-multi-monitor' into next 2011-12-26 20:51:01 +01:00
Michael Stapelberg dd9743b272 tests: Implement multi-monitor tests using Xdmx 2011-12-26 20:48:57 +01:00
Michael Stapelberg 457ca0e15a debian/changelog bump for next 2011-12-24 16:29:21 +01:00
Michael Stapelberg 20b8b1a22a Merge branch 'master' into next 2011-12-24 16:28:48 +01:00