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 » Developing U++ » U++ Developers corner » Eye Care example topmost not working. (How to set a window to stay at the top of the z-order)
Eye Care example topmost not working. [message #44061] Sat, 20 December 2014 20:30 Go to next message
rainbowsally is currently offline  rainbowsally
Messages: 29
Registered: December 2014
Promising Member
The TopMost(bool) function sets or resets the x11 attribute for a window that can stay on top of all the others.

Here's the fix for the Eye Care example for linux folks.

void EyeCare::Sync()
{
#ifdef PLATFORM_WIN32
	ExStyle(config.topmost ? GetExStyle() | WS_EX_TOPMOST
	                       : GetExStyle() & ~WS_EX_TOPMOST);
  // -rs add these two lines
#else
	config.topmost ? TopMost(true) : TopMost(false);
#endif
	trayicon.Icon(ignore ? EyeCareImg::off() : EyeCareImg::icon());
	if(config.hideicon)
		ignore = false;
	trayicon.Show(!config.hideicon);
	Restart();
}

Re: Eye Care example topmost not working. [message #44093 is a reply to message #44061] Wed, 24 December 2014 12:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
rainbowsally wrote on Sat, 20 December 2014 20:30
The TopMost(bool) function sets or resets the x11 attribute for a window that can stay on top of all the others.

Here's the fix for the Eye Care example for linux folks.

void EyeCare::Sync()
{
#ifdef PLATFORM_WIN32
	ExStyle(config.topmost ? GetExStyle() | WS_EX_TOPMOST
	                       : GetExStyle() & ~WS_EX_TOPMOST);
  // -rs add these two lines
#else
	config.topmost ? TopMost(true) : TopMost(false);
#endif
	trayicon.Icon(ignore ? EyeCareImg::off() : EyeCareImg::icon());
	if(config.hideicon)
		ignore = false;
	trayicon.Show(!config.hideicon);
	Restart();
}




Thanks for reporting. The problem was that by the time that example was created, TopWindow did not have TopMost method yet. Now whole thing was replaced with TopMost(config.topmost).
Re: Eye Care example topmost not working. [message #44110 is a reply to message #44093] Thu, 25 December 2014 14:24 Go to previous messageGo to next message
rainbowsally is currently offline  rainbowsally
Messages: 29
Registered: December 2014
Promising Member
mirek wrote on Wed, 24 December 2014 12:25

<snip>
Thanks for reporting. The problem was that by the time that example was created, TopWindow did not have TopMost method yet. Now whole thing was replaced with TopMost(config.topmost).


There's a way to set the _NET_STAYS_ON_TOP (or whatever it's called) atom in X without any dependency on Qt or any other toolkit.

I've done it with FLTK 2.0 (a discontinued version). But I don't yet know how to integrate it into U++ yet or if that's even desirable. What we have now works but if we need generic X11 code, I may be able to help. Smile
Re: Eye Care example topmost not working. [message #46263 is a reply to message #44110] Sun, 03 April 2016 11:33 Go to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
rainbowsally wrote on Thu, 25 December 2014 05:24
mirek wrote on Wed, 24 December 2014 12:25

<snip>
The problem was that by the time that example was created, TopWindow did not have TopMost method yet. Now whole thing was replaced with TopMost(config.topmost).





How long will it be before the eye care 'corrected' example will be included in the upp downloads.

"TopWindow did not have TopMost method yet"

"Now whole thing was replaced with TopMost(config.topmost)."

Is this how the upp code will handle topmost?

[Updated on: Sun, 03 April 2016 11:39]

Report message to a moderator

Previous Topic: redmine inaccessible
Next Topic: Cross compiling with mingw
Goto Forum:
  


Current Time: Thu Apr 18 14:50:35 CEST 2024

Total time taken to generate the page: 0.01671 seconds