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 » Bug: TopMost blocks Prompt dialog
Re: Bug: TopMost blocks Prompt dialog [message #18914 is a reply to message #18822] Fri, 31 October 2008 15:21 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
mrjt wrote on Fri, 24 October 2008 10:04

The problem:
- You have a child window (opened with TopWindow::Open(this)) with TopMost(true, true) set.
- The parent window opens a Prompt (PromptOK etc)
- If the TopMost child window is in the center of the parent (where the Prompt will appear) then the prompt dialog is invisible, hidden behind the child window.
- Because the prompt is run with RunAppModal it is not possible to move the child window to reveal it, effectively locking up the application. You can hit return/escape to clear it but that's not ideal as the user may not even realise a prompt has been opened.

This is only a fatal problem on Windows, as on X11 the WM still allows you to move windows even with an AppModal dialog running.

My fix:
Setting TopMost on the prompt dialog before it's opened seems to fix it.

Test package attached. Tested against the svn version (2008.1 is actaully worse since you can't even use return/escape to clear the prompt)


Well, this is one little nast problem...

The problem is that TopMost in Prompt in all cases does not sound too good from user perspective. IMO, user still wants to see some other app else when Prompt appears.

In the end, I have used this desperate solution:

	dlg.Open();
	Vector<Ctrl *> wins = Ctrl::GetTopWindows();
	for(int i = 0; i < wins.GetCount(); i++) {
		TopWindow *w = dynamic_cast<TopWindow *>(wins[i]);
		if(w->GetScreenRect().Intersects(dlg.GetScreenRect()) && w->IsTopMost()) {
			dlg.TopMost();
			break;
		}
	}
	dlg.Title(title);
	return dlg.RunAppModal();


Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Howto Drop Files into a TopWindow please?
Next Topic: starting program hidden and putting it in start up
Goto Forum:
  


Current Time: Sun Jun 15 14:05:32 CEST 2025

Total time taken to generate the page: 0.03731 seconds