Commit Graph

122 Commits (cab8e3c46f825b5c7ff9f7008987b11e3163c83a)

Author SHA1 Message Date
Michael Stapelberg fb4ee17b05 Merge branch 'master' into next 2012-08-04 16:10:37 +02:00
Michael Stapelberg 74510c59c7 floating_fix_coordinates: properly deal with negative positions 2012-08-04 16:09:16 +02:00
Michael Stapelberg de94f6da1a Introduce splith/splitv layouts, remove orientation
With this commit, the "default" layout is replaced by the splith and
splitv layouts. splith is equivalent to default with orientation
horizontal and splitv is equivalent to default with orientation
vertical.

The "split h" and "split v" commands continue to work as before, they
split the current container and you will end up in a split container
with layout splith (after "split h") or splitv (after "split v").

To change a splith container into a splitv container, use either "layout
splitv" or "layout toggle split". The latter command is used in the
default config as mod+l (previously "layout default"). In case you have
"layout default" in your config file, it is recommended to just replace
it by "layout toggle split", which will work as "layout default" did
before when pressing it once, but toggle between horizontal/vertical
when pressing it repeatedly.

The rationale behind this commit is that it’s cleaner to have all
parameters that influence how windows are rendered in the layout itself
rather than having a special parameter in combination with only one
layout. This enables us to change existing split containers in all cases
without breaking existing features (see ticket #464). Also, users should
feel more confident about whether they are actually splitting or just
changing an existing split container now.

As a nice side-effect, this commit brings back the "layout toggle"
feature we once had in i3 version 3 (see the userguide).

AFAIK, it is safe to use in-place restart to upgrade into versions
after this commit (switching to an older version will break your layout,
though).

Fixes #464
2012-08-04 03:13:24 +02:00
Pavel Löbl d13ba7ca53 Fix floating precision bug
When calculating coordinates we should multiply at first otherwise
we lose precision when i3 is compiled without sse2 support.

The following code prints "Res1: 348 Res2: 349" when compiled with
-O0 -mno-sse2 and "Res1: 349 Res2: 349" with -O0 -msee2.

Note that -msse2 is default flag on 64bit OSes.

int main() {
  double a = 349.0 / 768;
  double b = 349.0 * 768;
  int res1 = a * 768;
  int res2 = b / 768;
  printf("Res1: %d Res2: %d\n", res1, res2);
  return 0;
}

Thanks guys for helping me to hunt down this one.
2012-05-06 14:13:59 +02:00
Michael Stapelberg 206b96202c Use (void) instead of () for functions without args (Thanks fernandotcl)
See also:
http://article.gmane.org/gmane.linux.kernel/1268792

The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors, such
as the one which was fixed with commit 0ea64ae4.
2012-03-31 10:53:04 +02:00
Michael Stapelberg e09e077b76 Merge branch 'master' into next 2012-03-21 20:24:29 +01:00
Michael Stapelberg afed6da0e5 Bugfix: Fix restart with for_window floating configuration (Thanks garga)
Fixes: #668

Calling tree_close with dont_kill_parent=true will avoid it from closing the
workspace if it’s empty (and it’s temporarily empty, because 'floating disable'
detaches, then re-attaches the window).
2012-03-21 20:14:50 +01:00
D Thompson 82146fcebf Implement support for user configuration of constraints on floating window dimensions. 2012-02-16 18:31:28 +00:00
Michael Stapelberg 4f98bbf5ff Bugfix: Obey workspace_layout when re-inserting floating containers (+test) (Thanks aksr)
The code wasn’t using con_attach and therefore didn’t obey workspace_layout.

Fixes: #631
2012-02-07 17:41:00 -05:00
Michael Stapelberg 077d2433a7 Bugfix: Fix coordinates when the rect of an output changes (Thanks Paul)
Fixes #623
2012-01-21 15:07:53 +00:00
Michael Stapelberg cb4c9b9d27 Bugfix: Position floating windows exactly where their geometry specified (Thanks B-Con)
Fixes #619
2012-01-21 14:20:55 +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 4fba2d5f91 Bugfix: Correctly check boundaries and reassign floating windows when moving (Thanks xpt)
Fixes: #592
2011-12-18 17:24:27 +00:00
Michael Stapelberg ed66a30410 mark parameters const 2011-11-10 19:17:36 +00:00
Michael Stapelberg 9d15a00ba8 introduce sasprintf() in libi3, use it everywhere 2011-10-23 13:16:56 +01:00
Michael Stapelberg 42d355f2b7 normalize modelines/headers across src/*.c 2011-10-22 23:40:02 +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 e6a854a742 Remove obsolete code for floating focus 2011-09-17 19:29:06 +01:00
Michael Stapelberg 7a38d8ac56 Merge branch 'master' into next 2011-09-17 14:13:05 +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 ad568aa8c1 Merge branch 'master' into next 2011-09-14 23:00:02 +01:00
Michael Stapelberg 6b541d382b Bugfix: Don’t fix floating coordinates when reassigning (fixes flickering)
This fixes flickering when moving floating windows between different monitors.
2011-09-14 22:58:51 +01:00
Michael Stapelberg 16188af8bf Merge branch 'master' into next 2011-08-28 15:47:35 +02:00
Michael Stapelberg 5618875df8 Bugfix: Make 'floating enable' check for dock windows (Thanks edelkind)
Fixes #501
2011-08-28 15:46:50 +02:00
Michael Stapelberg 6c42a179ec Merge branch 'master' into next 2011-08-27 13:03:20 +02:00
Michael Stapelberg 4c01dbd726 Bugfix: Don’t always focus floating windows (fixes focus stealing with assignments) (+test) (Thanks aksr) 2011-08-27 13:02:44 +02:00
Michael Stapelberg 75c11cb894 Merge branch 'master' into next 2011-08-24 23:00:12 +02:00
Michael Stapelberg 698d97cd02 Bugfix: Correctly warp floating windows when using the 'move' command 2011-08-24 22:59:46 +02:00
Michael Stapelberg 37a40671c9 Merge branch 'master' into next 2011-08-24 22:43:31 +02:00
Michael Stapelberg 62e9eab4e5 Merge branch 'master' into next
Conflicts:
	src/floating.c
2011-08-24 22:43:15 +02:00
Michael Stapelberg 7558c1ddbd Bugfix: Correctly handle current_output == NULL
Fixes t/66-assign.t
2011-08-24 22:41:17 +02:00
Peter Bui a33bfa81d2 Move centering code to before sanity check 2011-08-24 22:27:15 +02:00
Michael Stapelberg c527497a4b Merge branch 'master' into next 2011-08-24 16:58:47 +02:00
Michael Stapelberg 247e115835 Bugfix: Correctly place floating windows on their appropriate output (Thanks kraM)
Fixes #452

This might also fix problems with Firefox where Firefox only displays a white
window (my guess is that it mapped a floating window outside of the actually
visible area for some reason).
2011-08-24 16:57:35 +02:00
Mateusz Poszwa 42db9de7ec Add new_float config option.
This option sets the default border style for containers automatically put into floating mode.

Fixes #264
2011-08-09 09:29:53 +02:00
Michael Stapelberg cd5e74bd8e Bugfix: Call tree_render() before starting the dragging when dragging a floating window (Thanks eeemsi)
Fixes #462
2011-08-06 18:53:39 +02:00
Michael Stapelberg bc98185f85 Bugfix: Handle (and free) the last_motion_notify 2011-07-31 21:21:45 +02:00
Michael Stapelberg 22de7593c5 Bugfix: free() the grab_pointer reply 2011-07-31 19:52:58 +02:00
Michael Stapelberg 6c35a0b93b handle the xcb_grab_pointer reply 2011-07-31 19:48:39 +02:00
Michael Stapelberg ed30043950 Bugfix: Also abort drag_pointer after XCB_KEY_PRESS / XCB_KEY_RELEASE (Thanks eeemsi) 2011-07-28 21:01:34 +02:00
Michael Stapelberg 1585d942ea Make workspace_layout handle all cons at workspace level, not only the first one (+test)
This makes opening new windows on workspace level and moving windows to the
right/left more like in the old i3.
2011-06-02 17:21:38 +02:00
Michael Stapelberg 03cc490f0e Bugfix: fix crash when disabling floating mode 2011-05-16 20:51:29 +02:00
Michael Stapelberg 167bdd26b7 Argument for 'kill' for killing a specific window (now default) or the whole client (+test)
Use 'kill window' to kill a specific window (for example only one specific
popup), use 'kill client' to kill the whole application (or X11 connection to
be specific).
2011-05-13 20:41:03 +02:00
Michael Stapelberg e73c171e0d Bugfix: assign BORDER_BOTTOM instead of BORDER_RIGHT (Thanks Jan) 2011-05-06 13:09:50 +02:00
Michael Stapelberg 7e51f626ef Bugfix: Before rendering, attach the con to its floating_con
Otherwise, the rendering will produce negative coordinates.
2011-05-02 11:06:13 +02:00
Michael Stapelberg b2754fd679 Bugfix: When re-assigning floating windows to a different output, use the last focused workspace, not the first 2011-05-02 11:05:50 +02:00
Michael Stapelberg d28008aa63 Bugfix: Correctly render decorations in tabbed containers (don’t overlap)
This fixes a regression introduced in b644fb5f26.
2011-05-01 18:48:30 +02:00
Michael Stapelberg 3d5af35fa4 Bugfix: Center floating windows with invalid coordinates on current ws 2011-04-18 19:36:10 +02:00