Commit Graph

1998 Commits (de3901bb291b6c9ed2691bcc81febbfbeffa2957)

Author SHA1 Message Date
Alexander Kedrik de3901bb29 use designated initializers for yajl_callbacks struct 2014-01-06 22:12:14 +01:00
Michael Stapelberg 0fd9a96118 ipc: dump new "swallows" properties 2014-01-05 20:30:03 +01:00
Michael Stapelberg 93cfdcd488 sanity check: drop swallows for split containers (Thanks xeen)
fixes #1149
2014-01-05 20:25:47 +01:00
Michael Stapelberg 2fea5ef82b Revert "use designated initializers for yajl_callbacks struct"
This reverts commit 705b43294a.

This commit broke i3bar for some users.
2014-01-05 13:05:31 +01:00
Michael Stapelberg f6ee035c61 fix killing placeholder windows
The only consequence of the previous situation was that there was a
misleading log message.
2014-01-04 22:24:47 +01:00
Michael Stapelberg 18e6184f1c run con_fix_percent unconditionally, not only on parsing errors 2014-01-04 21:59:41 +01:00
Michael Stapelberg 58b3c730e2 return parse errors via IPC for append_layout 2014-01-04 21:39:13 +01:00
Michael Stapelberg 1d969e6340 fix percentages when loading layouts
This is more forgiving for users who delete containers from their layout
file and don’t update the “percent” values.
2014-01-04 21:30:51 +01:00
Michael Stapelberg dfd9410ab7 Bugfix: set all parsing_* variables to false when starting parsing 2014-01-04 21:23:12 +01:00
Michael Stapelberg 4a9e283f05 Bugfix: fix crash when layout JSON file is partially invalid (Thanks xeen)
Fixes #1145
2014-01-04 21:22:12 +01:00
Tony Crisci b109b1b20d Disable render-time pointer warps if asked
When `focus_follows_mouse` configuration option is disabled, do not warp
the pointer when focus changes outputs after rendering.

Rationale: this option is meant to be disabled by users who have a setup
where the mouse is usually in the way. These users tend to move the
mouse to a corner or use a utility to hide the pointer when it is not
active. When this user switches focus between outputs, the mouse is
placed in the center of the screen.

This is clearly against the spirit of disabling `focus_follows_mouse`.
Disabling this option now implies disabling "mouse follows focus".
2014-01-04 20:52:12 +01:00
Alexander Kedrik 705b43294a use designated initializers for yajl_callbacks struct 2014-01-04 20:46:46 +01:00
Peter Boström f78c1ba053 Fix 'gcc -Wextra -Wno-unused-parameter'. 2014-01-04 20:43:30 +01:00
Michael Stapelberg 2314f10778 Merge branch 'master' into next 2014-01-04 12:23:06 +01:00
Michael Stapelberg 5e07885d95 install i3-with-shmlog.xsession.desktop, overwrite symlink if it exists 2014-01-04 12:22:53 +01:00
Michael Stapelberg a32b6da712 Merge branch 'master' into next 2014-01-04 12:20:12 +01:00
Michael Stapelberg 2326ebfd63 enable shmlog when invoked as i3-with-shmlog, install symlink + .desktop file 2014-01-04 12:18:45 +01:00
Peter Boström 9c15b9504e Fix clang -Wextra except -Wunused-parameter.
Cleared all warnings that occur when passing
CFLAGS="-Wall -Wextra -Wno-unused-parameter" to make using clang 3.3 on
Linux x86-64.
2014-01-02 22:15:33 +01:00
Peter Boström 38b6936c25 Size resizebar according to container size. 2014-01-01 15:21:33 +01:00
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
Michael Stapelberg c3ff365072 install i3-save-tree(1) (Thanks Marcin) 2013-12-24 16:15:43 +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 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 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 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
Jean-Philippe Ouellet 755188220f fix the build on OS X
OS X doesn't have posix_fallocate() yet, so put
bf760d0241 in
    #if defined(__APPLE__)

the cd fails with:
    /bin/sh: line 0: cd: include: No such file or directory
so give it a path relative to the top directory
2013-11-26 19:56:45 +01:00
Lancelot SIX f22995393a Remove references to PATH_MAX macro
Since the macro PATH_MAX is not defined on every system (GNU/Hurd being
one of those who do not define it), we remove all references to this
macro. Instead, we use a buffer of arbitraty size and grow it when
needed to contain paths.
2013-11-24 13:50:29 +01:00
Michael Stapelberg 4f5e0e794f persist root window’s background contents to a pixmap
The commit title is fairly technical, so I’ll try to explain.

Recently, users of GDM3 (I’m sure) and LightDM (I think) have reported
that when switching to a new workspace, the contents of the previous
workspace are still visible. i3bar updates, though, so it is the X11
root window which is not being updated here.

When using GDM3, X11 will be started with -background none, and no
background pixmap or pixel is set. Then, apparently,
gnome-settings-daemon will display a fade animation from whatever is
currently on the window to the destination contents. I think this is to
avoid flickering when logging in, which would occur when just setting a
specific background pixmap or pixel.

So, this commit will, when i3 starts first (not on restarts), copy the
contents of the X11 root window (typicall a grey background, at least on
my machine with GDM3) into a pixmap and set that pixmap as background
pixmap. That way, the content will be preserved and one has a
background, instead of what is perceived as a bug :).

This commit has some chance of breakage, so I’m prepared to revert it
unless we can figure out the issues and roll forward.
2013-11-24 13:44:30 +01:00
Michael Stapelberg 1dbdd4fece Merge branch 'master' into next 2013-11-22 17:09:28 +01:00
Tony Crisci 57822e3ed4 Remove-child callback skips output content cons
Every container 'above' (in the hierarchy) the workspace content should
not be closed when the last child was removed.

Add a check for output content containers and do not handle them. These
cons are at the root of the output container with dockarea siblings.
They may be run through this callback when an output is killed with
RandR.

Fixes an issue that caused content cons to become urgent when the output
is killed with RandR.

fixes: #1121
2013-11-22 17:09:23 +01:00
Michael Stapelberg d3beff2339 make i3bar use libi3’s root_atom_contents()
This removes code duplication, which will be useful for a subsequent
commit.

Furthermore, we now don’t open X11 connections unnecessarily in some
corner cases.
2013-11-22 15:48:45 +01:00
Tony Crisci 9f955a1e01 Command 'move <direction>' moves across outputs
When 'move <direction>' is issued in the context of a container that
borders a workspace, and there is no suitable place within this
workspace for which this container can move, move the container to the
closest output in this direction instead.
2013-11-19 20:26:52 +01:00
Tony Crisci f3bf314662 Add sensible discretion to UnmapNotify drag abort
Only abort a drag action on UnmapNotify when the unmapping window is
managed on the current workspace.

fixes #1108
2013-11-10 19:54:49 +01:00
Tony Crisci 9ee26a608e Return DRAG_ABORT on UnmapNotify from drag_pointer
Add DRAG_ABORT to enum drag_result_t. DRAG_ABORT will indicate the drag
operation cannot be completed.

Return DRAG_ABORT on UnmapNotify, or when the keyboard or pointer cannot
be grabbed.

Add DRAGGING to return value for drag_result_t. DRAGGING is used
internally by drag_pointer to indicate the drag is in progress.

Change DRAG_CANCEL to DRAG_REVERT to clarify the distinction between
"abort" and "revert/cancel" actions.

Fixes an issue that caused i3 to crash when a user is dragging or
resizing a floating window that becomes destroyed.
2013-11-09 13:27:42 +01:00