mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat: use gtk-layer-shell library for correct positioning of popups
To enable: use sway >= 1.2, compile waybar with `-Dgtk-layer-shell=enabled` meson option. Original behavior could be restored at runtime by setting `"gtk-layer-shell": false` in waybar config.
This commit is contained in:
@ -32,13 +32,12 @@ class Bar {
|
||||
auto toggle() -> void;
|
||||
void handleSignal(int);
|
||||
|
||||
struct waybar_output * output;
|
||||
Json::Value config;
|
||||
Gtk::Window window;
|
||||
struct wl_surface * surface;
|
||||
struct zwlr_layer_surface_v1 *layer_surface;
|
||||
bool visible = true;
|
||||
bool vertical = false;
|
||||
struct waybar_output *output;
|
||||
Json::Value config;
|
||||
Gtk::Window window;
|
||||
struct wl_surface * surface;
|
||||
bool visible = true;
|
||||
bool vertical = false;
|
||||
|
||||
private:
|
||||
static constexpr const char *MIN_HEIGHT_MSG =
|
||||
@ -53,7 +52,9 @@ class Bar {
|
||||
uint32_t, uint32_t);
|
||||
static void layerSurfaceHandleClosed(void *, struct zwlr_layer_surface_v1 *);
|
||||
|
||||
void destroyOutput();
|
||||
#ifdef HAVE_GTK_LAYER_SHELL
|
||||
void initGtkLayerShell();
|
||||
#endif
|
||||
void onConfigure(GdkEventConfigure *ev);
|
||||
void onRealize();
|
||||
void onMap(GdkEventAny *ev);
|
||||
@ -70,6 +71,9 @@ class Bar {
|
||||
int bottom = 0;
|
||||
int left = 0;
|
||||
} margins_;
|
||||
struct zwlr_layer_surface_v1 *layer_surface_;
|
||||
// use gtk-layer-shell instead of handling layer surfaces directly
|
||||
bool use_gls_ = false;
|
||||
uint32_t width_ = 0;
|
||||
uint32_t height_ = 1;
|
||||
uint8_t anchor_;
|
||||
|
Reference in New Issue
Block a user