×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

EKOS window: always on top

  • Posts: 216
  • Thank you received: 120
There is currently code in Ekos that makes itself always on top on certain systems, unless the "Independent Window" checkbox is checked in settings. Currently, on a Mac (but not other systems), checking that box makes the Ekos window NOT always on top. It also seems that whether the Ekos window is always on top is somewhat dependent on the window manager in use. Ubuntu 18.04 doesn't make it always on top, but 20.04 does with some window managers (xfwm for one). Since making changes to the window managers would be a much longer process (and probably wouldn't get included in the 20.04 LTS until the next point release at the earliest), I took a look at modifying the Ekos code to get what we need.

My code change as it is now in the merge request (MR), makes it so it is never an always on top window, regardless of the "Independent Window" checkbox.

I have a question for the group: Is there any reason why you would want Ekos to be always on top, whether or no the "Independent Window" checkbox is checked? I can't think of any for my workflow, but someone might have a need for it.
3 years 7 months ago #58868

Please Log in or Create an account to join the conversation.

  • Posts: 535
  • Thank you received: 109

Replied by Jim on topic EKOS window: always on top


Hi Steve, Thank you for the clarification. An MR (also called a PR on some systems) is a Merge Request. It is a code change that is proposed by a developer for review by peers before becoming part of the main code base (a merge to master in git terms).

There is an MR created that changes the behaviour of the Ekos window in respect to if it is always on top. This is a change in the Qt5 configuration, a set of libraries that control the graphical interface for the application, and how things are displayed to users.

Different distributions have different versions of Qt installed, and how the windows are handled in those versions of Qt, along with tweaks made by the different distributions can manifest in different behaviours of the visual windows, as you have seen with the list you are compiling.

I just built a local copy of kstars using the change in the MR to see if it works on my system, which consists of Fedora 32, running gnome 3.36 with Qt 5.14. The version of the actual window manager may also matter, for the same reason as Qt.

The permutations of kernel, distribution, X/Wayland (low level display driver things), window manager, and Qt are really too many to all be tested, so the hope is everyone that tests the changes in the MR has a better experience no matter the combination.

Hope this helps
Jim
3 years 7 months ago #58869

Please Log in or Create an account to join the conversation.

  • Posts: 535
  • Thank you received: 109

Replied by Jim on topic EKOS window: always on top

My diff looks like this:
diff --git a/kstars/ekos/manager.cpp b/kstars/ekos/manager.cpp
index d4ba96cb3..1554f717f 100644
--- a/kstars/ekos/manager.cpp
+++ b/kstars/ekos/manager.cpp
@@ -84,8 +84,8 @@ Manager::Manager(QWidget * parent) : QDialog(parent)
                 SLOT(changeAlwaysOnTop(Qt::ApplicationState)));
     }
 #else
-    //    if (Options::independentWindowEkos())
-    //        setWindowFlags(Qt::Window | Qt::WindowStaysOnTopHint);
+        if (Options::independentWindowEkos())
+            setWindowFlags(Qt::Window);
 #endif
     setupUi(this); 

And has the desired effect for my systems without changing how the MaxOS section looks or works. The proposed MR comment code (not the actual MR) cleans this up even more, and has the same effect.

Last edit: 3 years 7 months ago by Jim. Reason: aparently editing a post with code tags changed the tags from [] to which does not work
3 years 7 months ago #58871
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120
Yeah, that's similar to the change I posted in the MR comments. But my question still stands, is there a reason to have Ekos always on top at any time, even if it is not an independent window?
3 years 7 months ago #58873

Please Log in or Create an account to join the conversation.

  • Posts: 535
  • Thank you received: 109

Replied by Jim on topic EKOS window: always on top


I do not know of a reason, but would certainly like to hear one if there is. I think @knro knows, but he's not saying :)
3 years 7 months ago #58874

Please Log in or Create an account to join the conversation.

  • Posts: 348
  • Thank you received: 69

Replied by Giles on topic EKOS window: always on top

Did someone mention they'd tested this on MacOs? If so, please let someone know, they're waiting on a positive confirmation on that.

Also think waiting on Win64.
3 years 7 months ago #58876

Please Log in or Create an account to join the conversation.

  • Posts: 1009
  • Thank you received: 133
Just the short notice that I don't have the issues here with Plasma 5.19/ Qt5.15 / kwin (openSUSE Tumbleweed). So it seems it is some *buntu specific thing?
Is this X11 or Wayland? (mine is X11)
3 years 7 months ago #58924

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120
It seems highly dependent on the window manager (and even the version of the wm) you are using. Example, in xubuntu 18.04, I think things work as you'd expect, but Ekos stays on top all the time in xubuntu 20.04.
3 years 7 months ago #58932

Please Log in or Create an account to join the conversation.

  • Posts: 472
  • Thank you received: 165
I came across this same issue when updating to 20.04 back in April and forgot about it since then, I just changed the Ekos Manager class to be inherited from QWidget instead of QDialog like this:
--- a/kstars/ekos/manager.cpp
+++ b/kstars/ekos/manager.cpp
@@ -71,7 +71,7 @@ void Manager::release()
delete _Manager;
}

-Manager::Manager(QWidget * parent) : QDialog(parent)
+Manager::Manager(QWidget * parent) : QWidget(parent, Qt::Window)
{
#ifdef Q_OS_OSX

and:

diff --git a/kstars/ekos/manager.h b/kstars/ekos/manager.h
index 6a7892d06..35133227c 100644
--- a/kstars/ekos/manager.h
+++ b/kstars/ekos/manager.h
@@ -78,7 +78,7 @@ class KPageWidgetItem;
namespace Ekos
{

-class Manager : public QDialog, public Ui::Manager
+class Manager : public QWidget, public Ui::Manager
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.Ekos")
3 years 7 months ago #58936

Please Log in or Create an account to join the conversation.

  • Posts: 21
  • Thank you received: 4
Thank you. This works :-)
3 years 6 months ago #59306

Please Log in or Create an account to join the conversation.

Time to create page: 0.841 seconds