Commit Graph

59 Commits

Author SHA1 Message Date
Aleksei Bavshin 943ba3a2da
fix: schedule output destruction on idle callback
Defer destruction of bars for the output to the next iteration of the
event loop to avoid deleting objects referenced by currently executed
code.
2021-02-22 18:35:09 -08:00
Aleksei Bavshin 89b5e819a3
fix(client): improve guard from repeated xdg_output.done events
Multiple .done events may arrive in batch. In this case libwayland would
queue xdg_output.destroy and dispatch all pending events, triggering
this callback several times for the same output.

Delete xdg_output pointer immediately on the first event and use the
value as a guard for reentering.
2021-02-08 23:25:58 -08:00
Aleksei Bavshin 6585381230
fix(client): remove unnecessary wl_output_roundtrip
At this point we're not awaiting any protocol events and flushing
wayland queue makes little sense. As #1019 shows, it may be even harmful
as an extra roundtrip could process wl_output disappearance and delete
output object right from under our code.
2021-02-08 22:30:01 -08:00
Aleksei Bavshin 7fa1c11833
fix(client): unsubscribe after receiving xdg_output.done event
Ignore any further xdg_output events. Name and description are constant
for the lifetime of wl_output in xdg-output-unstable-v1 version 2 and we
don't need other properties.

Fixes #990.
2021-01-21 08:35:38 -08:00
Aleksei Bavshin ab0f2c13af
fix(client): attach styles only once
Gdk >= 3.10 has only one GdkScreen. No need to reattach styles on every
output change.
2021-01-21 08:32:44 -08:00
Alex a2d98ddde8
Merge pull request #842 from rdnetto/config-reloading
Implement support for reloading of config files.
2021-01-18 12:06:25 +01:00
Andreas Backx 3fbbbf8541
Removed redundant log line. 2020-12-25 23:31:29 +00:00
Andreas Backx e5684c6127
Separated name and description setup and moved bar creation to done callback. 2020-12-25 23:03:01 +00:00
Andreas Backx 0233e0eeec
Added waybar_output.identifier support.
Resolves #602.
2020-12-25 20:54:38 +00:00
Aleksei Bavshin f97de599dd
refactor: header cleanup
Replace a couple of header includes with forward declarations.
2020-10-28 08:08:03 -07:00
Aleksei Bavshin 67d54ef3d5
fix(wlr/taskbar): do not bind to unsupported protocol versions
It's not allowed to bind to a higher version of a wayland protocol than
supported by the client. Binding wlr-foreign-toplevel-manager-v1 v3 to
a generated code for v2 causes errors in libwayland due to a missing
handler for `zwlr_foreign_toplevel_handle_v1.parent` event.
2020-10-25 10:26:44 -07:00
Alex 45f7f9b07a
Merge branch 'master' into config-reloading 2020-10-11 23:00:25 +02:00
Minijackson e9b5be9adb
fix: add global /etc/xdg/waybar back. fixes #714 2020-09-29 22:28:39 +02:00
Renee D'Netto 943b6bc51b Implement support for reloading of config files.
Fixes #759.
2020-08-28 22:34:24 +10:00
Alex 6e7f22ac3a fix: cancel thread and fix window close 2020-05-27 09:10:38 +02:00
Alex e72b153f87 fix: ignore gtk unknown options 2020-05-24 22:03:41 +02:00
Jan Beich c94ef092ff build: drop -Dout in favor of --prefix
$ meson --prefix=/tmp/foo _build
$ ninja install -C _build
[49/50] Installing files.
Installing waybar to /tmp/foo/bin
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/mesonbuild/mesonmain.py", line 127, in run
    return options.run_func(options)
  File "/usr/lib/python3.6/site-packages/mesonbuild/minstall.py", line 514, in run
    installer.do_install(datafilename)
  File "/usr/lib/python3.6/site-packages/mesonbuild/minstall.py", line 346, in do_install
    self.install_data(d)
  File "/usr/lib/python3.6/site-packages/mesonbuild/minstall.py", line 375, in install_data
    d.dirmaker.makedirs(outdir, exist_ok=True)
  File "/usr/lib/python3.6/site-packages/mesonbuild/minstall.py", line 55, in makedirs
    os.makedirs(path, exist_ok=exist_ok)
  File "/usr/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/usr/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/etc/xdg'
FAILED: meson-install
2020-05-19 10:37:27 +00:00
Alex 4a80874da9
Update client.cpp 2020-04-17 23:41:32 +02:00
Vesim 1209022492 Return true when outputs are not specified 2020-02-28 07:54:00 +01:00
Vesim bb88038c17 Dont exclude outputs in arrays 2020-02-27 21:49:09 +01:00
Vesim 9525663014
Update src/client.cpp
Co-Authored-By: Alex <alexisr245@gmail.com>
2020-02-18 22:40:21 +01:00
Vesim 4fcf06a164 Add a way to exclude specific output 2020-02-18 22:24:59 +01:00
Aleksei Bavshin f80270519b
refactor(client): use std::list<waybar_output> to store outputs
std::unique_ptr is not required here as the only benefit it gives is
stability of address on vector resize and it's easy to invalidate it
accidentaly. std::list provides the same guarantee of stable addresses
of the elements and correct destruction while avoiding smart pointer
overhead.

Also fixes #554, caused by incorrect usage of std::remove_if.
2020-01-14 07:27:08 -08:00
Aleksei Bavshin d1637d34cf
refactor: fetch outputs from Gtk::Display instead of wl_registry.
gtk-layer-shell wants Gdk::Monitor instead of wl_output;
change code to deal with Gdk objects and slightly simplify it.
Requires gtkmm 3.22.0+ (first release with Gdk::Monitor support).
2019-12-27 16:42:12 -08:00
Alex bb99e6cf5b fix: check before destroy 2019-07-15 10:06:01 +02:00
Alex ffadd5c1a7 refactor: avoid useless class vars 2019-05-24 09:49:09 +02:00
Alex 2b34f3a30f refactor: parse args before app creation 2019-05-23 10:13:49 +02:00
Aleksei Bavshin cdb347aaca Add --log-level command line option 2019-05-20 06:48:44 -07:00
Lucas Lazare 51be97f9aa Adding spdlog 2019-05-18 19:44:45 -04:00
Alex f8a47598ba fix: roundtrip before bar creation 2019-05-17 13:40:04 +02:00
Alex 79a5e9ecee feat: multiple bar with same process 2019-04-25 13:25:06 +02:00
Alex 311c34ecbc feat(Bar): handle widget size changes 2019-04-24 12:37:24 +02:00
Alex 171ecd53aa refactor(Bar): roundtrip before setup widgets 2019-04-19 11:56:40 +02:00
Alex 6ed8f94dab refactor: format code 2019-04-18 17:52:00 +02:00
Alex 807ef32357 refactor: format && better output management 2019-04-18 17:47:40 +02:00
Alex d05b8398fa fix: prefer to hold running even when no window is open 2019-04-15 11:42:16 +02:00
Alex 22cddc5e26 refactor(workspaces): scroll output aware 2019-03-18 14:44:07 +01:00
Jonas d708ce2be9 Add idle inhibitor module 2019-02-22 16:55:46 +01:00
Alex 38fc62ea27 feat: bar id 2019-01-28 19:26:16 +01:00
Alexis b554094c7e feat: args && class id 2018-12-18 17:30:54 +01:00
Alexis 2ec34e4adb feat: add $HOME to valid path 2018-12-03 20:12:34 +01:00
Alexis 087de4e956 refactor(client): lambda to method 2018-11-24 11:04:56 +01:00
Alexis 2c2a0473f4 feat(client): throw when we don't have required resources files 2018-11-23 19:31:40 +01:00
Alexis e42fae32ab feat(network): network info interval 2018-11-16 10:02:12 +01:00
Alexis 94b9f0a399 feat(cpu): add both usage and load 2018-11-15 14:44:43 +01:00
Alexis d0933ab50f
fix(thread): check before detach 2018-08-29 21:07:58 +02:00
Alex 6705134034
Handle screens disconnection (#29) 2018-08-19 13:39:57 +02:00
Alexis 27dfffa4e3 refactor: style issue 2018-08-18 15:05:18 +02:00
Alexis c128562284 feat(bar): clean exit 2018-08-17 20:28:26 +02:00
Alex 6635548d3e
Style code (#25) 2018-08-16 14:29:41 +02:00