83 lines
4.2 KiB
Diff
83 lines
4.2 KiB
Diff
From b9e64417e4c33e2c17e060aa482519c2c8c7d416 Mon Sep 17 00:00:00 2001
|
|
From: Christian Hesse <mail@eworm.de>
|
|
Date: Tue, 17 Jan 2023 22:04:08 +0100
|
|
Subject: [PATCH] properly handle i3wm
|
|
|
|
---
|
|
.../VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp | 3 ++-
|
|
.../Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp | 3 +++
|
|
.../Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.h | 3 ++-
|
|
src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp | 4 ++++
|
|
4 files changed, 11 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp b/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
|
|
index c27ff6f6..066a80e0 100644
|
|
--- a/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
|
|
+++ b/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
|
|
@@ -385,7 +385,8 @@ QRect UIDesktopWidgetWatchdog::availableGeometry(QScreen *pScreen) const
|
|
/* Get cached available-geometry: */
|
|
const QRect availableGeometry = m_availableGeometryData.value(screenToIndex(pScreen));
|
|
/* Return cached available-geometry if it's valid or screen-geometry otherwise: */
|
|
- return availableGeometry.isValid() ? availableGeometry : screenGeometry(pScreen);
|
|
+ return availableGeometry.isValid() && NativeWindowSubsystem::X11WindowManagerType() != X11WMType_i3 ?
|
|
+ availableGeometry : screenGeometry(pScreen);
|
|
# endif /* !VBOX_GUI_WITH_CUSTOMIZATIONS1 */
|
|
#else /* !VBOX_WS_X11 */
|
|
/* Just return screen available-geometry: */
|
|
diff --git a/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp b/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp
|
|
index 2443af89..6cfcff74 100644
|
|
--- a/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp
|
|
+++ b/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp
|
|
@@ -141,6 +141,9 @@ X11WMType NativeWindowSubsystem::X11Wind
|
|
else
|
|
if (QString((const char*)pcData).contains("Xfwm4", Qt::CaseInsensitive))
|
|
wmType = X11WMType_Xfwm4;
|
|
+ else
|
|
+ if (QString((const char*)pcData).contains("i3", Qt::CaseInsensitive))
|
|
+ wmType = X11WMType_i3;
|
|
if (pcData)
|
|
XFree(pcData);
|
|
}
|
|
diff --git a/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.h b/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.h
|
|
index 66504c71..f83b5c85 100644
|
|
--- a/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.h
|
|
+++ b/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.h
|
|
@@ -51,6 +51,7 @@ enum X11WMType
|
|
X11WMType_Metacity,
|
|
X11WMType_Mutter,
|
|
X11WMType_Xfwm4,
|
|
+ X11WMType_i3,
|
|
};
|
|
|
|
/** X11: Screen-saver inhibit methods. */
|
|
@@ -102,11 +103,11 @@ namespace NativeWindowSubsystem
|
|
bool WaylandIsCompositingManagerRunning();
|
|
|
|
/** Wrapper for window manager type functions. */
|
|
- X11WMType windowManagerType(bool fIsXServerAvailable);
|
|
+ SHARED_LIBRARY_STUFF X11WMType windowManagerType(bool fIsXServerAvailable);
|
|
/** X11: Determines and returns current Window Manager type. */
|
|
- X11WMType X11WindowManagerType();
|
|
+ SHARED_LIBRARY_STUFF X11WMType X11WindowManagerType();
|
|
/** Wayland: Determines and returns current Window Manager type. */
|
|
- X11WMType WaylandWindowManagerType();
|
|
+ SHARED_LIBRARY_STUFF X11WMType WaylandWindowManagerType();
|
|
|
|
/** Wrapper for X11CheckExtension and WaylandCheckExtension functions. */
|
|
bool checkExtension(bool fIsXServerAvailable, const char *extensionName);
|
|
diff --git a/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp b/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
|
|
index 7b37d46b..b838ad07 100644
|
|
--- a/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
|
|
+++ b/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
|
|
@@ -1076,6 +1076,10 @@ void UIMiniToolBar::prepare()
|
|
/* Enable translucency through Qt API if supported: */
|
|
if (uiCommon().isCompositingManagerRunning())
|
|
setAttribute(Qt::WA_TranslucentBackground);
|
|
+
|
|
+ if (NativeWindowSubsystem::X11WindowManagerType() == X11WMType_i3)
|
|
+ setWindowFlags(Qt::FramelessWindowHint);
|
|
+
|
|
#endif /* VBOX_WS_NIX */
|
|
|
|
/* Make sure we have no focus: */
|