aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-01-01 16:54:13 +0100
committervaxerski <[email protected]>2023-01-01 16:54:13 +0100
commitcb4f7482269664dd20c373eef5d862a770df1643 (patch)
tree0f95c6cafe2b6a0a5c11ee18a9bb42de749d6268
parent7525818097f92a99b2b8d02ea43bd0f8ccabd51c (diff)
downloadHyprland-cb4f7482269664dd20c373eef5d862a770df1643.tar.gz
Hyprland-cb4f7482269664dd20c373eef5d862a770df1643.zip
added fakefullscreen
-rw-r--r--src/Window.hpp3
-rw-r--r--src/managers/KeybindManager.cpp8
-rw-r--r--src/managers/KeybindManager.hpp4
-rw-r--r--src/managers/XWaylandManager.cpp2
4 files changed, 15 insertions, 2 deletions
diff --git a/src/Window.hpp b/src/Window.hpp
index d13097f1..cc872a43 100644
--- a/src/Window.hpp
+++ b/src/Window.hpp
@@ -157,6 +157,9 @@ class CWindow {
// For pinned (sticky) windows
bool m_bPinned = false;
+ // fakefullscreen
+ bool m_bInFullscreenReported = false;
+
// for proper cycling. While cycling we can't just move the pointers, so we need to keep track of the last cycled window.
CWindow* m_pLastCycledWindow = nullptr;
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 5de4a3d0..2eb93a2a 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -11,6 +11,7 @@ CKeybindManager::CKeybindManager() {
m_mDispatchers["togglefloating"] = toggleActiveFloating;
m_mDispatchers["workspace"] = changeworkspace;
m_mDispatchers["fullscreen"] = fullscreenActive;
+ m_mDispatchers["fakefullscreen"] = fakeFullscreenActive;
m_mDispatchers["movetoworkspace"] = moveActiveToWorkspace;
m_mDispatchers["movetoworkspacesilent"] = moveActiveToWorkspaceSilent;
m_mDispatchers["pseudo"] = toggleActivePseudo;
@@ -1818,3 +1819,10 @@ void CKeybindManager::bringActiveToTop(std::string args) {
if (g_pCompositor->m_pLastWindow && g_pCompositor->m_pLastWindow->m_bIsFloating)
g_pCompositor->moveWindowToTop(g_pCompositor->m_pLastWindow);
}
+
+void CKeybindManager::fakeFullscreenActive(std::string args) {
+ if (g_pCompositor->m_pLastWindow) {
+ // will also set the flag
+ g_pXWaylandManager->setWindowFullscreen(g_pCompositor->m_pLastWindow, !g_pCompositor->m_pLastWindow->m_bInFullscreenReported);
+ }
+}
diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp
index 143e4a09..9498c529 100644
--- a/src/managers/KeybindManager.hpp
+++ b/src/managers/KeybindManager.hpp
@@ -25,8 +25,7 @@ struct SKeybind {
bool shadowed = false;
};
-enum eFocusWindowMode
-{
+enum eFocusWindowMode {
MODE_CLASS_REGEX = 0,
MODE_TITLE_REGEX,
MODE_ADDRESS,
@@ -91,6 +90,7 @@ class CKeybindManager {
static void toggleActivePseudo(std::string);
static void changeworkspace(std::string);
static void fullscreenActive(std::string);
+ static void fakeFullscreenActive(std::string);
static void moveActiveToWorkspace(std::string);
static void moveActiveToWorkspaceSilent(std::string);
static void moveFocusTo(std::string);
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 50be350b..feb4c2ff 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -257,6 +257,8 @@ void CHyprXWaylandManager::setWindowFullscreen(CWindow* pWindow, bool fullscreen
if (pWindow->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_fullscreen(pWindow->m_phForeignToplevel, fullscreen);
+
+ pWindow->m_bInFullscreenReported = fullscreen;
}
Vector2D CHyprXWaylandManager::getMaxSizeForWindow(CWindow* pWindow) {