mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat: add idle protocol to avoid update workspace when idle
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
|
||||
#include "idle-client-protocol.h"
|
||||
|
||||
#include "util/ptr_vec.hpp"
|
||||
|
||||
@ -28,6 +29,8 @@ namespace waybar {
|
||||
struct wl_display *wlDisplay;
|
||||
struct wl_registry *registry;
|
||||
struct zwlr_layer_shell_v1 *layer_shell;
|
||||
struct org_kde_kwin_idle *idle_manager;
|
||||
struct wl_seat *seat;
|
||||
util::ptr_vec<Bar> bars;
|
||||
|
||||
struct {
|
||||
|
@ -12,16 +12,18 @@ namespace waybar::modules {
|
||||
public:
|
||||
WorkspaceSelector(waybar::Bar &bar);
|
||||
auto update() -> void;
|
||||
void updateThread();
|
||||
operator Gtk::Widget &();
|
||||
util::SleeperThread *thread;
|
||||
private:
|
||||
void _addWorkspace(Json::Value node);
|
||||
Json::Value _getWorkspaces();
|
||||
Bar &_bar;
|
||||
Gtk::Box *_box;
|
||||
std::unordered_map<int, Gtk::Button> _buttons;
|
||||
util::SleeperThread _thread;
|
||||
int _ipcSocketfd;
|
||||
int _ipcEventSocketfd;
|
||||
struct org_kde_kwin_idle_timeout *_idle_timer;
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user