Commit graph

250 commits

Author SHA1 Message Date
Mikkel Oscar Lyderik d26658fb35 Correctly determine default layout 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
Mykyta Holubakha 0f1cfdec61 Renamed to pango_markup 2016-04-24 20:35:21 +03:00
Mykyta Holubakha 53b53dd8c2 Added plaintext markup configuration 2016-04-24 19:57:35 +03:00
Drew DeVault e5d2efbfc9 Style issue 2016-04-17 11:38:12 -04:00
Drew DeVault 84fae94ab9 Flesh out pango markup implementation 2016-04-17 11:36:03 -04:00
Eric Engestrom 3e8081514d Fix spelling mistakes 2016-04-02 16:00:05 +01:00
Mikkel Oscar Lyderik 7be476c115 Add cmds new_window and new_float
Makes it possible to set default layout style for new windows and new
floating windows.

Close #556
2016-03-31 12:42:20 +02:00
Drew DeVault a12850444d New feature: adjust gaps with floating_mod+scroll
I made this configurable but I didn't make the command for it. That's
left as an exercise to an eager contributor.

    mod_scroll_behavior [gaps inner|gaps outer]

Would merge implementions of more behaviors for mod+scroll, if anyone
has some neato ideas.
2016-03-30 08:34:32 -04:00
Mikkel Oscar Lyderik 7878de5ccc Mark focused view focus_inactive on unfocused output 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
Mikkel Oscar Lyderik 3b05f92f76 Add border <none|normal|toggle|pixel> config 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik 86ea79ea6d Implement parsing of hide_edge_borders 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik cefcce48aa Make client/pango.h not depend on client/window.h 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik e2774aee3c Add default border colors 2016-03-30 00:47:58 +02:00
Drew DeVault b903f7f655 Implement some more on borders
Note that this segfaults ALL THE TIME in wlc code. Paging @Cloudef for
help, I'm at a loss.
2016-03-30 00:47:58 +02:00
Drew DeVault 4611bba3db Initial setup of window border rendering
Please don't complain to me about the performance of this
2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik 71a5350b68 Implement include command
The include command (`include <path>`) makes it possible to include sub
config files from the main config file (or from within other sub config
files).

The include command uses the following rules for including config files:

* the `path` can be either a full path or a path that is relative to the
  parent config. Shell expansion is supported, so it's possible to do
  `include ~/.config/sway.d/*`.
* The same config file can only be included once (to prevent include
  cycles). If a config is included multiple times it will just be
  ignored after it has been included once.
* Including a sub config file is the same as inserting the content of
  that file into the parent config, thus rules about overwriting
  bindsyms etc. works the same as for a single config.

Implement #542
2016-03-26 16:37:50 +01:00
Kevin Hamacher fb6dcce2ad Add graphical feedback to swaylock (#526) 2016-03-25 15:24:41 +01:00
Drew DeVault 5c85c018b4 Update to new WLC API 2016-03-24 14:08:53 -04:00
Mikkel Oscar Lyderik 2935e24cf5 Implement 'smart_gaps' feature from i3-gaps 2016-03-20 12:29:47 +01:00
Mikkel Oscar Lyderik f63512480c Remove unused panel_size (and fix rearrange)
desktop_shell.panel_size was only used to determine if sway should
rearrange the output when rendering the panel in the output_pre_render
hook. This is not needed since the output will have been arranged at
that point.
It also caused sway to rearrange all the time when running with two
or more different monitors/resolutions because panel_size kept changing
with every output_pre_render callback.

Should fix #514
2016-03-17 23:47:42 +01:00
Mikkel Oscar Lyderik 8ddafeeaae Fix assigning workspaces to outputs
It's possible to assign workspaces to certain outputs using the command:

    workspace <name> output <output>

However, this did not work in some cases where the workspace was
assigned before the given output was made available to sway.

This patch fixes those cases.
2016-03-04 16:44:49 +01:00
Mikkel Oscar Lyderik 67bbcceba1 Free config before exiting sway.
Apart from freeing the sway_config struct, this also terminates the
swaybars spawned by sway, since they are linked by PID to the bar config
structs.
2016-02-27 22:13:15 +01:00
Mikkel Oscar Lyderik e15a8a0376 Improve how swaybars are spawned 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik e4c1176b72 Differentiate between all or no outputs 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik bad4e22f3b Make sway spawn only one bar per bar config 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik 6d57f03028 Make single bar handle multiple outputs 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik 5e253fdd9a Correctly exit sway on errors.
Calling `exit` in sway_terminate prevents sway from correctly shutting
down (freeing data, cleanly terminating the ipc server, etc.).

A better way is to exit straight away if the failure occurs before
`wlc_run` and use sway_abort as usual if it occur when wlc is running.
2016-02-26 09:42:21 +01:00
Mikkel Oscar Lyderik b107fc6e5a Fix ipc event bit masks 2016-02-21 22:49:20 +01:00
Mikkel Oscar Lyderik 6f7cbf2eac Replace deprecated function wlc_output_get_pixels.
This makes IPC GET_PIXELS use the new `wlc_pixels_read` call instead of
the deprecated `wlc_output_get_pixels`.

The old version worked by passing a callback function to wlc which would
grab the pixels and send them to the IPC client.
The new version works by maintaining a list of clients who have
requested the pixels of some output and then grap and send the pixels in
the output_post_render hook of the `wlc_interface`.
2016-02-08 12:39:07 +01:00
Drew DeVault e5bb08cc18 Print /proc/<pid>/maps on segfault 2016-01-28 07:57:07 -05:00
crondog 0ee5547406 font: Allow adding font to the config. In prep for border titles
v2: Give default font and make bar use it if no bar font
2016-01-27 20:53:31 +11:00
Christoph Gysin a5345e807e extract cairo_set_source_u32() 2016-01-25 22:44:33 +02:00
Mikkel Oscar Lyderik 32ae26e519 Add quotes to multiword arguments.
This adds quotes around multiword arguments before they are passed to
`/bin/sh -c` in an exec command.

Example:

I connect to irc like this:

    exec termite -e "mosh server tmux a"

Without this patch the arguments are passed to sh as:

    termite -e mosh server tmux a

When it should be:

    termite -e "mosh server tmux a"

For the command to work.
2016-01-25 00:14:13 +01:00
Mikkel Oscar Lyderik ed227f5664 swaybar: move headers to include/bar 2016-01-24 15:55:58 +01:00
Mikkel Oscar Lyderik c6fc0033e1 swaybar: move core functionality to state.c 2016-01-24 14:22:19 +01:00
Drew DeVault a416715372 Revert "s/numlen/log10/g"
This reverts commit 038bb8cc7c.
2016-01-23 16:35:32 -05:00
Drew DeVault 038bb8cc7c s/numlen/log10/g 2016-01-23 15:51:38 -05:00
Cole Mickens 28081b7689 libinput 2016-01-19 06:51:36 -08:00
Mikkel Oscar Lyderik f8b260d4a1 Add support for bincode command
If a bindsym and bincode maps to the same combination, the last one will
overwrite any previous mappings.
2016-01-09 18:07:47 +01:00
Mikkel Oscar Lyderik 6392abe35b Implement IPC binding event (keyboard)
This implements the IPC binding event for keyboard bindings.  It is
slightly different from the i3 implementation [1] since sway supports
more than one non-modifier key in a binding. Thus the json interface has
been changed from:

    {
      ...
      "symbol": "t",
      ...
    }

to:

    {
      ...
      "symbols": [ "t" ],
      ...
    }

[1] http://i3wm.org/docs/ipc.html#_binding_event
2016-01-08 03:03:55 +01:00
Mikkel Oscar Lyderik 32cd3f70eb Add function for duplication a sway_binding 2016-01-08 03:03:55 +01:00
Mikkel Oscar Lyderik dffacea831 Add function for getting list of modifier names.
Get an array of modifier names from modifier masks.
2016-01-08 03:03:40 +01:00
Mikkel Oscar Lyderik 55f63935ab Implement bindsym --release
This is a "simple" version of --release (same as i3) that only supports
a binding that contain one normal key. e.g.:

    bindsym --release $mod+x exec somthing-fun

I didn't bother implementing it for a combination like `$mod+x+z` since
it is a bit tricky to get right and also a bit weird to actually do on a
keyboard.
2016-01-07 21:43:00 +01:00
Mikkel Oscar Lyderik 843e2ad2c1 Only send modifier event once for active modifiers
This makes sure that a modifier event is only sent for active bar
modifiers, and that it is only sent once for each of those modifiers.

An active bar modifier is a modifier defined for a bar with `mode hide`
and `hidden_state hide`.
2016-01-05 23:18:59 +01:00
Mikkel Oscar Lyderik 95e0f44c73 Move modifier name table to common/util.c
Lookup of modifier names is required in several places, thus it makes
sense to move it to a general place.
2016-01-05 18:36:24 +01:00
Mikkel Oscar Lyderik c20c63b677 Send IPC modifier event on bar_modifier up/down
Detects when a bar modifier key is pressed/released and sends a modifier
IPC event to any listeners (usually swaybars).

This way a swaybar can listen on the modifier event and hide/show the
bar accordingly (not implemented yet)

The modifier event looks like this:

    {
      "change": "pressed", // or released
      "modifier": "Mod4"
    }
2016-01-05 02:25:56 +01:00
Mikkel Oscar Lyderik 7727c9efbc Detect bar modifier pressed/released 2016-01-05 00:49:44 +01:00
Mikkel Oscar Lyderik aa2f754c64 swaybar: Implement binding_mode_indicator 2016-01-03 22:16:36 +01:00