Commit graph

37 commits

Author SHA1 Message Date
Drew DeVault 67a9a94596 Overwrite alpha when drawing borders
This does two important things when using alpha:

1. At corners, borders don't double in opacity
2. Foreground elements (text) can be made transparent and you can see
fully through to the wallpaper
2016-10-12 22:42:23 -04:00
D.B 77f99480ae draw indicator border only for non-floating 2016-10-08 09:15:34 +02:00
Nicolas Cornu 2d82586c88 Add constant scale factor in get_text_size
af44154 forget one "get_text_size" made it possible to
do a format string by setting title bar.
2016-10-07 20:38:56 +02:00
D.B 873dfc07f3 Use indicator border color only when needed.
Indicator border color is now used only when a container is the only
child. Reason for the change? i3 does it this way. Sway container
borders are now a bit more similar to i3 ones.
2016-09-10 16:11:33 +02:00
Drew DeVault af44154119 Fix constant scale factor in font code 2016-09-05 11:52:52 -04:00
Drew DeVault 416417a54c Reorganize includes 2016-09-01 08:18:37 -04:00
Guillaume Brogi fc492a4da8 Add support for indicator color 2016-08-11 23:57:38 +02:00
D.B 9c91952aec Display class in tab title if app_id is null
This is a feature that can't work the same as i3, because there is no
real window classes in wayland. This way, we avoid null titles as much
as possible.
2016-08-07 08:37:26 +02:00
Tony Crisci 81eb9ea12c Simplify focus setting
Merge the main rendering paths of all containers to make focus setting a bit
simpler and easier to follow.
2016-08-03 23:24:53 -04:00
Drew DeVault 31ce010861 Fix segfault in border.c 2016-08-02 07:35:25 -04:00
Tony Crisci b39249508f Refactor functions to update container borders
Replace `update_view_border()` with `update_container_border()`. The latter
should handle both the case where the container is a view or if the container
has children.
2016-07-31 20:32:40 -04:00
Tony Crisci f78d07d39b Implement focus handling for containers
The previous implementation of focus handling assumed that only views can be
focused. Containers can also be focused with a command like `focus parent` or
`focus child`.

Change `set_focused_container()` to handle the case of the given container
being a container with children and update borders accordingly.
2016-07-31 18:10:33 -04:00
D.B 8d0048c8d5 properly hide top border inside tabbed/stacked
When titlebar is hidden, top border of the topmost view inside
tabbed/stacked container will not be drawn. This is changed in layout.c

On the other hand, top border should be drawn sometimes, for example
when titlebar is hidden on a view that is not the topmost inside
tabbed/stacked container. This is changed in border.c
2016-07-30 15:12:34 +02:00
Tony Crisci badfcf7c76 Render focused stack/tab children focused
Whenever a stacked or tabbed container has focused, paint the titlebars of all
its child windows to be focused as well to indicate the parent stack/tab
container has the focus.
2016-07-27 23:16:58 -04:00
D.B 5d250f3da6 Construct titles of nested tabbed/stacked containers from app_id instead of title 2016-07-18 12:35:50 +02:00
D.B ad7605675e refactor swayc_tabbed_stacked_parent into _ancestor and _parent and use where needed 2016-07-16 15:34:43 +02:00
Jasen Borisov 870a7aaad9 Fix issue #661.
Borders are now drawn correctly (same behavior as i3) for tabbed and
stacked containers, when the children have 'border none' set.
2016-05-18 04:25:32 +01:00
Mikkel Oscar Lyderik ae5164f1d4 Update view title of tabbed/stacked windows
Requires Cloudef/wlc@80bf003

Fix #623
2016-05-01 22:08:46 +02:00
Mikkel Oscar Lyderik ddd5b69b99 border: clear buffer on fullscreen views
This patch makes sure to clear the border buffer of fullscreen view so
the border doesn't get drawn behind a fullscreen view, which would be
visible if the view was transparent.
2016-04-27 11:24:28 +02:00
Mikkel Oscar Lyderik 27066c6328 Only check tabbed_stacked_parent for focused windows 2016-04-27 11:24:28 +02:00
Mikkel Oscar Lyderik 6c7ed7e7cb Add title to nested tabbed/stacked containers 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik 3e1f78ab26 Add support for nested tabbed/stacked containers 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik 3955c66ce8 Use tabs for indentation 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik 969f76a1a4 Make floating border fixes work with tabbed/stacked code 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik 8d700fe008 Fix problems with floating windows
Makes any tabbed/stacked layout a container to separate from floating
windows which may be attached to a workspace.
2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik ec7ff769c7 Tabbed and stacked layout 2016-04-25 00:00:49 +02:00
Mykyta Holubakha a25c35f859 Passing missing argument to get_text_size 2016-04-24 10:39:42 +03:00
Drew DeVault 84fae94ab9 Flesh out pango markup implementation 2016-04-17 11:36:03 -04:00
Chang Liu 91d2a505b2 Plug two memory leaks
Plug two memory leaks introduced in the border drawing code.
2016-04-12 12:35:50 +12:00
Kevin Hamacher 115b482ed8 Use border background color as border background 2016-04-03 16:52:40 +02:00
crondog b02be709cd Fix window borders
This fixes floating borders when moving outside of the output. Not sure what
happens with dual screen as I only have 1 monitor
2016-04-03 10:37:16 +10:00
Kevin Hamacher 3953b064f5 improve endianess handeling 2016-04-02 21:16:57 +02:00
Drew DeVault ebead7a9bf Fix crashes with borders 2016-03-30 09:21:30 -04:00
Mikkel Oscar Lyderik 6fa6c27f3d Update window title when it changes 2016-03-30 01:01:05 +02:00
Mikkel Oscar Lyderik 7878de5ccc Mark focused view focus_inactive on unfocused output 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik a87a5dbdd5 Comment endianness 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik 5a13cb0ed1 Implement borders
The borders are implemented as a surface/buffer attached to each view
which is sent to and rendered by wlc in the view_pre_render callback.

All the drawing logic is handled in sway/border.c and all the logic for
calculating the geometry of the border/view is handled in
`update_geometry` in sway/layout.c (same place as gaps are calculated).
2016-03-30 00:47:58 +02:00