mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-23 03:32:51 +00:00
95f9b0aadb
Since there is no way to map a connector to a Gdk Window ID and window ID's are not static per monitor, the entire Window and Wayland system has been rewritten to store a "target monitor" connector name, which is the name of the monitor we want to be on. Every time a monitor is removed or added, it is checked against the monitors of our Wayland backend to match connector to Gdk ID and then the Window is created/destroyed on the window(The target monitor is preferred, but if it doesn't exist, other monitors are used too). This is not perfect, since the matching of connector name to Gdk ID is only an approximation of the Gdk behaviour (Especially rough on hyprland with the headless monitor. A hack is needed to handle that). Additionally the monitor can now be specified by connector name when starting up (e.g. "gBar bar DP-1").
12 lines
273 B
C++
12 lines
273 B
C++
#include <gBar/Common.h>
|
|
#include <gBar/Window.h>
|
|
|
|
void Create(Window& window, const std::string& monitor)
|
|
{
|
|
auto mainWidget = Widget::Create<Text>();
|
|
mainWidget->SetText("Hello, World!");
|
|
|
|
window.SetMainWidget(std::move(mainWidget));
|
|
}
|
|
|
|
DEFINE_PLUGIN(Create);
|