mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-12-25 10:49:49 +01:00
bar fullscreen window
This commit is contained in:
parent
49c7b0bcee
commit
d033ae9cfd
6 changed files with 17 additions and 9 deletions
|
@ -131,14 +131,16 @@ void KeybindManager::changeworkspace(std::string arg) {
|
|||
}
|
||||
|
||||
void KeybindManager::toggleActiveWindowFullscreen(std::string unusedArg) {
|
||||
const auto MONITOR = g_pWindowManager->getMonitorFromWindow(g_pWindowManager->getWindowFromDrawable(g_pWindowManager->LastWindow));
|
||||
if (!g_pWindowManager->getWindowFromDrawable(g_pWindowManager->LastWindow))
|
||||
return;
|
||||
|
||||
const auto PWINDOW = g_pWindowManager->getWindowFromDrawable(g_pWindowManager->LastWindow);
|
||||
const auto MONITOR = g_pWindowManager->getMonitorFromWindow(PWINDOW);
|
||||
|
||||
g_pWindowManager->setAllWorkspaceWindowsDirtyByID(g_pWindowManager->activeWorkspaces[MONITOR->ID]);
|
||||
|
||||
if (auto WINDOW = g_pWindowManager->getWindowFromDrawable(g_pWindowManager->LastWindow) ; WINDOW) {
|
||||
WINDOW->setFullscreen(!WINDOW->getFullscreen());
|
||||
g_pWindowManager->getWorkspaceByID(g_pWindowManager->activeWorkspaces[MONITOR->ID])->setHasFullscreenWindow(WINDOW->getFullscreen());
|
||||
}
|
||||
PWINDOW->setFullscreen(!PWINDOW->getFullscreen());
|
||||
g_pWindowManager->getWorkspaceByID(PWINDOW->getWorkspaceID())->setHasFullscreenWindow(PWINDOW->getFullscreen());
|
||||
}
|
||||
|
||||
void KeybindManager::toggleActiveWindowFloating(std::string unusedArg) {
|
||||
|
|
|
@ -225,10 +225,8 @@ int CStatusBar::getTextHalfY() {
|
|||
|
||||
void CStatusBar::draw() {
|
||||
|
||||
// const auto WORKSPACE = g_pWindowManager->getWorkspaceByID(g_pWindowManager->activeWorkspaces[m_iMonitorID]);
|
||||
|
||||
// if (!WORKSPACE || WORKSPACE->getHasFullscreenWindow()) // TODO: fix this
|
||||
// return; // Do not draw a bar on a fullscreen window.
|
||||
if (m_bIsCovered)
|
||||
return; // Do not draw a bar on a fullscreen window.
|
||||
|
||||
if (!m_pCairo) {
|
||||
Debug::log(ERR, "Cairo is null but attempted to draw!");
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
EXPOSED_MEMBER(MonitorID, int, i);
|
||||
EXPOSED_MEMBER(StatusCommand, std::string, sz); // TODO: make the bar better
|
||||
EXPOSED_MEMBER(LastWindowName, std::string, sz);
|
||||
EXPOSED_MEMBER(IsCovered, bool, b);
|
||||
|
||||
void draw();
|
||||
void setup(int MonitorID);
|
||||
|
|
|
@ -65,6 +65,8 @@ void IPCSendMessage(const std::string path, SIPCMessageMainToBar smessage) {
|
|||
message += std::to_string(w) + ",";
|
||||
}
|
||||
|
||||
message += IPC_MESSAGE_SEPARATOR + "barfullscreenwindow" + IPC_MESSAGE_EQUALITY + (smessage.fullscreenOnBar ? "1" : "0");
|
||||
|
||||
message += IPC_MESSAGE_SEPARATOR + "lastwindowname" + IPC_MESSAGE_EQUALITY;
|
||||
|
||||
if (const auto PLASTWINDOW = g_pWindowManager->getWindowFromDrawable(g_pWindowManager->LastWindow); PLASTWINDOW) {
|
||||
|
@ -135,6 +137,8 @@ void IPCRecieveMessageB(const std::string path) {
|
|||
std::sort(g_pWindowManager->statusBar->openWorkspaces.begin(), g_pWindowManager->statusBar->openWorkspaces.end());
|
||||
} else if (PROPNAME == "lastwindowname") {
|
||||
g_pWindowManager->statusBar->setLastWindowName(PROPVALUE);
|
||||
} else if (PROPNAME == "barfullscreenwindow") {
|
||||
g_pWindowManager->statusBar->setIsCovered(PROPVALUE == "1" ? true : false);
|
||||
}
|
||||
}
|
||||
} catch(...) {
|
||||
|
|
|
@ -12,6 +12,7 @@ struct SIPCMessageMainToBar {
|
|||
std::vector<int> openWorkspaces;
|
||||
uint64_t activeWorkspace;
|
||||
std::string lastWindowName;
|
||||
bool fullscreenOnBar;
|
||||
};
|
||||
|
||||
struct SIPCMessageBarToMain {
|
||||
|
|
|
@ -1095,6 +1095,8 @@ void CWindowManager::updateBarInfo() {
|
|||
|
||||
message.lastWindowName = winname;
|
||||
|
||||
message.fullscreenOnBar = getWorkspaceByID(activeWorkspaces[ConfigManager::getInt("bar:monitor") > monitors.size() ? 0 : ConfigManager::getInt("bar:monitor")])->getHasFullscreenWindow();
|
||||
|
||||
for (auto& workspace : workspaces) {
|
||||
message.openWorkspaces.push_back(workspace.getID());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue