Commit graph

765 commits

Author SHA1 Message Date
Mikkel Oscar Lyderik 89bb6a4a42 Don't rearrange views behind swaylock.
Fix #481
2016-02-25 14:42:48 +01:00
Mikkel Oscar Lyderik c9d9dd7516 Check for empty ws on view destroyed.
In some cases destroying a view can result in an empty and inactive
workspace, which should be destroyed.

This handles those cases.
2016-02-25 13:36:25 +01:00
Mikkel Oscar Lyderik ee32bc3aef Send workspace ICP event on ws destroy/empty.
There is no 'destroy' change type in the i3 IPC so this uses `empty` to
notify about empty workspaces (which will be destroyed from sway right
after).
2016-02-25 12:59:22 +01:00
Mikkel Oscar Lyderik 739ba902e0 Prevent crash when showing scratchpad on new ws.
Fix #469
2016-02-25 11:43:07 +01:00
Mikkel Oscar Lyderik 016a77424a Prefer named output config over wildcard config.
This makes sure that a named output config is applied before the
general wildcard config when a new output is created. This ensures that
the config:

    output * ...
    output NAME ...

behaves the same way as:

    output NAME ...
    output * ...
2016-02-12 13:45:47 +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
Mikkel Oscar Lyderik be6455b295 Squash trailing whitespace 2016-02-08 12:31:13 +01:00
Mikkel Oscar Lyderik bacd40d6db Fix clang warnings 2016-02-08 12:30:42 +01:00
Drew DeVault 4546ce1188 Add wlc-render.h to handlers.c 2016-02-08 12:20:24 +01:00
crondog 7916eb70b9 commands: move position mouse
Bounds checking works ok except it overlaps the bar. Just like with
normal floating. Should be fixed once swaybar is fixed.
2016-01-28 22:10:56 +11: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
Drew DeVault f1f4791a3b Fix returning to sway after swaylock completes 2016-01-26 18:33:50 -05: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
Drew DeVault fe35ea633a Merge pull request #457 from mikkeloscar/move-view-fix
Fix rendering of view when moving to new workspace
2016-01-23 16:48:00 -05:00
Drew DeVault ef407559e2 Add new wlc thing to views 2016-01-23 16:35:39 -05: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
Quentin Glidic 449617f104 commands: Fix memory allocation in assign
Also use the safer snprintf since we just computed the size.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-01-23 20:22:51 +01:00
Quentin Glidic 43483d8fee commands: Fix usage of arrow in assign
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-01-23 20:22:51 +01:00
Christoph Gysin 2341ae64ad sway-input: fix typo 2016-01-23 14:08:52 +02:00
Mikkel Oscar Lyderik 102719c7dd manpage: fix sway-input layout 2016-01-22 19:26:13 +01:00
Mikkel Oscar Lyderik 54111839a4 manpage: add references sway.5 <-> sway-input.5 2016-01-22 19:26:13 +01:00
Mikkel Oscar Lyderik e953f634d9 Fix generating sway-input.5 manpage 2016-01-22 19:26:13 +01:00
Mikkel Oscar Lyderik 4cbb09d566 cmake: fix libinput include dirs 2016-01-22 05:17:33 +01:00
crondog cd0eaf00da Prevent ipc from crashing sway 2016-01-22 12:29:18 +11:00
Mikkel Oscar Lyderik fa0526f3df Fix rendering of view when moving to new workspace
This is a possible fix for #384.

To be honest I don't fully understand why this bug is happening, but I
have narrowed it down to the view stack in wlc and how sway orders views
in very specific situations (those described in #384).

Anyway this should fix the problem by eliminating the call to
`wlc_view_bring_to_front` which isn't really needed anyway since sending
all invisible views to the back is the same as bringing all visible
views to the front (rotating the view stack).
2016-01-21 22:28:26 +01:00
Mikkel Oscar Lyderik 2c43bd2ac8 Only update visibility if WS isn't destroyed after
No need to update visibility if the workspace will be destroyed right
after.
2016-01-21 22:05:06 +01:00
Yacine Hmito c487cf71a5 Fix issue #455
CMAKE_INSTALL_FULL_SYSCONFIG is not actually passed to
the C preprocessor. I remember it working, so I must have
messed up somewhere last time I touched this.
This is fixed by manually passing its value to the C preprocessor
through the SYSCONFDIR definition
2016-01-21 21:08:18 +01:00
Drew DeVault d969a1dec0 Fix memory leak in config.c
Thanks @jollywho
2016-01-21 11:18:13 -05:00
Mikkel Oscar Lyderik ac740271a5 Strip stray whitespace 2016-01-21 17:03:21 +01:00
Cole Mickens 28081b7689 libinput 2016-01-19 06:51:36 -08:00
crondog 81caf89ff8 cmd_assign
This implements cmd_assign. Basically a copy and paste from
cmd_for_window however it has → handling and injects a `move container to
workspace`
2016-01-15 16:03:34 +11:00
Mikkel Oscar Lyderik 0ba3f08f52 Strip quotes from workspace name v2
This is a more general fix for #444

This reverts part of commit 222f0d44fc.
2016-01-11 03:42:45 +01:00
Mikkel Oscar Lyderik fc8e5703a5 Strip quotes of each argv when handling command 2016-01-11 03:39:34 +01:00
Mikkel Oscar Lyderik 222f0d44fc Strip quotes from workspace name.
Fix #444

This is a temporary fix, the real fix is to store the commands as a
formatted argv array, so they don't have to be reformatted all over the
place.
2016-01-11 03:13:36 +01:00
Mikkel Oscar Lyderik 15621ea8ff Add backwards compatability for binding event 2016-01-09 20:56:42 +01:00
Mikkel Oscar Lyderik e3ddcaabc4 Add bindcode to binding events. 2016-01-09 20:31:18 +01: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 cb8ac7fd4a Unescape string after doing var replacement
Fix #426
2016-01-08 23:30:18 +01:00
Mikkel Oscar Lyderik 15cbc53a77 Make IPC binding event support a compile time opt. 2016-01-08 15:03:25 +01:00
Mikkel Oscar Lyderik 14147ac056 Reduce duplicate code 2016-01-08 14:27:41 +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 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
Drew DeVault 8f5de70c93 Merge pull request #434 from mikkeloscar/detect-modifier
Send IPC modifier event on bar_modifier up/down
2016-01-06 07:26:54 -05:00
Mikkel Oscar Lyderik 9186455a3c Merge branch 'master' of github.com:SirCmpwn/sway 2016-01-05 23:44:03 +01:00
Mikkel Oscar Lyderik 364e37a1eb Fix whitespace issues. 2016-01-05 23:42:40 +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
Jøhannes Lippmann 648db4016f Clearer order of locations searched for config file.
The i3wm config locations are visited _before_ using the fallback
configs. The man page was confusing - it talked about the fallback
configs first, but also said they are looked at "at last". By changing
the order of the sentences, this should be clearer.
2016-01-05 22:06:02 +01:00
Mikkel Oscar Lyderik 2e0ef533f2 Init layout before checking config 2016-01-05 19:16:46 +01:00