Commit graph

1208 commits

Author SHA1 Message Date
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
Mikkel Oscar Lyderik 66c66c7304 Implement barconfig_update IPC event 2015-12-21 15:28:34 +01:00
Drew DeVault 7b015bf535 Merge pull request #388 from mikkeloscar/bar-commands
Handle bar commands outside config file
2015-12-21 09:04:42 -05:00
Mikkel Oscar Lyderik a96a5e0013 Handle bar commands outside config file
Our initial implementation of `bar {  }` assumed that the commands could
only be used in the config. This is not true for two commands:

* bar mode
* bar hidden_state

This patch makes it possible to issue these commands outside a bar
block, for instance through swaymsg

    $ swaymsg bar mode hide bar-0

This does not implement the `barconfig_update` IPC event which should be
trigged from these commands. I have added TODO's where this should be
added once implemented.
2015-12-21 14:33:27 +01:00
Drew DeVault 9d09f5e391 Merge pull request #387 from mikkeloscar/handle-term-signal
swaybar: Correct handling of SIGTERM.
2015-12-21 06:14:49 -05:00
Mikkel Oscar Lyderik 5c8a3afff9 swaybar: Correct handling of SIGTERM.
Swaybar did not correctly handle the SIGTERM sent from sway when
exiting, ultimately leaving the child status_command behind.
This should correctly handle the SIGTERM signal and terminate the
status_command.

Fix #386
2015-12-21 11:50:56 +01:00
Drew DeVault fc71c6303c Fix default swaybar font 2015-12-21 05:07:19 -05:00
Drew DeVault 5fbecba37a Merge pull request #381 from sce/fix_gaps
Fix gaps
2015-12-20 15:44:42 -05:00
S. Christoffer Eliesen f4b9c3856a layout: Fix edge_gaps off with top/left panels.
Since x/y won't be zero when there's a top or left panel in place, we
need to take those coordinates into account too.
2015-12-20 21:23:20 +01:00
S. Christoffer Eliesen ce54b4ff2e container: Fix inner gaps against screen edge. 2015-12-20 21:23:20 +01:00
Drew DeVault adf5b8fed7 Merge pull request #380 from mikkeloscar/bar-font-support
swaybar: Add font support
2015-12-20 13:30:11 -05:00
Mikkel Oscar Lyderik 83eb8d16aa swaybar: Add font support 2015-12-20 18:32:54 +01:00
Drew DeVault 3082245243 Merge pull request #373 from sce/per_panel_config
Per panel config
2015-12-20 12:05:32 -05:00
Drew DeVault fdb9ce52ef Merge pull request #378 from mikkeloscar/bar-pixel-perfect
swaybar: pixel perfect layout
2015-12-20 12:05:13 -05:00
Drew DeVault dfc23086fd Merge pull request #377 from progandy/optional-pixbuf
make gdk-pixbuf dependency really optional
2015-12-20 11:56:13 -05:00
Mikkel Oscar Lyderik d373a193ac swaybar: pixel perfect layout
This should make the bar workspace button layout identical to the layout
used in i3.
2015-12-20 17:52:33 +01:00
progandy 21014e606b make gdk-pixbuf dependency really optional 2015-12-20 17:37:52 +01:00
Drew DeVault 66554698a0 Update README screenshot
The new one has the top cut off, I didn't notice.
2015-12-20 09:30:13 -05:00
Drew DeVault b171047d82 Merge pull request #369 from crondog/master
swaybar: use height from config
2015-12-20 09:24:55 -05:00
Drew DeVault 33fb648938 Merge pull request #372 from sce/fix_swaybar_output_name_test
config: load_swaybars: Fix name comparison.
2015-12-20 09:23:34 -05:00
Drew DeVault 702cf053e2 Merge pull request #370 from sce/fix_free_bar
config: free_bar: Check if outputs is NULL.
2015-12-20 09:20:03 -05:00
Drew DeVault 05e48835f7 Make some dependencies optional
Closes #368
2015-12-20 09:14:30 -05:00
S. Christoffer Eliesen e45fd9b6c5 extensions: Track panels by wl_resource, position per panel.
Track each panel separately via its wl_resource. `set_panel_position`
might be called before `set_panel`, so reuse panel config.

Place the position in panel_config so that each panel has its own
position.
2015-12-20 12:54:34 +01:00
S. Christoffer Eliesen 6db0f6f80f extensions: panel_config->resource => wl_surface_res.
Change the name to something less ambigious.
2015-12-20 12:54:34 +01:00
S. Christoffer Eliesen 6ace37d0b1 config: load_swaybars: Fix name comparison. 2015-12-20 12:53:56 +01:00
S. Christoffer Eliesen 2779559b15 config: free_bar: Check if outputs is NULL.
bar_config.outputs is NULL if no output is explicitly defined in config
(ie. use for for all outputs).
2015-12-20 10:14:36 +01:00
crondog da6cd3cef7 swaybar: use height from config 2015-12-20 15:47:32 +11:00
Drew DeVault 3777c8993b Merge pull request #366 from mikkeloscar/fix-swaybar-high-cpu
swaybar: use select instead of busyloop
2015-12-19 10:44:47 -05:00
Mikkel Oscar Lyderik bc9b93f597 swaybar: use select instead of busyloop
Use of busyloop caused high cpu usage for sway because swaybar had to be
redrawn all the time. By using select instead the bar only has to be
redrawn when the status_command changes (i.e. every second) or when the
workspaces are updated.

Fix #345
2015-12-19 16:33:58 +01:00
Drew DeVault 616ea27e19 Merge pull request #364 from cyberhuman/master
Update readme dependency list and build instructions
2015-12-19 09:01:50 -05:00
Raman Varabets bb4339f62e Update readme dependency list 2015-12-19 15:42:16 +08:00