run-in-a-window.patch 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. Patch for OpenBoard v. 1.6.0a3 by Roberto Puzzanghera roberto.puzzanghera at sagredo.eu
  2. based on this patch http://webdiis.unizar.es/~spd/openboard/index.html.en
  3. OpenBoard runs in fullscreen mode. This seems to prevent the possibility to be recognized
  4. by Google meet as an application to share. This patch gets OpenBoard to optionally run in
  5. a window and solves the issue.
  6. With this patch OB runs in fullscreen mode by default. To run it in a window simply
  7. adjust this option to true in the config file:
  8. RunInWindow=true
  9. On linux the location of the config file is /opt/openboard/etc/OpenBoard.config. A user
  10. can override this file acting in local config file ~/.local/share/OpenBoard/OpenBoardUser.config
  11. =============================================================================================
  12. diff -ruN OpenBoard-1.6.0a3-original/OpenBoard.pro OpenBoard-1.6.0a3/OpenBoard.pro
  13. --- OpenBoard-1.6.0a3-original/OpenBoard.pro 2020-05-22 18:40:49.000000000 +0200
  14. +++ OpenBoard-1.6.0a3/OpenBoard.pro 2020-10-24 10:58:50.421254271 +0200
  15. @@ -442,6 +442,10 @@
  16. QMAKE_CFLAGS += -fopenmp
  17. QMAKE_CXXFLAGS += -fopenmp
  18. QMAKE_LFLAGS += -fopenmp
  19. +# RunInWindow patch
  20. + # Necessary for CentOS/RHEL and won't harm in other distributions
  21. + INCLUDEPATH += /usr/include/ffmpeg
  22. +# end patch
  23. UB_LIBRARY.path = $$DESTDIR
  24. UB_I18N.path = $$DESTDIR/i18n
  25. UB_ETC.path = $$DESTDIR
  26. diff -ruN OpenBoard-1.6.0a3-original/resources/etc/OpenBoard.config OpenBoard-1.6.0a3/resources/etc/OpenBoard.config
  27. --- OpenBoard-1.6.0a3-original/resources/etc/OpenBoard.config 2020-05-22 18:40:49.000000000 +0200
  28. +++ OpenBoard-1.6.0a3/resources/etc/OpenBoard.config 2020-10-24 10:59:50.005263852 +0200
  29. @@ -14,6 +14,7 @@
  30. PageCacheSize=20
  31. PreferredLanguage=fr_CH
  32. ProductWebAddress=http://www.openboard.ch
  33. +RunInWindow=false
  34. SoftwareUpdateURL=http://www.openboard.ch/update.json
  35. StartMode=
  36. SwapControlAndDisplayScreens=false
  37. diff -ruN OpenBoard-1.6.0a3-original/src/core/UBApplication.cpp OpenBoard-1.6.0a3/src/core/UBApplication.cpp
  38. --- OpenBoard-1.6.0a3-original/src/core/UBApplication.cpp 2020-05-22 18:40:49.000000000 +0200
  39. +++ OpenBoard-1.6.0a3/src/core/UBApplication.cpp 2020-10-24 11:03:09.881941449 +0200
  40. @@ -277,8 +277,21 @@
  41. gs->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
  42. gs->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
  43. + /* RunInWindow patch */
  44. + if (UBSettings::settings()->appRunInWindow->get().toBool()) {
  45. + mainWindow = new UBMainWindow(0,
  46. + Qt::Window |
  47. + Qt::WindowCloseButtonHint |
  48. + Qt::WindowMinimizeButtonHint |
  49. + Qt::WindowMaximizeButtonHint |
  50. + Qt::WindowShadeButtonHint
  51. + ); // deleted by application destructor
  52. + } else {
  53. + mainWindow = new UBMainWindow(0, Qt::FramelessWindowHint); // deleted by application destructor
  54. + }
  55. + /* mainWindow = new UBMainWindow(0, Qt::FramelessWindowHint); // deleted by application destructor */
  56. + /* end patch */
  57. - mainWindow = new UBMainWindow(0, Qt::FramelessWindowHint); // deleted by application destructor
  58. mainWindow->setAttribute(Qt::WA_NativeWindow, true);
  59. mainWindow->actionCopy->setShortcuts(QKeySequence::Copy);
  60. diff -ruN OpenBoard-1.6.0a3-original/src/core/UBSettings.cpp OpenBoard-1.6.0a3/src/core/UBSettings.cpp
  61. --- OpenBoard-1.6.0a3-original/src/core/UBSettings.cpp 2020-05-22 18:40:49.000000000 +0200
  62. +++ OpenBoard-1.6.0a3/src/core/UBSettings.cpp 2020-10-24 11:02:43.074387051 +0200
  63. @@ -265,6 +265,9 @@
  64. appLookForOpenSankoreInstall = new UBSetting(this, "App", "LookForOpenSankoreInstall", true);
  65. appStartMode = new UBSetting(this, "App", "StartMode", "");
  66. + /* RunInWindow patch */
  67. + appRunInWindow = new UBSetting(this, "App", "RunInWindow", false);
  68. + /* end patch */
  69. featureSliderPosition = new UBSetting(this, "Board", "FeatureSliderPosition", 40);
  70. diff -ruN OpenBoard-1.6.0a3-original/src/core/UBSettings.h OpenBoard-1.6.0a3/src/core/UBSettings.h
  71. --- OpenBoard-1.6.0a3-original/src/core/UBSettings.h 2020-05-22 18:40:49.000000000 +0200
  72. +++ OpenBoard-1.6.0a3/src/core/UBSettings.h 2020-10-24 11:06:13.206894166 +0200
  73. @@ -260,7 +260,9 @@
  74. UBSetting* appHideSwapDisplayScreens;
  75. UBSetting* appToolBarOrientationVertical;
  76. UBSetting* appPreferredLanguage;
  77. -
  78. + /* RunInWindow patch */
  79. + UBSetting* appRunInWindow;
  80. + /* end patch */
  81. UBSetting* appIsInSoftwareUpdateProcess;
  82. UBSetting* appLastSessionDocumentUUID;
  83. diff -ruN OpenBoard-1.6.0a3-original/src/frameworks/UBPlatformUtils_linux.cpp OpenBoard-1.6.0a3/src/frameworks/UBPlatformUtils_linux.cpp
  84. --- OpenBoard-1.6.0a3-original/src/frameworks/UBPlatformUtils_linux.cpp 2020-05-22 18:40:49.000000000 +0200
  85. +++ OpenBoard-1.6.0a3/src/frameworks/UBPlatformUtils_linux.cpp 2020-10-24 11:00:43.708371185 +0200
  86. @@ -36,7 +36,9 @@
  87. #include <X11/keysym.h>
  88. #include "frameworks/UBFileSystemUtils.h"
  89. -
  90. +/* RunInWindow patch */
  91. +#include "core/UBSettings.h"
  92. +/* end patch */
  93. void UBPlatformUtils::init()
  94. {
  95. @@ -439,7 +441,14 @@
  96. void UBPlatformUtils::showFullScreen(QWidget *pWidget)
  97. {
  98. - pWidget->showFullScreen();
  99. + /* RunInWindow patch */
  100. + /* pWidget->showFullScreen(); */
  101. + if (UBSettings::settings()->appRunInWindow->get().toBool()) {
  102. + pWidget->showNormal();
  103. + } else {
  104. + pWidget->showFullScreen();
  105. + }
  106. + /* end patch */
  107. }
  108. void UBPlatformUtils::showOSK(bool show)
  109. diff -ruN OpenBoard-1.6.0a3-original/src/frameworks/UBPlatformUtils_win.cpp OpenBoard-1.6.0a3/src/frameworks/UBPlatformUtils_win.cpp
  110. --- OpenBoard-1.6.0a3-original/src/frameworks/UBPlatformUtils_win.cpp 2020-05-22 18:40:49.000000000 +0200
  111. +++ OpenBoard-1.6.0a3/src/frameworks/UBPlatformUtils_win.cpp 2020-10-24 11:01:26.170665369 +0200
  112. @@ -36,6 +36,9 @@
  113. #include "frameworks/UBFileSystemUtils.h"
  114. #include "core/memcheck.h"
  115. +/* RunInWindow patch */
  116. +#include "core/UBSettings.h"
  117. +/* end patch */
  118. void UBPlatformUtils::init()
  119. {
  120. @@ -436,7 +439,14 @@
  121. void UBPlatformUtils::showFullScreen(QWidget *pWidget)
  122. {
  123. - pWidget->showFullScreen();
  124. + /* RunInWindow patch */
  125. + /* pWidget->showFullScreen(); */
  126. + if (UBSettings::settings()->appRunInWindow->get().toBool()) {
  127. + pWidget->showNormal();
  128. + } else {
  129. + pWidget->showFullScreen();
  130. + }
  131. + /* end patch */
  132. }
  133. void UBPlatformUtils::showOSK(bool show)