Commit graph

41 commits

Author SHA1 Message Date
Daniel Eklöf
1079bca3eb
Silence “variable length array bound evaluates to non-positive value 0” 2021-08-26 13:27:29 +02:00
Daniel Eklöf
7ca22a6dab
bar: don’t adjust spacing for left/center/right widths if all exposables are zero-width 2021-08-25 18:48:15 +02:00
Nulo
eb94c8cceb
Add layer option
Only applies to Wayland and the default is still bottom.
2021-08-25 18:42:46 +02:00
Nulo
910522262f
Only add spacing if the module is not empty
If the module is empty (width is 0) no spacing will be rendered for it.

This makes modules that auto-hide (for example, network modules for interfaces not used all of the time) occupy no space in the bar.
2021-08-12 19:29:07 +02:00
Daniel Eklöf
74016d7d33
bar: add bar->output_name(), returns the name of the output we’re on 2021-08-09 19:56:47 +02:00
Érico Nogueira
7d94631991 bar: fix typo.
Running 'yambar --backend=wayland' would always error out saying it was
built without wayland support.
2021-07-29 15:57:00 -03:00
Daniel Eklöf
b97ba80aea
bar: add border.{left,right,top,bottom}-width
This allows you to configure the width of each side of the border
individually. border.width can still be used, and will set all four
borders to the same width.

Closes #77
2021-07-28 11:00:04 +02:00
Daniel Eklöf
0aef2f85ee
config: add bar.trackpad-sensitivity
This is an integer that specifies the amount of scrolling that needs
to be accumulated before a wheel-up/down event is emitted.

A higher value means you need to drag your fingers a longer distance
before the event is emitted.

The default is 30.
2021-07-01 17:15:54 +02:00
Daniel Eklöf
dd724d1bc2
exposable: add ‘btn’ argument to on_mouse() 2021-07-01 17:15:52 +02:00
Daniel Eklöf
371bfb4065
bar: don’t prepend ‘mod:’ to module thread titles 2021-06-20 21:21:59 +02:00
Daniel Eklöf
97d5570daf
bar: set module thread titles using the new mod->description() 2021-06-20 21:14:58 +02:00
Daniel Eklöf
c11a79c98d
bar, module: particles may no longer return NULL in instantiate() 2020-11-25 20:41:10 +01:00
Daniel Eklöf
4d05947985
bar: deal with NULL exposables
Allow modules to return NULL in begin_expose()
2020-11-25 20:36:46 +01:00
Daniel Eklöf
f04b1e806c
bar: let backend check if xcursor should be updated or not
This allows the backend to support multi-seat "properly", by checking
against the correct seat. Before this, when we used a single, global
xcursor value, a seat whose pointer needed to be updated would not be
updated.
2020-07-09 19:02:02 +02:00
Daniel Eklöf
9dbbc480e4
Rename project: f00bar -> yambar 2019-09-28 20:39:45 +02:00
Daniel Eklöf
274255f9ab
bar: repair border drawing (was using wrong height)
Fix regression after porting from cairo to pixman. The bar border was
drawn using the wrong height info.
2019-09-22 12:38:30 +02:00
Daniel Eklöf
bd70a4dc37
bar: fix build failure with -Werror=unused-result 2019-09-22 12:32:02 +02:00
Daniel Eklöf
5d6df44a79
bar: signal abort (to main loop) when backend fails 2019-09-22 11:59:34 +02:00
Daniel Eklöf
01e71590e0
bar: don't use cairo
This is trivial in the Wayland backend; just instantiate a pixman
pointing to the same mmapped memory as the wayland buffer.

In the XCB backend, we change the implementation slightly; instead of
rendering via a cairo XCB surface backend (to a server side pixmap),
which is then blitted to the window in commit(), we now render to a
client-side pixman pixmap, and blit it using xcb_put_image() in
commit().
2019-09-22 11:46:46 +02:00
Daniel Eklöf
c11fee4ce3
cairo: replace cairo with pixman in decos, particles and modules
All decoration, particle and module interfaces now takes a
pixman_image_t parameter, and all drawing is done using pixman APIs.

The wayland/xcb backends implement a new interface functions,
get_pixman_image(), that should return a pixman image instance that is
suitable for rendering.

In the wayland backend, the image uses the same backing data as the
cairo surface.

In the XCB backend, we create a new image each time, and then blit it
to the cairo surface at commit time.
2019-09-22 01:56:58 +02:00
Daniel Eklöf
95385863ae
particle: remove cairo context from begin_expose() 2019-09-22 00:55:06 +02:00
Daniel Eklöf
58a6dc52fc
bar: fix border offset, for real hopefully 2019-06-01 17:16:19 +02:00
Daniel Eklöf
64eab86932
Revert "bar: fix border offset"
This reverts commit c2ca68b7bd.
2019-06-01 17:05:11 +02:00
Daniel Eklöf
c2ca68b7bd
bar: fix border offset 2019-06-01 16:16:13 +02:00
Daniel Eklöf
473802cab8 bar: allow explicit backend selection 2019-05-11 10:43:14 +02:00
Daniel Eklöf
cb0bc20b38 bar: destroy modules in destroy(), not at the end of run()
This ensures we properly destroy everything when a bar has been
instantiated, but not run().
2019-05-09 19:14:29 +02:00
Daniel Eklöf
35e9d0e25c bar: need to double border size (why?) 2019-02-28 20:09:50 +01:00
Daniel Eklöf
50d6afab6a bar: add margin properties to the border 2019-02-17 15:45:02 +01:00
Daniel Eklöf
83591b9269 bar: use calloc() instead of malloc()
In cases where it makes sense, use calloc() instead of malloc():

* When allocating large objects with many members, many for which
  NULL/0 is a good default value.
* Arrays etc where we explicitly initialize to NULL anyway.
2019-02-09 10:55:42 +01:00
Daniel Eklöf
ae5029826b cmake: break out bar stuff to separate CMakeLists.txt 2019-02-07 12:06:16 +01:00
Daniel Eklöf
f71aaf9615 bar: call backend->cleanup() when backend->setup() fails
This makes it easier to implement proper cleanup in the backends, as
setup() doesn't have to clean up it's own mess upon failure.
2019-02-07 11:50:52 +01:00
Daniel Eklöf
727d7b343f cmake: initial support for building wayland-only, or x11-only 2019-02-03 20:05:44 +01:00
Daniel Eklöf
73c62e9797 bar/wayland: cleanup 2019-02-03 17:45:26 +01:00
Daniel Eklöf
ed8e17c6c9 wayland: mucho wip: initial sort-of-working wayland backend
Bar is drawn, though only TOP is supported atm. No
screen/display/output selection is possible yet. Mouse *click* works,
but not setting the cursor.

Lots of debug output, crappy code yada yada.
2019-02-03 11:08:53 +01:00
Daniel Eklöf
7f1567c973 bar: do generic cursor stuff in bar, not in backend 2019-01-29 21:05:28 +01:00
Daniel Eklöf
4954479e11 bar: generic setup shouldn't be done by a backend 2019-01-29 21:02:10 +01:00
Daniel Eklöf
c2e7b1c507 bar: remove more includes that aren't needed anymore 2019-01-29 21:01:16 +01:00
Daniel Eklöf
36201e251e bar: no xcb stuff needed directly by bar anymore 2019-01-29 21:00:27 +01:00
Daniel Eklöf
88daaf0ab7 bar: wip: define a 'backend' interface
Implement the current XCB backend in terms of this new interface.
2019-01-29 20:59:25 +01:00
Daniel Eklöf
2d104e4a7d bar: break out 'private' struct definition to a header file 2019-01-29 20:20:11 +01:00
Daniel Eklöf
aa21991323 bar: move C file to subdirectory 2019-01-29 20:18:37 +01:00
Renamed from bar.c (Browse further)