Commit Graph

135 Commits (5d4a93486423113737b64a836b8c5710cae46bcf)

Author SHA1 Message Date
Michael Stapelberg 19cbd3cbec code style fixes for the previous commit
• our function names use underscores
• rewrote the function’s comment
• function comments must be in the source _and_ in the header
• no blank lines after function signatures
2012-11-25 20:55:49 +01:00
Adrien \"schischi\" Schildknecht f41fa1baa1 The command to resize a floating window now checks the minimum and maximum size. 2012-11-25 20:52:56 +01:00
Deiz fdcba7b91a Replace the discrete 'split' Con property with a simple function. 2012-10-04 17:48:08 +02:00
Deiz f4b09862fc Maintain relative positioning when moving floating windows between outputs. 2012-10-03 00:14:57 +02:00
Michael Stapelberg cd2a1267c8 Merge branch 'master' into next 2012-09-28 18:24:04 +02:00
Michael Stapelberg 8480b4cb58 Bugfix: don’t crash when dragged floating window closes (Thanks darkraven)
Previously, while the loop would not be executed anymore, the callback
(for actually repositioning the window after a MotionNotify) would still
get called once. This commit avoids that, thus fixing the crash.

fixes #819
2012-09-28 18:23:01 +02:00
Deiz b235c469c1 Display appropriate cursors when resizing or moving floating windows. 2012-09-23 22:05:19 +02:00
Michael Stapelberg 884627ef20 use I3__FILE__ for DLOG, leave __FILE__ as is
See also commit 0e752070ac, which broke
source code listings in gdb unless you cd into i3/src. This should give
us best of both :-).
2012-08-12 12:19:47 +02:00
Philipp Middendorf 6225a8983d Bugfix: Properly resize transient floating windows with a decoration
fixes #770
2012-08-12 00:36:26 +02:00
Michael Stapelberg 0e752070ac explicitly set filenames to $(basename __FILE__)
This makes the debug log a bit more readable, especially since commit
48f1e383ca
2012-08-07 09:55:52 +02:00
Michael Stapelberg 1a62c398ac Bugfix: Attach con to nc before calling con_border_style_rect() 2012-08-07 01:13:37 +02:00
Philipp Middendorf 9d9a1d9d29 Bugfix: Add deco_height only when in "normal" border mode.
Also, use con_border_style_rect instead of hard-coded values to
determine the border size.
2012-08-07 01:05:16 +02:00
Michael Stapelberg 8a1c8115ca fix a few warnings/places where the clang static analyzer complains 2012-08-05 16:34:38 +02:00
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