Commit Graph

4437 Commits

Author SHA1 Message Date
Tony Crisci
69ce33d06d Snap pointer to resize bar on drag resize
When the user initiates a drag resize, draw the resize bar on the border
of the two involved containers and snap the pointer.

This solution produces cleaner code than the former approach where the
caller obfuscated the click coordinates of the event. This may confuse
someone expecting a true button press event.

Fixes an issue where the resize cursor is not shown when the resize bar
is clicked until the user begins to drag the mouse.

Fixes an issue where focus is not properly updated after the drag is
complete when `focus_follows_mouse' option is set, leaving the pointer
in an unfocused window in some cases.

Fixes an issue where the resize bar may jump a few pixels when the mouse
is first moved.

(Thanks to pbos for suggesting this fix and providing an example
implementation)
2014-01-01 15:18:54 +01:00
Alexander Kedrik
e2ebe3e2ae Use #pragma once
#pragma once is safer and simpler. According to Wikipedia it's supported by all major compilers.
2014-01-01 15:06:57 +01:00
Michael Stapelberg
3ebc6654cd Merge branch 'fix-tray-mapped' 2014-01-01 11:10:26 +01:00
Michael Stapelberg
67b213665b Merge branch 'master' into next 2014-01-01 11:10:26 +01:00
Tony Crisci
23b1da598e i3bar: Set mapped flag on trayclient creation
When a trayclient is first created as a structure in memory, explicitly
set the `mapped` flag to false. Otherwise it may initialize to `true` in
some circumstances without actually being mapped, causing a request to
be mapped from the client to be ignored.

Create the trayclient in memory before handling a request to be mapped
immediately.

fixes #1138
2014-01-01 11:10:21 +01:00
Michael Stapelberg
1e1e4ef9df include i3-save-tree in dist tarballs 2013-12-24 18:07:07 +01:00
Michael Stapelberg
c3ff365072 install i3-save-tree(1) (Thanks Marcin) 2013-12-24 16:15:43 +01:00
Michael Stapelberg
cd6fb69977 Merge branch 'dpi-log' 2013-12-24 10:37:14 +01:00
Michael Stapelberg
5cd7979e62 Merge branch 'master' into next 2013-12-24 10:37:14 +01:00
Michael Stapelberg
0883dfbe14 only LOG() the DPI when it changes, DLOG() it otherwise (Thanks lkraav)
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it’s actually
relevant (upon DPI changes).

fixes #1115
2013-12-24 10:35:56 +01:00
Michael Stapelberg
0b8a7b2d16 debian/: add perl recommends to i3-wm for i3-save-tree(1) 2013-12-22 21:54:13 +01:00
Michael Stapelberg
0d356e748d update DEPENDS 2013-12-22 21:52:49 +01:00
Michael Stapelberg
12885cb0ab add i3-save-tree(1) which dumps the layout of a workspace or an output 2013-12-22 21:52:49 +01:00
Michael Stapelberg
c964c010f0 ipc: dump window properties when not restarting inplace 2013-12-22 21:52:49 +01:00
Michael Stapelberg
e567cf436c dragging: instead of using a custom event loop, use libev
This is done by installing a new check watcher that replaces the main
X11 event handler and calling ev_run with EVRUN_ONCE until the dragging
loop left state DRAGGING.

With this commit, other handlers, most notably the redraw handler for
placeholder windows, get a chance to run when dragging (placeholder!)
windows around.
2013-12-22 21:52:49 +01:00
Michael Stapelberg
f57f94c850 reconnect when the restore X11 connection dies
This could happen if a user uses xkill(1) on a placeholder window.
2013-12-22 21:52:49 +01:00
Michael Stapelberg
42e359ec60 kill placeholder windows when the actual window appears 2013-12-22 21:52:49 +01:00
Michael Stapelberg
28a993e656 replace never-true condition with a working one
state->initial is set to false before calling x_push_node() since we
began pushing the window stack before pushing changes. Therefore, the
condition could never be true.
2013-12-22 21:52:49 +01:00
Michael Stapelberg
318b089e6d fix test after renaming role to window_role 2013-12-22 21:52:49 +01:00
Michael Stapelberg
35b70ca423 introduce client.placeholder color 2013-12-22 21:52:49 +01:00
Michael Stapelberg
639a1b182c set original window title on placeholder windows 2013-12-22 21:52:49 +01:00
Michael Stapelberg
16ea766765 use root window color depth instead of hard-coded 24 2013-12-22 21:52:49 +01:00
Michael Stapelberg
076636a835 display swallows criteria in placeholder windows 2013-12-22 21:52:49 +01:00
Michael Stapelberg
3a4ad9b330 layout restore: create and render placeholder windows
This is not entirely done yet, but TODO entries are placed in the code
where appropriate.
2013-12-22 21:52:49 +01:00
Michael Stapelberg
2ce43783f8 add debug message to trace match deletions 2013-12-22 21:52:49 +01:00
Michael Stapelberg
fcf869439c load_layout.c: use *LOG instead of (f)printf 2013-12-22 21:52:49 +01:00
Michael Stapelberg
ef7b3e5464 allow parsing multiple nodes from a json layout 2013-12-22 21:52:49 +01:00
Michael Stapelberg
6800524f2e GET_TREE: serialize container type into a string
So far, this was blessed for internal use only (by virtue of not being
in the documentation), but we want to expose it for the stored layouts.
2013-12-22 21:52:49 +01:00
Michael Stapelberg
58297f4ab5 layout restore: support more criteria, match only once (+test) 2013-12-22 21:52:49 +01:00
Michael Stapelberg
598498330a layout loading: allow comments in JSON files 2013-12-22 21:52:49 +01:00
Michael Stapelberg
4add185025 tests: add simple layout restore test 2013-12-22 21:52:49 +01:00
Michael Stapelberg
0302912b64 swallows: value needs to be loaded as regular expression 2013-12-22 21:52:49 +01:00
Michael Stapelberg
ce480dcc74 use splith as default when restoring a layout
This frees users from specifying layouts even when they don’t make any
difference, e.g. leaf nodes.
2013-12-22 21:52:49 +01:00
Michael Stapelberg
c7036191c8 debian/: add placeholder commit 2013-12-22 21:39:15 +01:00
Michael Stapelberg
28939365cb Merge branch 'next' 2013-12-22 21:14:21 +01:00
Michael Stapelberg
ae0e83f08d Merge branch 'release-4.7' into next 2013-12-22 21:14:15 +01:00
Michael Stapelberg
26e30ef00c add release notes for v4.7 2013-12-22 21:12:10 +01:00
Michael Stapelberg
95af0fdcac Merge branch 'fix-active' 2013-12-21 21:32:55 +01:00
Michael Stapelberg
b2c91f54ab Merge branch 'master' into next 2013-12-21 21:32:55 +01:00
Michael Stapelberg
85321bdf1d Bugfix: ignore _NET_ACTIVE_WINDOW for scratchpad windows (Thanks mistnim)
fixes: #1136
2013-12-21 21:32:23 +01:00
Tony Crisci
bfe32ad797 i3bar: Print error message when status_command fails
Add a function to i3bar to print an error message in the status line
when the child process invoked by status_command fails to provide
input that can be displayed as a statusline.

When the child provides JSON that cannot be parsed, alert the user and
convey a short message provided by yajl communicating the specific
problem.

When the child (or the shell executing the status command) exits
unexpectedly, alert the user and display the exit code. The cases where
the status command is not executable or not found in the user's PATH are
treated specially.

fixes #1130
2013-12-21 08:57:21 +01:00
Michael Stapelberg
665ac5b7c3 userguide: explain the difference between comma and semicolon for command chaining 2013-12-11 19:47:36 +01:00
Tony Crisci
5a69bffbd6 Remove pointer warp from test boilerplate
Remove the line to warp the pointer to (0, 0) in `new-test` helper
script, which is used to create new tests.

Since 4.6-g0634766, testcases may assume at the start of the test that
the pointer begins at position (0, 0).
2013-12-10 21:52:50 +01:00
Tony Crisci
1b640ae3be Testcases: init pointer in a predictable position
Tests may disturb the pointer in their normal operation that may lead to
unexpected results in later tests using that display. Reset the pointer
before a test begins to (0, 0) to save test developers from related
"gotchas" and reduce multi-monitor test boilerplate.
2013-12-04 19:51:05 +01:00
Tony Crisci
18ad1fd4de Refactor and improve test 514
Split test 514's assertion into three assertions to make it more
explicit what is being tested, and why a run might fail.

Move critical test code out of the event handler to clarify flow and
allow a query of the actual current workspace to use in assertions.

Works around an issue which caused this test to fail spurriously because
of pointer-related quirks in the i3 test suite which would sometimes
cause i3 to open on workspace 2 (However, the test is now agnostic to
the initial workspace or output).
2013-12-04 19:50:35 +01:00
Tony Crisci
39f15da82f i3bar: Group child processes for signalling
Set the process group id of the child process by calling `setpgid` after
forking and before calling `exec`.

The process group ID will be set to the process ID of the forked
process. Processes spawned by this child process will also have this
group ID.

Send signals to the process group with `killpg`. This will send the
signal to all of the process group.

fixes #1128
2013-12-04 19:45:19 +01:00
Jean-Philippe Ouellet
454f11755e Remove flex/bison from common.mk since they aren't used anymore 2013-11-30 14:02:34 +01:00
Tony Crisci
80df764e55 i3bar: Realign tray clients on map/unmap notify
UnmapNotify events are interpreted by i3bar as an action taken by an
application to hide its tray window. Likewise, MapNotify events are
interpreted as an action taken by by an application to show its tray
window.

The actual cause of these events may be the application itself, or the
result of some action taken by i3bar itself at the request of the
application in the course of the XEmbed protocol.

We respond by adjusting the size of the tray window and realigning any
tray clients that remain. This will make room for the mapping window or
close the gap left by the unmapping window when the bar is redrawn.

fixes #1110
2013-11-30 14:01:25 +01:00
Lancelot SIX
eca5e4598a libi3/root_atom_contents: handle data of arbitrary length
Handle data fetched from xcb_get_property_unchecked with arbitrary
length. This avoids having to rely on PATH_MAX macro where it is not
necessary.
2013-11-26 19:58:35 +01:00
Jean-Philippe Ouellet
2eea82eb02 ignore symbol files on OS X (only for debugging, breaks git-add -A) 2013-11-26 19:56:59 +01:00