aboutsummaryrefslogtreecommitdiff
path: root/academic/openboard/run-in-a-window.patch
blob: 84c9cca3eb7e39ca79d575c525c2c589544c5b6c (plain)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Patch for OpenBoard v. 1.6.0a3 by Roberto Puzzanghera roberto.puzzanghera at sagredo.eu
based on this patch http://webdiis.unizar.es/~spd/openboard/index.html.en

OpenBoard runs in fullscreen mode. This seems to prevent the possibility to be recognized
by Google meet as an application to share. This patch gets OpenBoard to optionally run in
a window and solves the issue.

With this patch OB runs in fullscreen mode by default. To run it in a window simply
adjust this option to true in the config file:

RunInWindow=true

On linux the location of the config file is /opt/openboard/etc/OpenBoard.config. A user
can override this file acting in local config file ~/.local/share/OpenBoard/OpenBoardUser.config

=============================================================================================

diff -ruN OpenBoard-1.6.0a3-original/OpenBoard.pro OpenBoard-1.6.0a3/OpenBoard.pro
--- OpenBoard-1.6.0a3-original/OpenBoard.pro	2020-05-22 18:40:49.000000000 +0200
+++ OpenBoard-1.6.0a3/OpenBoard.pro	2020-10-24 10:58:50.421254271 +0200
@@ -442,6 +442,10 @@
     QMAKE_CFLAGS += -fopenmp
     QMAKE_CXXFLAGS += -fopenmp
     QMAKE_LFLAGS += -fopenmp
+# RunInWindow patch
+    # Necessary for CentOS/RHEL and won't harm in other distributions
+    INCLUDEPATH += /usr/include/ffmpeg
+# end patch
     UB_LIBRARY.path = $$DESTDIR
     UB_I18N.path = $$DESTDIR/i18n
     UB_ETC.path = $$DESTDIR
diff -ruN OpenBoard-1.6.0a3-original/resources/etc/OpenBoard.config OpenBoard-1.6.0a3/resources/etc/OpenBoard.config
--- OpenBoard-1.6.0a3-original/resources/etc/OpenBoard.config	2020-05-22 18:40:49.000000000 +0200
+++ OpenBoard-1.6.0a3/resources/etc/OpenBoard.config	2020-10-24 10:59:50.005263852 +0200
@@ -14,6 +14,7 @@
 PageCacheSize=20
 PreferredLanguage=fr_CH
 ProductWebAddress=http://www.openboard.ch
+RunInWindow=false
 SoftwareUpdateURL=http://www.openboard.ch/update.json
 StartMode=
 SwapControlAndDisplayScreens=false
diff -ruN OpenBoard-1.6.0a3-original/src/core/UBApplication.cpp OpenBoard-1.6.0a3/src/core/UBApplication.cpp
--- OpenBoard-1.6.0a3-original/src/core/UBApplication.cpp	2020-05-22 18:40:49.000000000 +0200
+++ OpenBoard-1.6.0a3/src/core/UBApplication.cpp	2020-10-24 11:03:09.881941449 +0200
@@ -277,8 +277,21 @@
     gs->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
     gs->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
 
+    /* RunInWindow patch */
+    if (UBSettings::settings()->appRunInWindow->get().toBool()) {
+       mainWindow = new UBMainWindow(0,
+               Qt::Window |
+               Qt::WindowCloseButtonHint |
+               Qt::WindowMinimizeButtonHint |
+               Qt::WindowMaximizeButtonHint |
+               Qt::WindowShadeButtonHint
+       ); // deleted by application destructor
+    } else {
+       mainWindow = new UBMainWindow(0, Qt::FramelessWindowHint); // deleted by application destructor
+    }
+    /* mainWindow = new UBMainWindow(0, Qt::FramelessWindowHint); // deleted by application destructor */
+    /* end patch */
 
-    mainWindow = new UBMainWindow(0, Qt::FramelessWindowHint); // deleted by application destructor
     mainWindow->setAttribute(Qt::WA_NativeWindow, true);
 
     mainWindow->actionCopy->setShortcuts(QKeySequence::Copy);
diff -ruN OpenBoard-1.6.0a3-original/src/core/UBSettings.cpp OpenBoard-1.6.0a3/src/core/UBSettings.cpp
--- OpenBoard-1.6.0a3-original/src/core/UBSettings.cpp	2020-05-22 18:40:49.000000000 +0200
+++ OpenBoard-1.6.0a3/src/core/UBSettings.cpp	2020-10-24 11:02:43.074387051 +0200
@@ -265,6 +265,9 @@
     appLookForOpenSankoreInstall = new UBSetting(this, "App", "LookForOpenSankoreInstall", true);
 
     appStartMode = new UBSetting(this, "App", "StartMode", "");
+    /* RunInWindow patch */
+    appRunInWindow = new UBSetting(this, "App", "RunInWindow", false);
+    /* end patch */
 
     featureSliderPosition = new UBSetting(this, "Board", "FeatureSliderPosition", 40);
 
diff -ruN OpenBoard-1.6.0a3-original/src/core/UBSettings.h OpenBoard-1.6.0a3/src/core/UBSettings.h
--- OpenBoard-1.6.0a3-original/src/core/UBSettings.h	2020-05-22 18:40:49.000000000 +0200
+++ OpenBoard-1.6.0a3/src/core/UBSettings.h	2020-10-24 11:06:13.206894166 +0200
@@ -260,7 +260,9 @@
         UBSetting* appHideSwapDisplayScreens;
         UBSetting* appToolBarOrientationVertical;
         UBSetting* appPreferredLanguage;
-
+	/* RunInWindow patch */
+	UBSetting* appRunInWindow;
+	/* end patch */
         UBSetting* appIsInSoftwareUpdateProcess;
 
         UBSetting* appLastSessionDocumentUUID;
diff -ruN OpenBoard-1.6.0a3-original/src/frameworks/UBPlatformUtils_linux.cpp OpenBoard-1.6.0a3/src/frameworks/UBPlatformUtils_linux.cpp
--- OpenBoard-1.6.0a3-original/src/frameworks/UBPlatformUtils_linux.cpp	2020-05-22 18:40:49.000000000 +0200
+++ OpenBoard-1.6.0a3/src/frameworks/UBPlatformUtils_linux.cpp	2020-10-24 11:00:43.708371185 +0200
@@ -36,7 +36,9 @@
 #include <X11/keysym.h>
 
 #include "frameworks/UBFileSystemUtils.h"
-
+/* RunInWindow patch */
+#include "core/UBSettings.h"
+/* end patch */
 
 void UBPlatformUtils::init()
 {
@@ -439,7 +441,14 @@
 
 void UBPlatformUtils::showFullScreen(QWidget *pWidget)
 {
-    pWidget->showFullScreen();
+    /* RunInWindow patch */
+    /* pWidget->showFullScreen(); */
+    if (UBSettings::settings()->appRunInWindow->get().toBool()) {
+       pWidget->showNormal();
+    } else {
+       pWidget->showFullScreen();
+    }
+    /* end patch */
 }
 
 void UBPlatformUtils::showOSK(bool show)
diff -ruN OpenBoard-1.6.0a3-original/src/frameworks/UBPlatformUtils_win.cpp OpenBoard-1.6.0a3/src/frameworks/UBPlatformUtils_win.cpp
--- OpenBoard-1.6.0a3-original/src/frameworks/UBPlatformUtils_win.cpp	2020-05-22 18:40:49.000000000 +0200
+++ OpenBoard-1.6.0a3/src/frameworks/UBPlatformUtils_win.cpp	2020-10-24 11:01:26.170665369 +0200
@@ -36,6 +36,9 @@
 
 #include "frameworks/UBFileSystemUtils.h"
 #include "core/memcheck.h"
+/* RunInWindow patch */
+#include "core/UBSettings.h"
+/* end patch */
 
 void UBPlatformUtils::init()
 {
@@ -436,7 +439,14 @@
 
 void UBPlatformUtils::showFullScreen(QWidget *pWidget)
 {
-    pWidget->showFullScreen();
+    /* RunInWindow patch */
+    /* pWidget->showFullScreen(); */
+    if (UBSettings::settings()->appRunInWindow->get().toBool()) {
+       pWidget->showNormal();
+    } else {
+       pWidget->showFullScreen();
+    }
+    /* end patch */
 }
 
 void UBPlatformUtils::showOSK(bool show)