aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-01-06 13:29:43 +0100
committervaxerski <[email protected]>2023-01-06 13:29:49 +0100
commit461fab0f27e4913993c6321625b343537aba1bdf (patch)
treec1559a5d1cccd3c35434293a4053e1bb8bfb2ca1
parente9a6c3b49828ff39b211effeee952756bb23ef8a (diff)
downloadHyprland-461fab0f27e4913993c6321625b343537aba1bdf.tar.gz
Hyprland-461fab0f27e4913993c6321625b343537aba1bdf.zip
minor fixes for fakefullscreen
-rw-r--r--src/Window.hpp2
-rw-r--r--src/events/Windows.cpp16
-rw-r--r--src/managers/KeybindManager.cpp4
-rw-r--r--src/managers/XWaylandManager.cpp2
4 files changed, 18 insertions, 6 deletions
diff --git a/src/Window.hpp b/src/Window.hpp
index cc872a43..758acd4d 100644
--- a/src/Window.hpp
+++ b/src/Window.hpp
@@ -158,7 +158,7 @@ class CWindow {
bool m_bPinned = false;
// fakefullscreen
- bool m_bInFullscreenReported = false;
+ bool m_bFakeFullscreenState = 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/events/Windows.cpp b/src/events/Windows.cpp
index 2557e0f0..50f58cfc 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -756,18 +756,30 @@ void Events::listener_fullscreenWindow(void* owner, void* data) {
if (PWINDOW->isHidden() || PWINDOW->m_bNoFullscreenRequest)
return;
+ bool requestedFullState = false;
+
if (!PWINDOW->m_bIsX11) {
const auto REQUESTED = &PWINDOW->m_uSurface.xdg->toplevel->requested;
- if (REQUESTED->fullscreen != PWINDOW->m_bIsFullscreen)
+ if (REQUESTED->fullscreen != PWINDOW->m_bIsFullscreen && !PWINDOW->m_bFakeFullscreenState)
g_pCompositor->setWindowFullscreen(PWINDOW, REQUESTED->fullscreen, FULLSCREEN_FULL);
+ requestedFullState = REQUESTED->fullscreen;
+
wlr_xdg_surface_schedule_configure(PWINDOW->m_uSurface.xdg);
} else {
if (!PWINDOW->m_uSurface.xwayland->mapped)
return;
- g_pCompositor->setWindowFullscreen(PWINDOW, PWINDOW->m_uSurface.xwayland->fullscreen, FULLSCREEN_FULL);
+ if (!PWINDOW->m_bFakeFullscreenState)
+ g_pCompositor->setWindowFullscreen(PWINDOW, PWINDOW->m_uSurface.xwayland->fullscreen, FULLSCREEN_FULL);
+
+ requestedFullState = PWINDOW->m_uSurface.xwayland->fullscreen;
+ }
+
+ if (!requestedFullState && PWINDOW->m_bFakeFullscreenState) {
+ g_pXWaylandManager->setWindowFullscreen(PWINDOW, false); // fixes for apps expecting a de-fullscreen (e.g. ff)
+ g_pXWaylandManager->setWindowFullscreen(PWINDOW, true);
}
PWINDOW->updateToplevel();
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 15ed348b..ead93231 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -1823,6 +1823,8 @@ void CKeybindManager::bringActiveToTop(std::string args) {
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);
+ g_pCompositor->m_pLastWindow->m_bFakeFullscreenState = !g_pCompositor->m_pLastWindow->m_bFakeFullscreenState;
+ g_pXWaylandManager->setWindowFullscreen(g_pCompositor->m_pLastWindow,
+ g_pCompositor->m_pLastWindow->m_bFakeFullscreenState || g_pCompositor->m_pLastWindow->m_bIsFullscreen);
}
}
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 029a3f31..765738ef 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -257,8 +257,6 @@ 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) {