-
Notifications
You must be signed in to change notification settings - Fork 2
/
009-properly-handle-i3wm.patch
75 lines (70 loc) · 3.9 KB
/
009-properly-handle-i3wm.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From 04cf1e3a266fcc4e65d01b8b492d2c5fbe1bf13d Mon Sep 17 00:00:00 2001
From: Christian Hesse <[email protected]>
Date: Wed, 11 Sep 2024 21:10:09 +0200
Subject: [PATCH 1/1] properly handle i3wm
---
.../VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp | 3 ++-
.../Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp | 3 +++
src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.h | 3 ++-
src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp | 3 +++
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp b/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
index e9b78fde..17a1dfc0 100644
--- a/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
@@ -380,7 +380,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_NIX */
/* 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 ab520e51..f168050d 100644
--- a/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/platform/nix/VBoxUtils-nix.cpp
@@ -139,6 +139,9 @@ X11WMType NativeWindowSubsystem::X11WindowManagerType()
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 e1dfc07f..b1a789e7 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. */
@@ -104,7 +105,7 @@ namespace NativeWindowSubsystem
/** Wrapper for window manager type functions. */
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();
diff --git a/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp b/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
index 272729a4..6346fb63 100644
--- a/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
@@ -1076,6 +1076,9 @@ 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: */