Author Topic: Minor nit: PI disappear to the background after saving .psm  (Read 4855 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Hi,

try to following:

- process an image
- drag the process history to the desktop
- save process icons
- click ok/save in the dialog
- PI disappears to the background and whatever was behind it (say Firefox) is now shown

I've seen PI loose focus like this under different conditions as well but this is one that just happened so I thought I'd report it.

Thanks!
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Minor nit: PI disappear to the background after saving .psm
« Reply #1 on: 2008 December 09 01:55:25 »
Hi Sander,

Yes, I know this. It is the infamous "focus steal" problem in Windows. Basically, Windows decides which window has to be focused next when a modal dialog closes, regardless of the application that opened the dialog.

There must be a way to avoid this nasty thing, but I haven't found one that has no other (worse) consequences. I'll keep trying. This is something Windows users have to live with, for now...
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Minor nit: PI disappear to the background after saving .psm
« Reply #2 on: 2008 December 09 05:52:50 »
Hi Juan,

I have to say this is rare with all my other Windows programs. I'm afraid there's something about the widget set perhaps that's doing something odd. Even my own VC++ apps don't rearrange themselves below other applications when a modal child gets closed.

In any case, it's not a big deal. If you're aware of it I'm sure you'll fix it at some point.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Minor nit: PI disappear to the background after saving .psm
« Reply #3 on: 2008 December 10 00:35:11 »
Hi Sander,

Quote
Even my own VC++ apps don't rearrange themselves below other applications when a modal child gets closed.


But PixInsight does not use .NET nor MFC to build and operate its GUI. Our code uses the Qt library and is 100% portable across three platforms, and here is the problem. To solve this issue, I'll have to swim deep into the Windows API ocean to find a solution, then write something like:

#ifdef __PCL_WINDOWS
... do the ugly things Windows needs
#else
... do it the right way
#endif

There are hundreds of these constructs in PixInsight Core's source code. There are six __PCL_MACOSX (mostly in the color management subsystem) and just three __PCL_LINUX.

Edited: By the way, now that I see you're working with VC++, how about some digging into the PCL ?  8)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Minor nit: PI disappear to the background after saving .psm
« Reply #4 on: 2008 December 10 05:59:55 »
Hi Juan,

I'm not quite understanding your logic :) Sounds like Qt is doing the wrong thing and is *not* 100% portable. If you're interested in fixing this you should apply some pressure to them rather than try to code around it. I've heard the same type of reasoning with other multi-platform programs though. I'd ask for sliders that behave better and the response would be something like "sorry Qt doesn't support that but isn't it great that this also works on a Mac?". Yes, for Mac users, not for me :) "Lowest common denominator" was a term frequently used. Clearly PI works fine on Windows but I am learning that cross platform tools have disadvantages that I need to weigh when making my purchase decisions. If cross-platform-ness is added after I buy the product all I can do is advocate proper Windows support.

Maybe I'll pick up PCL one of these days. When I last looked at it it was pretty complicated and the only documentation is the class reference. That's handy once you know how to code a PCL module but doesn't put them context. I'll download and install the PCL and see what's included.

Of course the main thing I need is motivation to write a module. I'll keep it in mind.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Minor nit: PI disappear to the background after saving .psm
« Reply #5 on: 2008 December 10 08:38:41 »
Quote
I am learning that cross platform tools have disadvantages that I need to weigh when making my purchase decisions


Well, nothing is perfect. Everything has its pros and cons, and cross-platform-ability isn't an exception. But honestly, the pros are much much more than the cons. Personally, I cannot imagine software development, especially something like PI, tied to a particular platform; it would lose most of its sense, at least for me.

Quote
If you're interested in fixing this you should apply some pressure to them


Here you're right, of course. However the real problem is me, not them. Trolltech (now owned by Nokia) has a team of extremely nice and responsive support guys. They are always ready to help (and they do really know Qt stuff), but to fix something like this "losing focus" thing, I have to dedicate a lot of time to present the problem in a way suitable for them to analyze and find it.

In other words: if I build one of Qt's standard example programs, the application does not lose focus after a modal dialog on Windows. But PI does. So the problem is a weird interaction between PI, Qt, and Windows. Now the real problem is finding it... I'll do, of course :)

Quote
When I last looked at it it was pretty complicated and the only documentation is the class reference.


True. Documentation: my worst nightmare :) I hope this will change in the short term. In the meanwhile, you know I'm here to help if you decide to start writing something (oh, I've heard you fix defects in your images with your own software, hmmm... :twisted: )

Well, it seems compilation has finished, so return to work!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Minor nit: PI disappear to the background after saving .psm
« Reply #6 on: 2008 December 10 14:03:18 »
Yes, I've written some fitsio based software. It was much easier for me to write that code in straight up C++/cfitsio. Sure, writing it with PCL was an option but that would limit my audience. So far no one's expressed an interest in the utility so I haven't published it yet. I have some ideas for a PI module so who knows, maybe I'll write one some day. I think PI is missing some measurement tools such as a profile tool as included in AIP4WIN (broken), Fitswork and probably others. I'll contact you when I have a proposal.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity