Commit graph

1288 commits

Author SHA1 Message Date
Mikkel Oscar Lyderik e7aef1e23c swaybar: if-else style fixes 2015-12-27 13:26:37 +01:00
Mikkel Oscar Lyderik d21b15a4be swaybar: Add support for Airblade i3bar extensions
This extends the i3bar protocol implementation with the following
features from @Airblade/i3:

* background
* border
* border_top, border_bottom, border_left, border_right

A block will now be rendered like this:

```
(border_left + margin) + width + (margin + border_right) + sep
```

Where `border_left/border_right` and their related margin is only drawn
if the `border` is specified and the border has a width > 0 (default is
1).

`border_top` and `border_bottom` does not affect the height of the bar
(no margin is added), thus it will be drawn behind the text if it is too
big. The user should specify a bar height if more space between
top/bottom borders are required.
2015-12-27 13:18:55 +01:00
Drew DeVault 33a74bfb93 Merge pull request #408 from mikkeloscar/add-focus-sibling
Focus new sibling added to container
2015-12-25 14:52:14 -07:00
Mikkel Oscar Lyderik cf64000e21 Focus new sibling added to container
This makes sure that the window being added to a container gets focus.
2015-12-25 22:32:42 +01:00
Drew DeVault ed46fa7230 Merge pull request #407 from mikkeloscar/trigger-on-move-floating
Trigger workspace init event (floating)
2015-12-25 10:13:22 -07:00
Mikkel Oscar Lyderik 5d07c61330 Trigger workspace init event (floating)
Triggers workspace init event when moving a floating window to a new
workspace.

This is a follow up on #391 which didn't handle floating windows.
2015-12-25 18:02:12 +01:00
Drew DeVault 3bcb3b332d Merge pull request #406 from mikkeloscar/fix-swaybar-json
swaybar: Fix json related crash.
2015-12-25 08:06:50 -07:00
Mikkel Oscar Lyderik 26d2381040 swaybar: remove random whitespaces 2015-12-25 15:59:00 +01:00
Mikkel Oscar Lyderik e370187394 swaybar: Fix json related crash.
This should fix the random json related crashes in swaybar.

The crashes occured because the same socket was used for listening on
workspace events and requesting workspace info, resulting in a
unreliable message queue on the socket.

The solution is to use one socket for the events and one socket for
reliably requesting workspace/output info.
2015-12-25 15:57:04 +01:00
Drew DeVault 2179ac353c Merge pull request #403 from crondog/master
swaybar: min_width and align
2015-12-24 15:09:36 -07:00
Drew DeVault 625f90b773 Merge pull request #405 from robotanarchy/add-voidwiki-link-to-readme
Readme: add link to sway article in Void Linux wiki
2015-12-24 15:05:40 -07:00
crondog 8e8ec6d92b Merge branch 'master' of https://github.com/SirCmpwn/sway 2015-12-25 08:59:01 +11:00
robotanarchy 4ec427c0f2 Readme: add link to sway article in Void Linux wiki 2015-12-24 22:50:10 +01:00
Drew DeVault deb1546be3 Merge pull request #402 from progandy/without-fgets
swaybar: read status line without fgets
2015-12-24 07:04:35 -07:00
Drew DeVault 3e84c4b307 Merge pull request #404 from StephenBrown2/readme_feature_support
Add references to other feature support issues to README
2015-12-24 07:02:37 -07:00
progandy 21541e9e64 swaybar: Replace fgets with read and own buffer 2015-12-24 13:20:37 +01:00
Stephen Brown II d1af8c45be Add references to other feature support issues to README 2015-12-23 21:49:05 -06:00
Drew DeVault 6ed2485134 Merge pull request #401 from mikkeloscar/travis-clang-build
Add clang build to travis
2015-12-23 19:56:12 -07:00
crondog edd93b5b55 swaybar: min_width and align 2015-12-24 13:55:17 +11:00
progandy b66c51ea2c swaybar: fix array indices in i3json_handle 2015-12-24 01:21:29 +01:00
Mikkel Oscar Lyderik c0568395ee Add clang build to travis 2015-12-23 22:23:27 +01:00
Drew DeVault ac23fa5f20 Merge pull request #400 from gpyh/forgot_include
Bugfix: Added include(GNUInstallDirs)
2015-12-23 16:49:43 +00:00
Yacine Hmito 284720cf5f Added include(GNUInstallDirs)
Fixes configuration not properly installed since f02cf75
2015-12-23 16:40:28 +01:00
Drew DeVault f438d3897d Merge pull request #398 from juju2143/bug-correction-1
swaygrab: Fix memory leak when recording videos
2015-12-23 07:53:08 -05:00
Drew DeVault 72043b231d Merge pull request #399 from gpyh/dont-hardcode-path
Use SYSCONFDIR as recommended
2015-12-23 07:52:55 -05:00
Yacine Hmito f02cf75ff3 Use SYSCONFDIR as recommended
- swaylock config path not hardcoded anymore
- the unusual and weird FALLBACK_CONFIG_DIR is no more
2015-12-23 12:22:48 +01:00
Julien Savard 7b00eab8ad swaygrab: Fix memory leak when recording videos 2015-12-22 23:47:07 -05:00
Drew DeVault 23df7ed502 Merge pull request #396 from crondog/fixbar
Stop swaybar from not rendering after the first go around
2015-12-22 19:47:12 -05:00
crondog bd74320da9 Stop swaybar from not rendering after the first go around
I am not sure if this is a correct issue/fix but on my system at least
after an i3bar protocol is detected this while loop never goes back
around meaning it doesnt process the status line anymore.
2015-12-23 10:49:21 +11:00
Drew DeVault 27848b41ab Merge pull request #394 from progandy/i3bar-json-protocol
swaybar: I3bar json protocol
2015-12-22 12:19:51 -05:00
progandy 8fefdb3c64 swaybar: fix memory leaks 2015-12-22 17:54:47 +01:00
progandy d060d0a39f swaybar: add a visible separator between elements 2015-12-22 17:54:38 +01:00
progandy aa5930c966 swaybar: Improve i3bar proto implementation
Also reintroduce plaintext fallback for simple status lines.
2015-12-22 17:34:37 +01:00
progandy d37169a927 swaybar: fix whitespace 2015-12-22 17:26:40 +01:00
Drew DeVault 8a22ac3966 Initialize id, part two 2015-12-22 08:21:13 -05:00
Drew DeVault 7c06ef35de Initialize ID 2015-12-22 08:14:50 -05:00
crondog 70b24fbb1f Clean up a bit 2015-12-22 22:49:41 +11:00
crondog d1f6f45cb3 Make start on i3bar json parsing 2015-12-22 22:36:57 +11:00
Drew DeVault 91c102a897 Merge pull request #393 from robotanarchy/musl-libc-compatibility
musl libc compatibility
2015-12-21 20:42:08 -05:00
Drew DeVault 5a13d19d49 Merge pull request #391 from mikkeloscar/trigger-workspace-ipc
Trigger ipc_event_workspace in all cases
2015-12-21 20:37:55 -05:00
robotanarchy c3e9ee5e43 replace non-standard qsort_r with qsort
I've tried to make as few changes, as possible.

Usually the reason for using qsort_r is, that you can pass an extra userdata pointer to the
compare function. However, in sway list_sort wrapped qsort_r and always called a wrapper
function for comparing, the wrapper function then had the real compare function as argument.
The only thing, that the wrapper function does, is dereferencing the 'left' and 'right' function
arguments before passing them to the real compare function.

I have renamed list_sort to list_qsort to avoid confusion (so nobody tries to use list_qsort like
list_sort) and removed the wrapper functionality. Now the dereferencing must be done in the
compare function, that gets passed.

Some compare functions were used in both list_sort and list_seq_find. To make the difference
clear, I've added a '_qsort' suffix to the compare functions, that are intended to be used with
the new list_qsort. (In other words: list_qsort is not compatible anymore with list_seq_find).

- Changed and renamed function (it isn't used anywhere but in commands.c, and only for sorting):
	compare_set -> compare_set_qsort
- New wrapper functions:
	sway_binding_cmp_qsort (for sway_binding_cmp)
	sway_mouse_binding_cmp_qsort (for sway_mouse_binding_cmp)
2015-12-22 00:38:18 +01:00
robotanarchy 470e59b291 fix backtrace detection in CMake
works on arch (glibc) and void linux (tested with musl libc) now
2015-12-22 00:32:41 +01:00
Mikkel Oscar Lyderik 50b04884b6 Trigger ipc_event_workspace in all cases
This makes sure that the workspace IPC event is triggered when needed.

Fixes #382 while making sure that the IPC event is only triggered once.
2015-12-21 23:07:52 +01:00
robotanarchy 03c041dd30 add -fPIC flag (position independent code) like in wlc
Linking fails otherwise:

Linking C executable ../bin/sway
/usr/bin/ld: CMakeFiles/sway.dir/commands.c.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
CMakeFiles/sway.dir/commands.c.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
sway/CMakeFiles/sway.dir/build.make:442: recipe for target 'bin/sway' failed
2015-12-21 19:10:49 +01:00
robotanarchy 94cac7a014 use CMake's FindBacktrace for backtrace feature detection 2015-12-21 19:01:17 +01:00
robotanarchy 3dd2393797 remove unused execinfo.h include from debug_log.c 2015-12-21 18:57:26 +01:00
Drew DeVault 442a54c38b Merge pull request #390 from mikkeloscar/workspace-ipc-event
Don't skip all clients on ipc_workspace_event.
2015-12-21 09:49:55 -05:00
Drew DeVault fb91d55b92 Merge pull request #389 from mikkeloscar/bar-commands
Implement ipc_event_barconfig_update
2015-12-21 09:49:32 -05:00
Mikkel Oscar Lyderik 42e5b4b032 Don't skip all clients on ipc_workspace_event.
Only clients not subcriped to the workspace event should be skipped.
2015-12-21 15:40:01 +01:00
Mikkel Oscar Lyderik c803b79764 Trigger event on bar mode|hidden_state commands 2015-12-21 15:31:09 +01:00