Commit Graph

1439 Commits

Author SHA1 Message Date
Michael Stapelberg
726f2a1e5a normalize file headers across **/*.{h,c} 2011-10-25 21:19:38 +01:00
Michael Stapelberg
8660ae4e12 bar config: fall back to the i3 font (Thanks pl) 2011-10-25 20:50:57 +01:00
Fernando Tarlá Cardoso Lemos
d490bae8a2 Close empty workspaces if they're not visible.
Previously, we'd only close an empty workspace when we moved away
from it. Now we also close it when the last client exits, as long
as that workspace is not visible anymore.
2011-10-24 00:12:14 +01:00
Michael Stapelberg
a58018cf66 Add libi3/load_font, use it everywhere
…except for i3bar, which needs slightly more information about the font
2011-10-23 22:37:11 +01:00
Michael Stapelberg
6d01d37b03 remove unused cached_fonts TAILQ 2011-10-23 22:03:20 +01:00
Michael Stapelberg
8da6049ca9 Actually make load_font only fallback if 'fallback' is true 2011-10-23 22:02:11 +01:00
Michael Stapelberg
3e7f941b83 Fix comment in run_assignments (Thanks xeen) 2011-10-23 21:45:12 +01:00
Michael Stapelberg
91134f75c0 Move get_mod_mask to libi3, use it in i3 and i3-config-wizard
Also, the API changed a bit. There are two functions now, both assume you
already got the keysyms (which is the case for i3 and i3-config-wizard),
one gets the modifier mapping for you (aio_get_mod_mask_for) while the other
assumes you also got that. No roundtrips are required for the latter.
2011-10-23 21:26:15 +01:00
Michael Stapelberg
a512b99a51 Introduce --get_socketpath and --force_xinerama as synonyms for --get-socketpath and --force-xinerama 2011-10-23 19:41:40 +01:00
Michael Stapelberg
6dc6ba11fc Eliminate xcb_change_gc_single everywhere with C99 2011-10-23 18:06:25 +01:00
Michael Stapelberg
9eda7fb6fb move strndup to libi3 2011-10-23 18:02:01 +01:00
Michael Stapelberg
ada4857ad2 Fix colors in i3bar (Thanks julien)
i3bar previously used get_colorpixel on strings without the leading # (ff0000
instead of #ff0000). Since it uses libi3’s get_colorpixel now we needed to
update a few places.
2011-10-23 17:48:44 +01:00
Michael Stapelberg
cb9bbcfccf Move get_colorpixel to libi3, use it everywhere else 2011-10-23 17:38:21 +01:00
Michael Stapelberg
31cb3dda8d cfgparse: use different literal strings for ambiguous keywords in bar context 2011-10-23 16:41:23 +01:00
Michael Stapelberg
9d15a00ba8 introduce sasprintf() in libi3, use it everywhere 2011-10-23 13:16:56 +01:00
Michael Stapelberg
10d3281b0f remove/shorten a lot of debugging messages
Some of them are useless nowadays, others very unlikely to be a problem.
Those which might still be interesting somewhen in the future are just
commented out.
2011-10-23 00:15:13 +01:00
Michael Stapelberg
42d355f2b7 normalize modelines/headers across src/*.c 2011-10-22 23:40:02 +01:00
Michael Stapelberg
753d67fb64 migration from exec i3bar to bar config: i3 substitutes exec with a bar block, shows nagbar 2011-10-22 16:33:00 +01:00
Michael Stapelberg
9b84348201 Bugfix: fix off by one when copying the hex colorcode (Thanks fernandotcl) 2011-10-21 23:22:48 +01:00
Michael Stapelberg
77961ad9c8 cfgparse: Don’t use asprintf when parsing hex colors 2011-10-21 23:09:57 +01:00
Michael Stapelberg
3baeeb1834 Bugfix: properly transition in and out of the COLOR_COND state (Thanks fernandotcl) 2011-10-21 22:58:53 +01:00
Michael Stapelberg
caee0a0fda cfgparse: eliminate absolute states, use yy_push_state/yy_pop_state
This fixes a problem with workspace assignments.
I tested i3 -C with three user configs (Thanks SardemFF7, julien, xeen)
and did not notice any problems.
2011-10-20 22:38:46 +01:00
Michael Stapelberg
12d866e4f6 Don’t start i3-nagbar when using -C to validate the config 2011-10-20 22:25:59 +01:00
Michael Stapelberg
230b238870 Actually start i3bar instances for each configured bar 2011-10-20 19:03:40 +01:00
Michael Stapelberg
ad0f13a0a9 Clean bars before reloading the config (+test)
While the configuration gets updated in i3, the i3bar processes will not pick
up these changes. We have to think about a good way to do that.
2011-10-20 18:47:09 +01:00
Michael Stapelberg
15bface10d Create different IDs for each bar (+test) 2011-10-19 19:57:39 +01:00
Michael Stapelberg
063b124e35 Implement parsing bar {} config blocks 2011-10-18 22:16:04 +01:00
Michael Stapelberg
149b05aacf ipc: when requesting the bar config without a payload, return an array of available bar IDs 2011-10-18 22:12:46 +01:00
Michael Stapelberg
e3cbdea1fc Bugfix: Correctly close the colors map in the IPC bar config reply 2011-10-18 22:11:44 +01:00
Michael Stapelberg
c2c6ca25d5 Make the barconfig list a TAILQ 2011-10-18 22:11:27 +01:00
Michael Stapelberg
24ede1c834 add an IPC request to get the bar configuration (by ID) 2011-10-18 19:05:49 +01:00
Michael Stapelberg
4898f78e5e add a data structure for 'bar' configuration 2011-10-18 19:05:49 +01:00
Peter Bui
9d67ae2202 Focus new window only if it is on a visible workspace on the current focused output. 2011-10-18 18:56:39 +01:00
Michael Stapelberg
a506e59b3c Bugfix: Fix segfault when starting i3 (Thanks pnutzh4x0r) 2011-10-18 18:47:07 +01:00
Michael Stapelberg
f09d9a4c37 log: use localtime_r instead of localtime
localtime_r does not have the side-effect of behaving like it called tzset(),
in particular it will save one stat(/etc/localtime) syscall. This is not a big
deal, but it makes the strace output cleaner and thus more useful :).
2011-10-18 18:32:47 +01:00
Michael Stapelberg
178be03fa6 Implement 'workspace back_and_forth' (Patch by Michael Walle) 2011-10-17 23:17:56 +01:00
Michael Stapelberg
914ca6cfe7 Bugfix: Use _exit in forking to avoid calling the libev cleanup handler (Thanks xeen) 2011-10-15 16:56:47 +01:00
Michael Stapelberg
32b97745ec Don’t call ev_destroy_loop with ev < 4 in atexit (Thanks xeen) 2011-10-15 16:56:32 +01:00
Michael Stapelberg
5f52c78aa0 Change the root window cursor to 'watch' during startups 2011-10-10 15:54:18 +01:00
Michael Stapelberg
2ad4fbb34a startup: delete the startup sequence upon completion, make the timeout complete it 2011-10-10 15:54:18 +01:00
Michael Stapelberg
997a539a8a Implement timeouts for startup notifications 2011-10-10 15:54:17 +01:00
Michael Stapelberg
6ac098a45e support _NET_STARTUP_ID on the client leader window
(necessary for GIMP, geeqie, …)
2011-10-10 15:54:17 +01:00
Michael Stapelberg
4204b8e2b0 Get the _NET_STARTUP_ID in manage_window, get the corresponding workspace 2011-10-10 15:54:17 +01:00
Michael Stapelberg
499d89bdb0 Keep track of startup notifications in a TAILQ, save workspace 2011-10-10 15:54:17 +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
c812cdcf9a make handle_client_message not return anything
The function returned an int for historical reasons.
2011-10-10 15:54:17 +01:00
Michael Stapelberg
d1d4f39f9e save the last timestamp received by X11 in last_timestamp
We need it for startup notifications (to generate a unique id)

Conflicts:

	include/i3.h
	src/main.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
2a29d9c2c1 Make conn_screen available outside of main()
Will be used in other parts of the code for startup notification
2011-10-10 15:54:17 +01:00
Michael Stapelberg
0f74f9b921 remove left-over type definition for mode_info 2011-10-09 18:25:21 +01:00
Michael Stapelberg
18991a65c7 log WM_NAME (non-utf-8 window titles) 2011-10-09 14:45:34 +01:00
Michael Stapelberg
29c185dd0b Move fake_configure_notify to libi3 2011-10-09 13:40:15 +01:00
Michael Stapelberg
658bf5adff Bugfix: Warp pointer to the correct window when using the 'focus' command
Comment in the code makes the fix clear, I think.

Steps to reproduce the issue:
1) On the right monitor, open two terminals (h-split workspace)
2) 'i3 mark foo' on the right terminal
3) Focus the left terminal
4) Switch to the left monitor
5) i3 '[con_mark="foo"] focus'
6) the left window will contain the pointer (and is focused for a short period
   of time, or even permanently due to race conditions)
2011-10-03 21:54:36 +01:00
Noe Rubinstein
1eab86b916 add "move workspace next" and "move workspace prev"
some factorization would be better here, however I don't really know my
way around bison
2011-10-02 22:03:47 +01:00
Michael Stapelberg
b2ad9a77c8 rename the internal function to _workspace_show, add a comment to workspace_show_by_name 2011-10-02 22:03:16 +01:00
Noe Rubinstein
92cc4494aa refactor workspace_show and friends 2011-10-02 21:57:00 +01:00
Michael Stapelberg
b755397687 Make i3 send arguments as command to a running i3 instance (like i3-msg)
From i3 --help:

If you pass plain text arguments, i3 will interpret them as a command
to send to a currently running i3 (like i3-msg). This allows you to
use nice and logical commands, such as:

	i3 border none
	i3 floating toggle
	i3 kill window
2011-10-02 19:20:43 +01:00
Michael Stapelberg
4243a4053e Cleanup i3 --help 2011-10-02 18:55:15 +01:00
Michael Stapelberg
046cf99585 Move ipc_send_message and ipc_recv_message to libi3
Make i3-msg and src/ipc.c use it
2011-10-02 18:33:36 +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
23796ea900 Implement i3 --get-socketpath, useful for IPC scripts
In order to not depend on X11 just for getting the socket paths, scripts or
other programs can now use i3 --get-socketpath. Since i3 must be present on the
computer anyways, this saves one dependency :).
2011-10-02 16:12:10 +01:00
Michael Stapelberg
679bceccc4 remove obsolete comment 2011-10-02 13:18:12 +01:00
Michael Stapelberg
0482dc7546 Merge branch 'master' into next 2011-10-01 17:44:46 +01:00
Michael Walle
8adcf3e5d1 set close-on-exec flag on errorlogfile
Make sure the file descriptor is closed within the child after forking.

Signed-off-by: Michael Walle <michael@walle.cc>
2011-10-01 17:44:22 +01:00
Michael Stapelberg
3629934b0a Check for PCRE version and disable PCRE_UCP for <= 8.10 2011-09-30 20:31:32 +01:00
Michael Stapelberg
db33da2258 Merge branch 'master' into next 2011-09-26 20:12:07 +01:00
Michael Stapelberg
abaa8c2356 Bugfix: IPC: Correctly dump the 'focus' array 2011-09-26 20:11:47 +01:00
Michael Stapelberg
6420b2b102 Introduce the i3-sensible-{pager,editor,terminal} scripts
The former two provide fallbacks in case $PAGER or $EDITOR is not set (which
might be more common than you think, because they have to be set in
~/.xsession, not in the shell configuration!) while the latter tries to launch
a terminal emulator. The scripts are most prominently used in i3-nagbar, which
alerts the user when the configuration is broken for some reason. Also,
i3-sensible-terminal is used in the default configuration.

This commit does not rely on the shell supporting ${PAGER:-less} anymore, which
is not the case for 'fish'.
2011-09-25 18:46:37 +01:00
Michael Stapelberg
1481cd95c9 Implement the I3_SYNC client protocol
This is mainly useful for the testsuite. The tests can wait until i3 processed
all X11 events and then continue. This eliminates sleep() calls which leads to
a more robust and faster testsuite.
2011-09-22 23:13:12 +01:00
Michael Stapelberg
daebe28b09 Merge branch 'master' into next 2011-09-22 23:11:14 +01:00
Yves Fischer
0c367f9e4c Skip dragging of floating cons in fullscreen mode 2011-09-22 23:10:48 +01:00
Michael Stapelberg
1717b88174 Merge branch 'master' into next 2011-09-22 20:11:44 +01:00
Michael Stapelberg
4dbda73114 Bugfix: Correctly revert focus to other floating windows when closing a floating window
Uncovered by the testsuite \o/
2011-09-22 20:10:51 +01:00
Michael Stapelberg
143663f031 Merge branch 'master' into next 2011-09-20 22:37:08 +01:00
Michael Stapelberg
77ae3cd8f7 Bugfix: use bufcopy instead of buf when boundary checking (Thanks thomasba)
Also replace the useless (bufcopy + (next - bufcopy)) with next
2011-09-20 22:36:23 +01:00
Michael Stapelberg
de7c2841ed Merge branch 'master' into next 2011-09-20 21:42:51 +01:00
Michael Stapelberg
cd6c3fedcb A bit more boundary-checking when replacing variables.
Makes valgrind happy
2011-09-20 21:42:26 +01:00
Michael Stapelberg
e1949aa694 Bugfix: Correctly split key/value when parsing variables (Thanks xeen) 2011-09-20 21:42:09 +01:00
Michael Walle
5aa43d61f8 Add force_xinerama configuration option
The configuration option does the same as the commandline parameter, except
it can be easily set by the user (e.g. you are using KDM and can't start a
session through ~/.xsession).

Signed-off-by: Michael Walle <michael@walle.cc>
2011-09-19 23:10:38 +01:00
Michael Stapelberg
05c0a8985b Merge branch 'master' into next 2011-09-18 17:44:00 +01:00
Michael Stapelberg
2fe0949abd Bugfix: Only change focus in tree_close() when the container was focused before
Fixes: #441

I’m not sure if that’s really all there is to it. Seems a bit too simple :).
We’ll see if I missed some corner cases in the next few days…
2011-09-18 17:43:02 +01:00
Michael Stapelberg
46409ad656 Merge branch 'master' into next 2011-09-18 17:02:52 +01:00
Michael Stapelberg
a82f5750de Bugfix: Avoid out of bounds coordinates when moving floating windows (Thanks eeemsi)
This commit makes the coordinates proportional when moving floating windows.
That is, if you have a window at the bottom of your 1920 px monitor and move it
to your 800 px monitor, it will be at the bottom of the 800 px monitor (and not
out of bounds).
2011-09-18 17:00:29 +01:00
Michael Stapelberg
b3adaa2983 Implement the window_role criterion (checks WM_WINDOW_ROLE)
Closes: #446

This is handy for matching specific windows of a multi-window application, for
example only Pidgin’s buddy list window.
2011-09-18 16:05:10 +01:00
Michael Stapelberg
c88425147e Merge branch 'master' into next 2011-09-18 14:39:33 +01:00
Michael Stapelberg
7a2e92a116 Bugfix: Use con_orientation(). Fixes switching between different outputs
Fixes: #518

For stacking containers, direct access using con->orientation is wrong, we need
to use con_orientation().
2011-09-18 14:38:39 +01:00
Michael Stapelberg
0bc44ffc37 Merge branch 'master' into next 2011-09-18 00:40:42 +01:00
Peter Bui
a5012f6021 fix-bug-515: always adjust floating position when moving to another output
Floating con position needs to be adjusted when moving to another
output, regardless of whether or not the target workspace is visible.
2011-09-18 00:38:32 +01:00
Michael Stapelberg
b4ab4703c9 Merge branch 'master' into next 2011-09-17 20:55:13 +01:00
Michael Stapelberg
755c618cd4 Bugfix: Don’t warp the pointer if it already is on the target output (Thanks cls, pnutzh4x0r)
My testcase was putting a floating window on the left output, but overlapping a
little to the right output. Then switch to a workspace on the right output.
2011-09-17 20:53:24 +01:00
Michael Stapelberg
e6a854a742 Remove obsolete code for floating focus 2011-09-17 19:29:06 +01:00
Michael Stapelberg
172f3563f7 Implement focus switching (focus left/right) for floating windows
Fixes: #475
2011-09-17 19:28:41 +01:00
Michael Stapelberg
fe35c80741 Also make compilation possible on systems with libev 3
From the source:

    We need ev >= 4 for the following code. Since it is not *that* important
    (it only makes sure that there are no i3-nagbar instances left behind) we
    still support old systems with libev 3.
2011-09-17 17:55:36 +01:00
Michael Stapelberg
7a38d8ac56 Merge branch 'master' into next 2011-09-17 14:13:05 +01:00
Michael Stapelberg
deab3ac338 Send the correct X11 border_width in faked ConfigureNotifys 2011-09-17 14:11:55 +01:00
Michael Stapelberg
f2f636f9e7 Bugfix: Honor the X11 window border in ConfigureRequests 2011-09-17 14:11:01 +01:00
Michael Stapelberg
983a679537 Bugfix: Honor the X11 window border when calculating dimensions for floating windows 2011-09-17 14:10:35 +01:00
Michael Stapelberg
f6eaa8a580 Bugfix: Don’t use top border height twice when calculating dimensions for floating windows 2011-09-17 14:09:57 +01:00
Michael Stapelberg
5a85c9efd2 fix build in 'next' (Thanks thomasba) 2011-09-14 23:16:23 +01:00
Michael Stapelberg
ad568aa8c1 Merge branch 'master' into next 2011-09-14 23:00:02 +01:00