Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TopWindow&PopUp, TrayIcon » Dialog windows showing semi randomly on the task bar on Linux
Dialog windows showing semi randomly on the task bar on Linux [message #50335] Thu, 27 September 2018 01:47 Go to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
This issue happens only on Linux and obviously on a flavor of Linux with a traditional desktop with a bar. I am using kde.

The issue:
The main window of the program shows on the task bar. This is expected.
If the program executes a dialog window, the dialog window doesn't show up on the task bar. This is also expected.
If the program presents a prompt before executing the dialog, the dialog and main window show up separately on the task bar. The prompt doesn't;
This is confusing, because they can now also be activated separately and unexpected.

index.php?t=getfile&id=5668&private=0


Upp 9251, Linux Mint 17.3 64 bit KDE. Effect is also seen on newer versions of Linux.

[Updated on: Thu, 27 September 2018 02:20]

Report message to a moderator

Re: Dialog windows showing semi randomly on the task bar on Linux [message #50336 is a reply to message #50335] Thu, 27 September 2018 02:30 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
XFCE on Xenial
index.php?t=getfile&id=5670&private=0
  • Attachment: xfce.png
    (Size: 3.48KB, Downloaded 358 times)
Re: Dialog windows showing semi randomly on the task bar on Linux [message #50339 is a reply to message #50335] Thu, 27 September 2018 14:41 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
so this shows only the program on the task bar.
void MyApp::MyFunction()
{
  SomeDialog dlg;
  dlg.Execute();
}



and this shows the program and the dialog separately on the task bar Confused
void MyApp::MyFunction()
{
  PromptOK("a message");
  SomeDialog dlg;
  dlg.Execute();
}


That has to be a bug.

But.. if I do this, it doesn't happen.
TimeCallback timer;
void MyApp::MyFunction1()
{
  PromptOK("a message");
  timer.Set(1, THISBACK(MyFunction2));
}
void MyApp::MyFunction2()
{
  SomeDialog dlg;
  dlg.Execute();
}

(and none of it happens on Windows)

[Updated on: Thu, 27 September 2018 16:13]

Report message to a moderator

Re: Dialog windows showing semi randomly on the task bar on Linux [message #50340 is a reply to message #50339] Thu, 27 September 2018 16:08 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello Alboni,

As far as I can see, the below function seems to be a standalone function (not a member/method of any TopWindow, or its derivative).
Therefore you are probably opening two top windows sequentially. hence the two taskbar entries.

void MyFunction()
{
  PromptOK("a message"); // The first topmost window.
  SomeDialog dlg;
  dlg.Execute();         // The second topmost window.
}


Best regards,
Oblivion


Re: Dialog windows showing semi randomly on the task bar on Linux [message #50341 is a reply to message #50340] Thu, 27 September 2018 16:12 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
They are part of a class.
I will change the message to reflect this.
The full example can be downloaded in the first message.
Re: Dialog windows showing semi randomly on the task bar on Linux [message #50342 is a reply to message #50341] Thu, 27 September 2018 16:30 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Yep it is reproducible under Gnome too.
I'm not sure if this is an error, Mirek will know better, of course. But in the meantime all you need to do is pass the owner and then execute/run the child.

This should work:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

#define LAYOUTFILE <TaskManagerTest/TaskManagerTest.lay>
#include <CtrlCore/lay.h>

class TaskManagerTest : public WithTaskManagerTestLayout<TopWindow> {
public:
	typedef TaskManagerTest CLASSNAME;
	TaskManagerTest()
	{
		CtrlLayout(*this, "Main Window");
		button1<<=THISBACK1(Press, false);
		button2<<=THISBACK1(Press, true);
	}
	void Press(bool ok)
	{
		if (ok)
			PromptOK("Notice the child window having a seperate item on the taskbar after closing this message");
		
		WithChildLayout<TopWindow> w;
		CtrlLayout(w, "Child Window");
		w.Open(this);
		w.Execute();
	}
};


GUI_APP_MAIN
{
	TaskManagerTest().Run();
}



Best regards,
Oblivion


[Updated on: Thu, 27 September 2018 16:30]

Report message to a moderator

Re: Dialog windows showing semi randomly on the task bar on Linux [message #50343 is a reply to message #50342] Thu, 27 September 2018 17:12 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 214
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
Thanks. That works in the example, but not in my real world app. Adding dialog.Open(this) before Execute() makes the dialog appear on the wrong monitor and then the app segfaults.
Weird

[Updated on: Thu, 27 September 2018 17:19]

Report message to a moderator

Re: Dialog windows showing semi randomly on the task bar on Linux [message #50449 is a reply to message #50335] Wed, 31 October 2018 14:52 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Hopefully fixed, please try.

That said, Oblivion suggested correct fix - the real cause of the problem is that if you do not supply "owner" with Open, current active window is used as "owner". Here, the Prompt confused U++ to lose track about what current active window is.
Previous Topic: How often is Update called? Is there a similiar frequently called method?
Next Topic: Linux dual monitor: Not showing a TopWindow on the task bar
Goto Forum:
  


Current Time: Thu Mar 28 10:45:27 CET 2024

Total time taken to generate the page: 0.01812 seconds